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

[2.7.1] 'includePackedArtifacts' must be automatically disabled when running with an incompatible vm #885

Closed
laeubi opened this issue Apr 13, 2022 Discussed in #877 · 4 comments
Milestone

Comments

@laeubi
Copy link
Member

laeubi commented Apr 13, 2022

p2artifacts.xml looks like this:

<?xml version='1.0' encoding='UTF-8'?>
<?artifactRepository version='1.1.0'?>
<artifacts size='2'>
  <artifact classifier='osgi.bundle' id='com.google.guava' version='21.0.0.v20170206-1425'>
    <processing size='1'>
      <step id='org.eclipse.equinox.p2.processing.Pack200Unpacker' required='true'/>
    </processing>
    <properties size='11'>
      <property name='artifact.size' value='692436'/>
      <property name='download.size' value='692436'/>
      <property name='format' value='packed'/>
      <property name='maven-version' value='21.0.0-SNAPSHOT'/>
      <property name='maven-artifactId' value='com.google.guava'/>
      <property name='maven-extension' value='jar.pack.gz'/>
      <property name='maven-groupId' value='org.eclipse.orbit.bundles'/>
      <property name='maven-classifier' value='pack200'/>
      <property name='download.md5' value='7724a7147b6f138046a78076ed2c7810'/>
      <property name='download.checksum.md5' value='7724a7147b6f138046a78076ed2c7810'/>
      <property name='download.checksum.sha-256' value='04105b986e1eb37211f0e42698f1648a2e0cf4ba00282c4932c441386006bb6a'/>
    </properties>
  </artifact>
  <artifact classifier='osgi.bundle' id='com.google.guava' version='21.0.0.v20170206-1425'>
    <properties size='10'>
      <property name='artifact.size' value='2675014'/>
      <property name='download.size' value='2675014'/>
      <property name='download.md5' value='d45d6cd464786a3dfbaf11a4bb718fb1'/>
      <property name='download.checksum.md5' value='d45d6cd464786a3dfbaf11a4bb718fb1'/>
      <property name='download.checksum.sha-256' value='910e145dee0bc3cfcbcc1fa2b80e259a608ec042f9027877271e0a1c6ad7002b'/>
      <property name='maven-version' value='21.0.0-SNAPSHOT'/>
      <property name='maven-artifactId' value='com.google.guava'/>
      <property name='maven-extension' value='jar'/>
      <property name='maven-groupId' value='org.eclipse.orbit.bundles'/>
      <property name='maven-type' value='eclipse-plugin'/>
    </properties>
  </artifact>
</artifacts>

and a file com.google.guava-21.0.0-SNAPSHOT-pack200.jar.pack.gz is placed in the cache location. under org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT

Two things are to note here:

  1. as the file seem to originate from a p2-repository it should be placed under osgi/bundle/com.google.guava (this is also where the jar is found)
  2. the pack200 should not be used at all for java > 14

Discussed in #877

Originally posted by sewe April 11, 2022
Hi,

recently (after a bigger Tycho upgrade), I get the following warning at the beginning of my build during target platform resolution:

[WARNING] eclipse-plugin:com.google.guava:21.0.0.v20170206-1425: /home/sewe/.m2/repository/org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT/com.google.guava-21.0.0-SNAPSHOT.jar can not be represented in Maven model and will not be visible to non-OSGi aware Maven plugins.

And indeed, a latter builds step fails because of this:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:validate-classpath (default-validate-classpath) on project com.teamscale.ide: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:validate-classpath failed: bundleLocation not found: /home/sewe/.m2/repository/org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT/com.google.guava-21.0.0-SNAPSHOT.jar -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:validate-classpath (default-validate-classpath) on project com.teamscale.ide: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:validate-classpath failed: bundleLocation not found: /home/sewe/.m2/repository/org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT/com.google.guava-21.0.0-SNAPSHOT.jar

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:2.7.1:validate-classpath failed: bundleLocation not found: /home/sewe/.m2/repository/org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT/com.google.guava-21.0.0-SNAPSHOT.jar

Caused by: java.lang.IllegalArgumentException: bundleLocation not found: /home/sewe/.m2/repository/org/eclipse/orbit/bundles/com.google.guava/21.0.0-SNAPSHOT/com.google.guava-21.0.0-SNAPSHOT.jar

What is really strange, however, and might hint at a bug in Tycho is that the very first build after a rm -r ~/.m2/repository succeeds, but executing the same mvn command again fails with the above warning and error. (Yes, not even the warning is shown during the initial run against the empty repository.)

AFAICT, this happens with Tycho 2.5.0, 2.6.0, 2.7.0, and 2.7.1.

Is there any advice on how to fix this or at least diagose this? I am not sure where the 21.0.0-SNAPSHOT version even comes from.

Best wishes,

Andreas Sewe

@laeubi
Copy link
Member Author

laeubi commented Apr 13, 2022

As mentioned in the discussion

The dropped pack200 support was indeed the hint I needed. Tried without <includePackedArtifacts> in the target-platform-configuration and it works even when all mvnw calls use Java 17.

I was assuming the option simply gets ignored on Java 17 (possibly emitting a warning), but this behaviour looks like a bug to me. Shall I create an issue from this discussion, @laeubi?

Originally posted by @sewe in #877 (reply in thread)

<includePackedArtifacts> in the target-platform-configuration needs to become "java version aware" would be the appropriate fix here.

@laeubi laeubi changed the title When running with Java 17, pack.gz. files get downloaded instead of the jar file to the cache directory 'includePackedArtifacts' must be automatically disabled when running with an incompatible vm Apr 13, 2022
@mickaelistria
Copy link
Contributor

includePackedArtifacts and everything the depends on it seems removed in master/3.0.0-SNAPSHOT, so there is nothing more to fix?

@laeubi
Copy link
Member Author

laeubi commented Apr 13, 2022

I'll fix this for the 2.7.x branch.

@laeubi laeubi changed the title 'includePackedArtifacts' must be automatically disabled when running with an incompatible vm [2.7.1] 'includePackedArtifacts' must be automatically disabled when running with an incompatible vm Apr 13, 2022
laeubi added a commit to laeubi/tycho that referenced this issue Apr 13, 2022
…y disabled when

running with an incompatible vm
@laeubi laeubi added this to the 2.7.2 milestone Apr 13, 2022
laeubi added a commit that referenced this issue Apr 13, 2022
@laeubi
Copy link
Member Author

laeubi commented Apr 15, 2022

This is fixed now in 2.7.2-SNAPSHOT and no longer relevant for 3.0.x so it could be closed.

@laeubi laeubi closed this as completed Apr 15, 2022
pcdavid added a commit to pcdavid/org.eclipse.sirius that referenced this issue Dec 23, 2022
See eclipse-tycho/tycho#885

Change-Id: I9c4dbe997ff5022ffda845456decf9e02803c52f
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
eclipsewebmaster pushed a commit to eclipse-sirius/sirius-desktop that referenced this issue Jul 3, 2023
See eclipse-tycho/tycho#885

Change-Id: I9c4dbe997ff5022ffda845456decf9e02803c52f
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
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

No branches or pull requests

2 participants