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 IT for issue #2977 #2978

Closed
wants to merge 1 commit into from

Conversation

mdaloia
Copy link
Contributor

@mdaloia mdaloia commented Oct 31, 2023

Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)

If we add this statement in the VirtualUnitTest:

verifier.addCliOption("-Dtycho-version=3.0.5");

the test works ok and does not fail.

Virtual configuration IU in p2.inf does not work in 4.0.3 (works in 3.0.5)
@laeubi
Copy link
Member

laeubi commented Nov 1, 2023

@mdaloia
Copy link
Contributor Author

mdaloia commented Nov 1, 2023

@laeubi yes, the error, as mentioned in the issue #2977 is:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: pvu.bundle 1.0.0.qualifier
[ERROR]   Missing requirement: pvu.bundle 1.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; configure.pvu.bundle 0.0.0' but it could not be found

I added it as a regression test, I expected it to fail. Let me know if that it is ok or should I modify it somehow.

Thanks!

@laeubi
Copy link
Member

laeubi commented Nov 1, 2023

I'll try to investigate why this fails.

@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

I have now checked this and it seems the p2content.xml in both cases is the same (except the build qualifier) for Tycho 4 and Tycho 3 so it seems not be a problem of generated metadata, but probably somewhere the provided capability is lost.

@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

I now have created

for further debugging, but this also seems sane, need to investigate further...

@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

The preliminary units look like this what seems to be sane as well:

<?xml version='1.0' encoding='UTF-8'?>
<units size='2'>
  <unit id='configure.pvu.bundle' version='1.0.0' singleton='false'>
    <provides size='1'>
      <provided namespace='org.eclipse.equinox.p2.iu' name='configure.pvu.bundle' version='1.0.0'/>
    </provides>
    <touchpoint id='null' version='0.0.0'/>
  </unit>
  <unit id='pvu.bundle' version='1.0.0.qualifier' generation='2'>
    <update id='pvu.bundle' range='[0.0.0,1.0.0.qualifier)' severity='0'/>
    <properties size='2'>
      <property name='org.eclipse.equinox.p2.name' value='pvu.bundle'/>
      <property name='org.eclipse.equinox.p2.provider' value='TEST'/>
    </properties>
    <provides size='4'>
      <provided namespace='org.eclipse.equinox.p2.iu' name='pvu.bundle' version='1.0.0.qualifier'/>
      <provided namespace='osgi.bundle' name='pvu.bundle' version='1.0.0.qualifier'/>
      <provided namespace='osgi.identity' name='pvu.bundle' version='1.0.0.qualifier'>
        <properties size='1'>
          <property name='type' value='osgi.bundle'/>
        </properties>
      </provided>
      <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
    </provides>
    <requires size='2'>
      <requiredProperties namespace='osgi.ee' match='(&amp;(osgi.ee=JavaSE)(version=17))'>
        <description>
          pvu.bundle
        </description>
      </requiredProperties>
      <required namespace='org.eclipse.equinox.p2.iu' name='configure.pvu.bundle' range='0.0.0'/>
    </requires>
    <artifacts size='1'>
      <artifact classifier='osgi.bundle' id='pvu.bundle' version='1.0.0.qualifier'/>
    </artifacts>
    <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
    <touchpointData size='1'>
      <instructions size='2'>
        <instruction key='zipped'>
          true
        </instruction>
        <instruction key='manifest'>
          Bundle-SymbolicName: pvu.bundle;singleton:=true&#xA;Bundle-Version: 1.0.0.qualifier&#xA;
        </instruction>
      </instructions>
    </touchpointData>
  </unit>
</units>

@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

Looking at the project resolved target platform it contains the bundle itself (with the additional requirement) but not the units from p2.inf so the advice get applied, but the additional units seem to be lost.

@laeubi laeubi mentioned this pull request Nov 3, 2023
@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

@mdaloia thanks for the testcase I have now added this and a fix to this PR:

@laeubi
Copy link
Member

laeubi commented Nov 3, 2023

Backport is now here:

so we can close this now!

@laeubi laeubi closed this Nov 3, 2023
mdaloia added a commit to mdaloia/tycho that referenced this pull request Nov 14, 2023
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
```
laeubi pushed a commit to laeubi/tycho that referenced this pull request Dec 5, 2023
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
```
laeubi pushed a commit that referenced this pull request Dec 6, 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
```
laeubi pushed a commit to laeubi/tycho that referenced this pull request Dec 6, 2023
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
```
laeubi pushed a commit that referenced this pull request Dec 6, 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
```
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