Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326624

Summary: [planner] Projector behaviour change between 3.6.0 and 3.6.1
Product: [Eclipse Project] Equinox Reporter: Igor Fedorenko <igor>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: bvitale3002, leberre, pascal
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
unit test that demonstrates Projector behaviour change none

Description Igor Fedorenko CLA 2010-09-29 23:35:53 EDT
Created attachment 179918 [details]
unit test that demonstrates Projector behaviour change

Ran into this issue while updating Tycho to use P2 3.6.1. From what I can tell, Project now simply ignores optional requirements, at least in some cases. Attached unit test runs successfully with P2 3.6.0, but fails with P2 3.6.1.

FYI, the underlying use case here is to calculate build target platform of a project that has provides some extra functionality in presence of an optional dependency. The extra functionality is provided via an extension point and corresponding java code, so the optional (at runtime) dependency must be present in the build target platform
Comment 1 DJ Houghton CLA 2010-09-30 11:54:22 EDT
The only changes to the projector between 3.6 and 3.6.1 were for bug 323322. Not sure if it is related though, as it doesn't seem to be related to optional dependencies.

Adding Pascal and Daniel to the CC list for comment.
Comment 2 Daniel Le Berre CLA 2010-09-30 12:23:16 EDT
Pascal,

could you take a look at the zip file and translate into greedy/optional requirements that test case?

The changes for bug 323322 might change the outcome of some testcases by providing equally good other solutions.
Comment 3 Pascal Rapicault CLA 2010-10-30 22:36:40 EDT
In the 3.6.x branch I committed the test case originally provided and a new test case that I wrote.
The result is interesting:
- The new test case (called Bug326624), that is only using the p2 API, shows that the resolver is behaving properly.
- The original test case that is not using the API is failing (as expected). The test is committed in a package of its own (org.eclipse.equinox.p2.test.bug326624) but it contains hardcoded paths that need to be changed before you run the tests. If we ever decide to keep the test, I will fix the paths. 

The main difference between the two tests is that one uses the API and thus the SimplePlanner, whereas the other uses some internals. I have reviewed the code and could not see any obvious mistake. After that I reviewed the execution of the code quickly and could not see any difference, however I did not try to compare the complete encoding.

Daniel, even though this usage is not supported, could you please still see what is going on? Thx.
Comment 4 Daniel Le Berre CLA 2010-11-02 03:03:07 EDT
ok, I will dig into it.
Comment 5 Pascal Rapicault CLA 2010-11-09 22:48:53 EST
This seems to relate to #329279
Comment 6 Daniel Le Berre CLA 2010-11-11 15:28:51 EST
This is very likely caused by the issue found on bug 329279.

When an optional requirement is propagating the installation of many other IUs, it was simply ignored. The fix in HEAD and in the maintenance branch should fix that issue.

We still need to understand why we observe a different behavior using the API and internal code.