-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5) #2977
Comments
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
Currently units from p2.inf are not published to the target-platform what can fail resolving when these are referenced in the project. This publishes these units into the target-platform state of the project. Fix eclipse-tycho#2977
Currently units from p2.inf are not published to the target-platform what can fail resolving when these are referenced in the project. This publishes these units into the target-platform state of the project. Fix eclipse-tycho#2977
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
Currently units from p2.inf are not published to the target-platform what can fail resolving when these are referenced in the project. This publishes these units into the target-platform state of the project. Fix eclipse-tycho#2977
Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
Currently units from p2.inf are not published to the target-platform what can fail resolving when these are referenced in the project. This publishes these units into the target-platform state of the project. Fix #2977
These changes show that the fix for issue eclipse-tycho#2977 made in PR eclipse-tycho#2989 was partial. When there is another bundle/plugin that requires the bundle which contains the p2.inf file that provides and requires the virtual IU the original error is triggered again even with Tycho 4.0.4.
@laeubi Unfortunately the changes made in PR #2989 partially fixes it. If you have another bundle in which the
See these changes to the originally provided integration test: master...mdaloia:tycho:pr-2977-partial-fix Try building it with: Let me know if do you want me to provide a PR with these modifications to the IT, create another IT, or any other thing. Thanks in advance! |
@mdaloia I just thought that such case might came up... :-\ I think the best would be to have an additional case, so one can investigate to solve this, but maybe in such a case you want to make the requirement optional and greedy instead? Then it won't be required at build time. |
@laeubi Thanks for the hint about using a requirement optional and greedy... it worked. Ok, I will provide another reproducer example. BTW, Do you know if there is any other documentation than this one https://wiki.eclipse.org/Equinox/p2/Customizing_Metadata that explains what is/means all the available options? |
I fear not Also Tycho has some docs that might deserve some docs about p2.inf usage: https://github.com/eclipse-tycho/tycho/tree/master/src/site |
The fix of PR eclipse-tycho#2978 was a partial fix for issue eclipse-tycho#2977. It fixed the case of a single bundled but when the bundle providing/requiring the virtual IU is required by another bundle it fails with the same error as before even with Tycho 4.0.4: ``` [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: pvumb.bundle2 1.0.0.qualifier [ERROR] Missing requirement: pvumb.bundle1 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvumb.bundle1 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: pvumb.bundle2 1.0.0.qualifier depends on: osgi.bundle; pvumb.bundle1 0.0.0 ``` A workaround is to use: ``` requires.0.optional=true requires.0.greedy=true ```
The fix of PR eclipse-tycho#2978 was a partial fix for issue eclipse-tycho#2977. It fixed the case of a single bundled but when the bundle providing/requiring the virtual IU is required by another bundle it fails with the same error as before even with Tycho 4.0.4: ``` [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: pvumb.bundle2 1.0.0.qualifier [ERROR] Missing requirement: pvumb.bundle1 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvumb.bundle1 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: pvumb.bundle2 1.0.0.qualifier depends on: osgi.bundle; pvumb.bundle1 0.0.0 ``` A workaround is to use: ``` requires.0.optional=true requires.0.greedy=true ```
The fix of PR #2978 was a partial fix for issue #2977. It fixed the case of a single bundled but when the bundle providing/requiring the virtual IU is required by another bundle it fails with the same error as before even with Tycho 4.0.4: ``` [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: pvumb.bundle2 1.0.0.qualifier [ERROR] Missing requirement: pvumb.bundle1 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvumb.bundle1 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: pvumb.bundle2 1.0.0.qualifier depends on: osgi.bundle; pvumb.bundle1 0.0.0 ``` A workaround is to use: ``` requires.0.optional=true requires.0.greedy=true ```
The fix of PR eclipse-tycho#2978 was a partial fix for issue eclipse-tycho#2977. It fixed the case of a single bundled but when the bundle providing/requiring the virtual IU is required by another bundle it fails with the same error as before even with Tycho 4.0.4: ``` [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: pvumb.bundle2 1.0.0.qualifier [ERROR] Missing requirement: pvumb.bundle1 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvumb.bundle1 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: pvumb.bundle2 1.0.0.qualifier depends on: osgi.bundle; pvumb.bundle1 0.0.0 ``` A workaround is to use: ``` requires.0.optional=true requires.0.greedy=true ```
The fix of PR #2978 was a partial fix for issue #2977. It fixed the case of a single bundled but when the bundle providing/requiring the virtual IU is required by another bundle it fails with the same error as before even with Tycho 4.0.4: ``` [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: pvumb.bundle2 1.0.0.qualifier [ERROR] Missing requirement: pvumb.bundle1 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvumb.bundle1 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: pvumb.bundle2 1.0.0.qualifier depends on: osgi.bundle; pvumb.bundle1 0.0.0 ``` A workaround is to use: ``` requires.0.optional=true requires.0.greedy=true ```
Discussed in #2972
Originally posted by mdaloia October 30, 2023
Hi,
We have a "virtual" IU provided and required in a p2.inf file of a bundle to add a touchpoint configuration (it really doesn't matter what it does) that used to work in 3.0.5. We are migrating to 4.0.3 and found that it fails with:
I have reduced it to an example project: https://github.com/mdaloia/tycho-p2-inf
(Environment used: Maven 3.9.4 / Java 17)
If I build it with
mvn clean package -Dtycho.localArtifacts=ignore -Dtycho-version=4.0.3
it fails with the mentioned error and no
target/p2content.xml
is created.I tried adding
-Dtycho.resolver.classic=false
as explained in "mixed reactor setups require the new resolver now" but I got the same error.But if I only change the version:
mvn clean package -Dtycho.localArtifacts=ignore -Dtycho-version=3.0.5
it works and in the
target/p2content.xml
file I see the<unit id='configure.p2.inf'>
and the<required namespace='org.eclipse.equinox.p2.iu' name='configure.p2.inf' range='0.0.0'/>
This is because I have
<pomDependencies>consider</pomDependencies>
and it shows this message:If I remove this configuration it fails with the same error as using 4.0.3.
The text was updated successfully, but these errors were encountered: