Community
Participate
Working Groups
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
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.
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.
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.
ok, I will dig into it.
This seems to relate to #329279
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.