Skip to content
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

Add a reproducer to show that PR #2978 was a partial fix #3039

Closed
wants to merge 1 commit into from

Conversation

mdaloia
Copy link
Contributor

@mdaloia mdaloia commented Nov 14, 2023

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

This PR provides a new Integration Test case that shows this scenario. Previous one was refactored a little bit to avoid duplications.

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
```
Copy link

Test Results

   570 files  ±0     570 suites  ±0   4h 21m 14s ⏱️ - 45m 51s
   375 tests +1     368 ✔️ ±0    6 💤 ±0  0 ±0  1 🔥 +1 
1 125 runs  +3  1 103 ✔️ ±0  19 💤 ±0  0 ±0  3 🔥 +3 

For more details on these errors, see this check.

Results for commit 2cbbdb7. ± Comparison against base commit 57ba377.

@laeubi
Copy link
Member

laeubi commented Nov 22, 2023

@mdaloia thanks for the test-case, in general I wonder why

A workaround is to use:

you think this is a workaround, can you maybe explain why a hard requirement to artificial IUs is used in your setup? This seems more that only one bundle should have it and then add that to a feature (or even let the feature host the p2.inf) instead of several bundles requiring this IU?

@mdaloia
Copy link
Contributor Author

mdaloia commented Nov 24, 2023

@laeubi our case to use this artificial IU is to add some p2 instructions that changes the --launcher.library only for Linux product. The p2.inf with these instructions are in a plugin (not a feature). I don't know why other plug-ins are requiring it (I guess that it must be because the host/root plugin is required by others plug-ins so transitively it is required).
I thought on creating a fragment also as another way (I haven't tested if it would have worked or not) but it seemed too cumbersome having another bundle just for a p2.inf file.

@laeubi
Copy link
Member

laeubi commented Dec 5, 2023

I don't know why other plug-ins are requiring it (I guess that it must be because the host/root plugin is required by others plug-ins so transitively it is required)

Sounds like a possible option ...

The p2.inf with these instructions are in a plugin (not a feature)

If your product is based on features can you probably try to move the p2.inf there (just put it to the root + bin includes) to see how that behaves?

@laeubi
Copy link
Member

laeubi commented Dec 5, 2023

I now created

to discover extra IUs from other bundles as well, lets see if that fixes the issue.

@laeubi
Copy link
Member

laeubi commented Dec 6, 2023

This PR is included here:

And backported here:

@laeubi laeubi closed this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants