Community
Participate
Working Groups
When we build an update site we should generate p2 metadata. This would avoid having to "auto-generate" the metadata at install time (i.e. like p2 does for old update sites). Start with set of properties we have in feature export.
Tried a couple of things, but keep running into the following generic error. If I specify a sub directory in the update project and set publish artifacts to true, I get the artifacts, content.xml and artifacts.xml all generating, but the error still occurs. Problems during export C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:208: The following error occurred while executing this line: C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:218: An error occurred when calling generator. The following error occurred while executing this line: C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:218: An error occurred when calling generator. C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:208: The following error occurred while executing this line: C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:218: An error occurred when calling generator. The following error occurred while executing this line: C:\Workspace Target\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86.xml:218: An error occurred when calling generator.
Did some debugging and figured it out. I was getting an NPE in the p2 generator. I'm not really sure how I got it into this state, but the generator was trying to add jdt debug to the IUs (even though I was building the CVS feature) and no file existed for the bundle. For reference the NPE occurs at org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:169), org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:163), org.eclipse.equinox.internal.provisional.p2.metadata.generator.Generator.publishArtifact(Generator.java:1143), org.eclipse.equinox.internal.provisional.p2.metadata.generator.Generator.generateBundleIUs(Generator.java:361), org.eclipse.equinox.internal.provisional.p2.metadata.generator.Generator.generate(Generator.java:305), ...
Dealt with the NPE by cleaning out my target workspace. I am now able to generate a p2 repo and install from it. However, I tried to specify the artifact and metadata repositories as the base of the project (so the site.xml, content.xml and artifact.xml are all at the root) and got another generic error from the generator. Debugging showed that the error is because the repository is not modifiable. This works when creating a new directory as doing so will create a new repository. However, when specifying the project, an UpdateSiteArtifactRepository is returned. That class does not override isModifiable() and the super class always returns false. If the repository is unmodifiable, an error is thrown. To me, it makes more sense to have the repo be at the root of the project and reuse the plugins/features folders generated by the update site build. I believe that this is a bug in the design of the UpdateSiteArtifactRepository class, as I see no reason why the repo couldn't be modified.
Created attachment 96471 [details] Simple fix Adds in p2 metadata generation to update site building. Two problems: 1) Can't have the p2 repo at the root of the project. Depends on bug 227383. 2) If you rebuild the site with different features, they are appended, so you can have stale data in the repo.
The second problem, appending to the metadata repo, is more complex than I originally thought. If we leave appending on, as features get removed from site.xml, they may not be removed from the repo. However, if we turn off appending and the repo gets deleted each time we build, we might be deleting valid features. For example, if the site.xml defines features A, B and C, and we only select A and hit build, if the repo gets deleted before building, only A would be in the repo while A, B and C are all available in site.xml. I'm not sure what to do about this. Perhaps we can call the generator script for all features in site.xml. Because we wouldn't be generating artifacts, it should be quick.
Created attachment 97254 [details] Fix With Bug 227283 fixed, I can now put the metadata the the root. Because we don't have to create duplicate artifacts, it's quite fast to run. I think the solution to the appending problem is to leave things as they are. Currently, if you build a site.xml, remove one or more features and build again, you'll end up with all the artifacts from the builds. Building a site does not delete existing artifacts. So it makes enough sense to not delete them from the artifact.xml and content.xml. It is also very easy to delete the two files before building to generate them from scratch.
Curtis, are you happy with this patch for M7? It looks straightforward and mimicks the existing behavior. I'm happy with it.
Yes, I'm happy with it. Hopefully people who are actually making live update sites will be happy with it :)
done. > 20080424 I will do further testing on the plane, so far, it doens't look like people targetting other versions are affected.
Created attachment 97455 [details] mylyn/context/zip