Community
Participate
Working Groups
As a result of investigating bug 329202, Andrew, DJ and I discovered that the director isn't installing optional source features for the SDK. The eclipse SDK generates the platform source feature and optional equinox.p2.user.ui.source feature. If you run the p2.director from M3 with the following arguments, the org.eclipse.equinox.p2.user.ui feature and associated bundles will be included in the install, but not org.eclipse.equinox.p2.user.ui.source components. -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -metadataRepository http://download.eclipse.org/eclipse/updates/3.7milestones/S-3.7M2a-201009211024 -artifactRepository http://download.eclipse.org/eclipse/updates/3.7milestones/S-3.7M2a-201009211024 -installIU org.eclipse.sdk.ide -os linux -ws gtk -arch x86 -destination c:\installSDK -profile SDKProfile -profileProperties org.eclipse.update.install.features=true This issue first appeared during M3, as the M2a build seems fine.
(In reply to comment #0) > This issue first appeared during M3, as the M2a build seems fine. I can reproduce this problem using the 3.6.1 director. It's *not* a problem with the 3.6.0 director. I'm investigating a similar problem with my own product build (against 3.6.1) where an optional dependency is not being included by the director. I am wondering if bug 326624 is at play here. Following that back to the delta between 3.6.0 and 3.6.1, bug 323322 has this comment from DJ: "There was a problem with tagging HEAD so this fix won't appear in integration builds until the first build after 3.7 M2." If there is in fact a side effect from the fix for bug 323322 which is causing this behavior, that comment may explain why you didn't see it in M2?
the irony of p2 not installing its own source bundles is amusing. ;-)
yes, I thought the same thing :-)
This issue also applies to 3.6.2
Unfortunately this is not the first in the life of p2 that it decides to optimize itself out :) I remember we had such a situation in 3.4 release. Oh well :)
This looks similar to bug #326624
Hum, there must be something else in that source bundle than being optional. We have many test cases regarding the expected behavior for the projector on optional packages and they all pass. Pascal, could you create me a test case such that I can check in the encoding what's going on? Ben, what other feature has the optional dependency that is not installed? I have found a simpler way to encode optional dependencies this summer. If we can have testcases for this problem and bug 329202, I could implement it on HEAD to see if it solves those problems.
The irony is not lost in my case, either. I have a product which specifies a dependency on org.eclipse.platform, which has an optional dependency on org.eclipse.equinox.p2.user.ui (the real bundle, not the source). Since 3.6.1, the p2 feature is not installed by the director automatically.
Sorry about that Ben.
The only change that was made between 3.6.0 and 3.6.1 was to make sure that we where not installing anything "for free", i.e. all installed packages do cost something, in order to be sure that any change to an installation is affected by a cost, to make it stable. It was not happening in 3.6.0 because we introduced the notion of greed to the encoding. The problem must lie in the interaction between greedy and optional dependencies. I guess it is the case for the source feature. Is it also the case for your problem Ben?
Daniel, I just committed a test case reproducing Kim's issue. The test is called Bug329279.
ok, thanks Pascal. Will try to dig into it. I basically can no longer work on my Linux machine because of bug 323881 :(
Pascal, I do not see your testcase in HEAD.
The file is there: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug329279.java?root=RT_Project&view=log There can be two problems, you are not on the right branch or you are not using extssh as a connection.
Created attachment 182867 [details] Artifacts used to demonstrate a non-source bundle being dropped The attached zip file contains a bundle and a feature. A basic feature-based product is defined. When exported from the 3.6.0 IDE, the p2.user.ui feature appears in both the repository and the installed product. When exported from the 3.6.1 IDE, the p2.user.ui feature appears in the repository but *not* the installed product. I should note that my real world scenario involves a headless product build, not an export from the IDE. The end result is the same. (Hoping Pascal can translate into a low-level test case.)
(In reply to comment #9) > Sorry about that Ben. No worries, the workaround to include the missing feature is straightforward and simple: declare it as a dependency.
I started looking at that testcase. It is an optimization function problem: the "score" of the installation without the source feature is better than when it is installed. I need to investigate further to see why it happens.
Created attachment 182899 [details] Change weighting scheme to fix the problem Here is a simple fix for that bug. Installing an optional package can propagate the installation of many other packages. As such, depending of the weight we put on the installation of the optional package, it might be "better" not to install it if the consequence of installing it is to get many individual penalties. For instance, if A is optional, and requires to install B, C, D and E, then we get a penalty p for installing B,C,D and E and a reward r for installing A. r must be set in such a way that whatever the number of packages that must be installed to satisfy the optional dependency, the reward is always greater to the sum of the penalty. The is the object of that patch, that uses for the reward a new value that cannot be compensated.
If you are happy with the patch, feel free to release in HEAD and in the branch.
Done. I also included this bug test case to AllTests on HEAD.
I released the bundles from I20101117-0800 to the builder and verified that it fixed the issue in build N20101117-2000. Merci Daniel et Pascal!
Thanks Kim for giving it a try. We let you close that bug.
Closing.