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

[24.2] "Duplicate name in Manifest" warnings on latest graal master builds #270

Closed
jerboaa opened this issue Jul 10, 2024 · 10 comments · Fixed by graalvm/mandrel-packaging#435
Assignees
Labels
bug Something isn't working

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Jul 10, 2024

In our CI we see a couple of mandrel integration tests failing due to new warnings being printed:

Error:    DebugSymbolsTest.debugSymbolsQuarkus:306 build-and-run.log log should not contain error or warning lines that are not whitelisted. See /home/runner/work/mandrel/mandrel/mandrel-integration-tests/testsuite/target/archived-logs/org.graalvm.tests.integration.DebugSymbolsTest/debugSymbolsQuarkus/build-and-run.log and check these offending lines: 
WARNING: Duplicate name in Manifest: Specification-Version.
WARNING: Duplicate name in Manifest: Implementation-Version. ==> expected: <true> but was: <false>
Error:    JFRTest.jfrPerfTest:185->jfrPerfTestRun:234 build-and-run.log log should not contain error or warning lines that are not whitelisted. See /home/runner/work/mandrel/mandrel/mandrel-integration-tests/testsuite/target/archived-logs/org.graalvm.tests.integration.JFRTest/jfrPerfTest/build-and-run.log and check these offending lines: 
WARNING: Duplicate name in Manifest: Specification-Version.
WARNING: Duplicate name in Manifest: Implementation-Version. ==> expected: <true> but was: <false>
Error:    RuntimesSmokeTest.quarkusFullMicroProfile:200->testRuntime:156 build-and-run.log log should not contain error or warning lines that are not whitelisted. See /home/runner/work/mandrel/mandrel/mandrel-integration-tests/testsuite/target/archived-logs/org.graalvm.tests.integration.RuntimesSmokeTest/quarkusFullMicroProfile/build-and-run.log and check these offending lines: 
WARNING: Duplicate name in Manifest: Specification-Version.
WARNING: Duplicate name in Manifest: Implementation-Version. ==> expected: <true> but was: <false>

It smells Quarkus related as those tests use the framework.

See: https://github.com/graalvm/mandrel/actions/runs/9866122260/job/27245030393

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

So far I'm not able to reproduce this locally. From CI the actual build_and_run.log file has those listings:

