You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(ci): run GraalVM native tests on GraalVM 25 and upgrade native-maven-plugin to 1.1.14 - #2684
This PR moves the GraalVM native tests from GraalVM 21.0.8 to GraalVM 25 and upgrades native-maven-plugin from 0.11.5 to 1.1.14. It supersedes the Dependabot PR aws-powertools/powertools-lambda-java#2661, which cannot pass on GraalVM 21.
native-maven-plugin 1.1.14: Upgrades the root pom.xml, the 5 sam-graalvm example poms and powertools-e2e-tests/handlers/pom.xml. Plugin 1.x requires the 1.0 reachability metadata repository, which uses the unified reachability-metadata.json format for GraalVM 25. GraalVM 21 rejects this format.
Removes the native-junit6-jdk21 profile: The initialize-at-buildtime list in junit-platform-native 1.1.14 contains MethodSegmentResolver and DiscoveryIssueReportingDiscoveryListener. The 0.11.5 list does not (graalvm/native-build-tools#794). GraalVM 21 is no longer the tested toolchain for the native tests.
CI on a pinned GraalVM 25 innovation release: The graalvm-build job uses graalvm/setup-graalvm v1.6.7 with java-version: "25" and version: "25.4.4.1.1". setup-graalvm matches this value against the version metadata of the Oracle GraalVM artifacts. Move back to the LTS release once oracle/graal#12723 is fixed there.
Examples: The sam-graalvm Dockerfiles use sam/build-java25 and GraalVM for JDK 25 LTS (download.oracle.com/graalvm/25/latest, currently 25.0.4). They only build native images of the examples and do not run the tracing-agent native tests. This PR also removes a stray curl argument from their download step.
Docs:GraalVM.md and docs/FAQs.md describe GraalVM 25, the CI GraalVM version, the example toolchain and the known issue below.
Skips JaCoCo in the native profile: Plugin 0.11.5 replaced the surefire argLine with the tracing agent. Plugin 1.x appends the agent to the existing argLine, so JaCoCo now instruments net.bytebuddy.utility.Invoker$Dispatcher before the tracing agent records it as a predefined class. The native image then rejects the uninstrumented class because its hash does not match.
Adds -H:+ClassForNameRespectsClassLoader to the native test build: Byte Buddy loads each Mockito mock class with Class.forName(name, false, loader) on its own class loader. GraalVM 25.0 fell back to ClassLoader#loadClass when the image contained predefined classes. GraalVM 25.1 and later ignore the class loader by default, so every Mockito mock failed with ClassNotFoundException. The option restores the delegation. GraalVM 25.1 added the equivalent --future-defaults=class-for-name-respects-class-loader, but GraalVM 25.0 rejects it.
ClassPreLoader continues after a LinkageError: With the class loader delegation, Class.forName initializes com.sun.management.internal.PlatformMBeanProviderImpl from the tracing classesloaded.txt. Its static initializer throws UnsatisfiedLinkError in a native image, which escaped the CRaC beforeCheckpoint hook. ClassPreLoader now logs the error at debug level and loads the next class. A new unit test covers this.
Why CI uses the innovation release and not 25.0 LTS: GraalVM 25.0.x bundles ASM 9.7.1, which reads class files up to major version 68. On JDK 25, Byte Buddy (used by Mockito) generates classes with major version 69. The tracing agent records these classes as predefined classes, and the native test image build fails in ClassPredefinitionFeature with Unsupported class file major version 69. On GraalVM 25.0.2, this breaks 12 of 17 native modules. The upstream issue is oracle/graal#12723. GraalVM 25 innovation releases parse class files with the Java Class-File API instead of ASM. This only affects the native tests that use Mockito. Users can build Powertools functions with GraalVM 25.0 LTS.
Verification: The graalvm-build job resolved Oracle GraalVM 25.4.4.1.1 and passed the native tests of all 16 modules with tests (664 tests, 0 failures). java-build passed on Java 17, 21 and 25. The verify dependency review fails because the license metadata of native-maven-plugin 1.1.14 resolves to LicenseRef-bad-non-standard. That is a license gate, not a code failure.
✅ 0 package(s) with invalid SPDX license definitions
✅ 0 package(s) with unknown licenses.
See the Details below.
Snapshot Warnings
⚠️: No snapshots were found for the head SHA f4d40dc.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
This PR moves the GraalVM native tests from GraalVM 21.0.8 to GraalVM 25 and upgrades
native-maven-pluginfrom 0.11.5 to 1.1.14. It supersedes the Dependabot PR aws-powertools/powertools-lambda-java#2661, which cannot pass on GraalVM 21.pom.xml, the 5sam-graalvmexample poms andpowertools-e2e-tests/handlers/pom.xml. Plugin 1.x requires the 1.0 reachability metadata repository, which uses the unifiedreachability-metadata.jsonformat for GraalVM 25. GraalVM 21 rejects this format.native-junit6-jdk21profile: Theinitialize-at-buildtimelist injunit-platform-native1.1.14 containsMethodSegmentResolverandDiscoveryIssueReportingDiscoveryListener. The 0.11.5 list does not (graalvm/native-build-tools#794). GraalVM 21 is no longer the tested toolchain for the native tests.graalvm-buildjob usesgraalvm/setup-graalvmv1.6.7 withjava-version: "25"andversion: "25.4.4.1.1". setup-graalvm matches this value against the version metadata of the Oracle GraalVM artifacts. Move back to the LTS release once oracle/graal#12723 is fixed there.sam-graalvmDockerfiles usesam/build-java25and GraalVM for JDK 25 LTS (download.oracle.com/graalvm/25/latest, currently 25.0.4). They only build native images of the examples and do not run the tracing-agent native tests. This PR also removes a straycurlargument from their download step.GraalVM.mdanddocs/FAQs.mddescribe GraalVM 25, the CI GraalVM version, the example toolchain and the known issue below.nativeprofile: Plugin 0.11.5 replaced the surefireargLinewith the tracing agent. Plugin 1.x appends the agent to the existingargLine, so JaCoCo now instrumentsnet.bytebuddy.utility.Invoker$Dispatcherbefore the tracing agent records it as a predefined class. The native image then rejects the uninstrumented class because its hash does not match.-H:+ClassForNameRespectsClassLoaderto the native test build: Byte Buddy loads each Mockito mock class withClass.forName(name, false, loader)on its own class loader. GraalVM 25.0 fell back toClassLoader#loadClasswhen the image contained predefined classes. GraalVM 25.1 and later ignore the class loader by default, so every Mockito mock failed withClassNotFoundException. The option restores the delegation. GraalVM 25.1 added the equivalent--future-defaults=class-for-name-respects-class-loader, but GraalVM 25.0 rejects it.ClassPreLoadercontinues after aLinkageError: With the class loader delegation,Class.forNameinitializescom.sun.management.internal.PlatformMBeanProviderImplfrom the tracingclassesloaded.txt. Its static initializer throwsUnsatisfiedLinkErrorin a native image, which escaped the CRaCbeforeCheckpointhook.ClassPreLoadernow logs the error at debug level and loads the next class. A new unit test covers this.Why CI uses the innovation release and not 25.0 LTS: GraalVM 25.0.x bundles ASM 9.7.1, which reads class files up to major version 68. On JDK 25, Byte Buddy (used by Mockito) generates classes with major version 69. The tracing agent records these classes as predefined classes, and the native test image build fails in
ClassPredefinitionFeaturewithUnsupported class file major version 69. On GraalVM 25.0.2, this breaks 12 of 17 native modules. The upstream issue is oracle/graal#12723. GraalVM 25 innovation releases parse class files with the Java Class-File API instead of ASM. This only affects the native tests that use Mockito. Users can build Powertools functions with GraalVM 25.0 LTS.Verification: The
graalvm-buildjob resolved Oracle GraalVM 25.4.4.1.1 and passed the native tests of all 16 modules with tests (664 tests, 0 failures).java-buildpassed on Java 17, 21 and 25. Theverifydependency review fails because the license metadata of native-maven-plugin 1.1.14 resolves toLicenseRef-bad-non-standard. That is a license gate, not a code failure.Issue number: closes #2416
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.