[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:build (default) @ quarkus-full-microprofile ---
[WARNING] [io.quarkus.deployment.configuration] Configuration property 'quarkus.package.type' has been deprecated and replaced by: [quarkus.package.jar.enabled, quarkus.package.jar.type, quarkus.native.enabled, quarkus.native.sources-only]
Jul 10, 2024 1:00:28 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Specification-Version.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Jul 10, 2024 1:00:28 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Implementation-Version.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.

Which come from the JDK, but that JDK code hasn't changed in years:
https://github.com/openjdk/jdk/blob/a44b60c8c14ad998e51239f48e64779304aaac50/src/java.base/share/classes/java/util/jar/Attributes.java#L424-L432

So to me it looks like we see new warnings coming from the PlatformLogger in latest quarkus... I keep looking.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

I don't know what I''m doing wrong, but locally this looks like this here:

[INFO] --- surefire:3.0.0:test (default-test) @ quarkus-full-microprofile ---
[INFO] No tests to run.
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ quarkus-full-microprofile ---
[INFO] Building jar: /disk/graal/upstream-sources/mandrel-integration-tests/apps/quarkus-full-microprofile/target/quarkus.jar
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:build (default) @ quarkus-full-microprofile ---
[WARNING] [io.quarkus.deployment.configuration] Configuration property 'quarkus.package.type' has been deprecated and replaced by: [quarkus.package.jar.enabled, quarkus.package.jar.type, quarkus.native.enabled, quarkus.native.sources-only]
[INFO] [io.quarkus.smallrye.jwt.deployment.SmallRyeJwtProcessor] Adding META-INF/resources/publicKey.pem to native image

i.e. CI has quarkus-maven-plugin:999-SNAPSHOT:build and I have quarkus:999-SNAPSHOT:build...

@jerboaa jerboaa removed their assignment Jul 10, 2024
@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

OK, so it looks to be local maven deploy and quarkus build with deployed maven artefacts from org.graalvm.* from the local deployment related.

Deploying locally using --maven-deploy-local (from mandrel-packaging) results in artefacts with duplicate Specification-Version and/or Implementation-Version:

for i in $(find -name \*.jar); do echo "Inspecting $i"; unzip -d test $i 2>&1 > /dev/null; pushd test > /dev/null; grep -E 'Implementation-Version|Specification-Version' META-INF/MANIFEST.MF; popd > /dev/null; rm -rf test; done
Inspecting ./nativeimage/jvmti-agent-base/24.2.0.SNAPSHOT/jvmti-agent-base-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/jvmti-agent-base/24.2.0.SNAPSHOT/jvmti-agent-base-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/library-support/24.2.0.SNAPSHOT/library-support-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/library-support/24.2.0.SNAPSHOT/library-support-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/native-image-base/24.2.0.SNAPSHOT/native-image-base-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/native-image-base/24.2.0.SNAPSHOT/native-image-base-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/objectfile/24.2.0.SNAPSHOT/objectfile-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/objectfile/24.2.0.SNAPSHOT/objectfile-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/pointsto/24.2.0.SNAPSHOT/pointsto-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/pointsto/24.2.0.SNAPSHOT/pointsto-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm/24.2.0.SNAPSHOT/svm-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm/24.2.0.SNAPSHOT/svm-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-agent/24.2.0.SNAPSHOT/svm-agent-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-agent/24.2.0.SNAPSHOT/svm-agent-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-configure/24.2.0.SNAPSHOT/svm-configure-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-configure/24.2.0.SNAPSHOT/svm-configure-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-diagnostics-agent/24.2.0.SNAPSHOT/svm-diagnostics-agent-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-diagnostics-agent/24.2.0.SNAPSHOT/svm-diagnostics-agent-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-driver/24.2.0.SNAPSHOT/svm-driver-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-driver/24.2.0.SNAPSHOT/svm-driver-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-foreign/24.2.0.SNAPSHOT/svm-foreign-24.2.0.SNAPSHOT.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./nativeimage/svm-foreign/24.2.0.SNAPSHOT/svm-foreign-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./compiler/compiler/24.2.0.SNAPSHOT/compiler-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./compiler/compiler/24.2.0.SNAPSHOT/compiler-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./truffle/truffle-compiler/24.2.0.SNAPSHOT/truffle-compiler-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./truffle/truffle-compiler/24.2.0.SNAPSHOT/truffle-compiler-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/collections/24.2.0.SNAPSHOT/collections-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/collections/24.2.0.SNAPSHOT/collections-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/graal-sdk/24.2.0.SNAPSHOT/graal-sdk-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/graal-sdk/24.2.0.SNAPSHOT/graal-sdk-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/mandrel-packaging-wrapper-linux-amd64/24.2.0.SNAPSHOT/mandrel-packaging-wrapper-linux-amd64-24.2.0.SNAPSHOT.jar
grep: META-INF/MANIFEST.MF: No such file or directory
Inspecting ./sdk/nativeimage/24.2.0.SNAPSHOT/nativeimage-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/nativeimage/24.2.0.SNAPSHOT/nativeimage-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/word/24.2.0.SNAPSHOT/word-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./sdk/word/24.2.0.SNAPSHOT/word-24.2.0.SNAPSHOT-sources.jar
Specification-Version: 0.0
Implementation-Version: 24.2.0.SNAPSHOT
Inspecting ./polyglot/polyglot/24.2.0.SNAPSHOT/polyglot-24.2.0.SNAPSHOT.jar
Specification-Version: 24.2.0-dev
Implementation-Version: 24.2.0-dev
Inspecting ./polyglot/polyglot/24.2.0.SNAPSHOT/polyglot-24.2.0.SNAPSHOT-sources.jar
grep: META-INF/MANIFEST.MF: No such file or directory

@zakkak
Copy link
Collaborator

zakkak commented Jul 10, 2024

Interesting, so it looks like mx started generating the entries and we might no longer need the code in https://github.com/graalvm/mandrel-packaging/blob/179f81d90fefeb0d668d81411b4d8c6032e8fe25/build.java#L660-L705

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

Interesting, so it looks like mx started generating the entries and we might no longer need the code in https://github.com/graalvm/mandrel-packaging/blob/179f81d90fefeb0d668d81411b4d8c6032e8fe25/build.java#L660-L705

Something like that. I'll look into it more.

@jerboaa jerboaa self-assigned this Jul 10, 2024
@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

graalvm/mx@bafad62 is the commit adding default Specification-Version and Implementation-Version attributes.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

So we ought to only add it/change it if there isn't any. Not blindly adding them again.

@zakkak
Copy link
Collaborator

zakkak commented Jul 10, 2024

So we ought to only add it/change it if there isn't any. Not blindly adding them again.

Yes, or we can stop adding them in the master branch of mandrel-packaging since we have version specific branches for older versions.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

Yes, or we can stop adding them in the master branch of mandrel-packaging since we have version specific branches for older versions.

I don't think we can do that, based on my understanding of this comment and since some checks also expect "Specification-Version" in source jars. The comment I think means the RHBQ rebuild's maven version of graal artefacts ought to match the maven version in the Manifest (at least for the artefacts used in quarkus).

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jul 10, 2024

OK, finally managed to reproduce this with:

  1. Build mandrel with option --maven-deploy-local, removing any org.graalvm artefacts from the local maven repo in ~/.m2 first.
  2. Build quarkus with -Dgraal-sdk.version=24.2.0.SNAPSHOT
  3. Run the integration test (e.g. full microprofile) with the those quarkus and mandrel versions.

Interestingly it's the first time this new CI setup of deploying to local maven caught some issues.

jerboaa added a commit to jerboaa/mandrel-packaging that referenced this issue Jul 10, 2024
Previously, the build script would add these two attributes irrespective
whether or not they'd exist in the Graal artefacts:

  Specification-Version
  Implementation-Version

With this patch, only updates to the Implementation-Version attribute
are done based on the maven version in use. Specification-Version is
only added if it's not yet there in a jar or source jar file.

Closes: Karm/mandrel-integration-tests#270
zakkak pushed a commit to zakkak/mandrel-packaging that referenced this issue Jul 17, 2024
Previously, the build script would add these two attributes irrespective
whether or not they'd exist in the Graal artefacts:

  Specification-Version
  Implementation-Version

With this patch, only updates to the Implementation-Version attribute
are done based on the maven version in use. Specification-Version is
only added if it's not yet there in a jar or source jar file.

Closes: Karm/mandrel-integration-tests#270
(cherry picked from commit 48c154e)
zakkak pushed a commit to graalvm/mandrel-packaging that referenced this issue Jul 17, 2024
Previously, the build script would add these two attributes irrespective
whether or not they'd exist in the Graal artefacts:

  Specification-Version
  Implementation-Version

With this patch, only updates to the Implementation-Version attribute
are done based on the maven version in use. Specification-Version is
only added if it's not yet there in a jar or source jar file.

Closes: Karm/mandrel-integration-tests#270
(cherry picked from commit 48c154e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants