Skip to content

[GR-36396] Unable to build native image in GraalVM 22.1.0-dev #4210

@nirvdrum

Description

@nirvdrum

Describe the issue

I'm unable to build a native image of a Java application with native-image from GraalVM CE 22.1.0-dev (build 17.0.2+5-jvmci-22.0-b02) due to an issue compiling in charsets.

Steps to reproduce the issue
As far as I can tell, this happens when trying to build a native image of any application, at least on macOS. Although, gu was able to install the Ruby image and rebuild the libpolyglot one.

Describe GraalVM and your environment:

  • GraalVM version (latest snapshot builds can be found here), or commit id if built from source: GraalVM CE 22.1.0-dev (build 17.0.2+5-jvmci-22.0-b02) 4de6b73
  • JDK major version: 17
  • OS: macOS 12.1
  • Architecture: M1 Rosetta

More details
Consider adding the --native-image-info and --verbose flags when building your native image and paste output below.

Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.

> mvn -P native -D skipTests=true package
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< com.shopify.truffleruby:native-image-playground >-----------
[INFO] Building native-image-playground 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ native-image-playground ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/nirvdrum/dev/workspaces/native-image-playground/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ native-image-playground ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ native-image-playground ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/nirvdrum/dev/workspaces/native-image-playground/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ native-image-playground ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ native-image-playground ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- native-maven-plugin:0.9.9:test (test-native) @ native-image-playground ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ native-image-playground ---
[INFO] Building jar: /Users/nirvdrum/dev/workspaces/native-image-playground/target/native-image-playground-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- native-maven-plugin:0.9.9:build (build-native) @ native-image-playground ---
[WARNING] Ignoring non-jar type ImageClasspath Entry org.graalvm.nativeimage:library-support:maven-plugin:21.3.0:compile
[INFO] ImageClasspath Entry: org.graalvm.sdk:graal-sdk:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/sdk/graal-sdk/21.3.0/graal-sdk-21.3.0.jar)
[WARNING] jar:file:///Users/nirvdrum/.m2/repository/org/graalvm/sdk/graal-sdk/21.3.0/graal-sdk-21.3.0.jar!/META-INF/native-image/org.graalvm.polyglot/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
[WARNING] jar:file:///Users/nirvdrum/.m2/repository/org/graalvm/sdk/graal-sdk/21.3.0/graal-sdk-21.3.0.jar!/META-INF/native-image/org.graalvm.home/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
[INFO] ImageClasspath Entry: org.graalvm.nativeimage:svm:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/svm/21.3.0/svm-21.3.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.nativeimage:pointsto:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/pointsto/21.3.0/pointsto-21.3.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.nativeimage:objectfile:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/objectfile/21.3.0/objectfile-21.3.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.compiler:compiler:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/compiler/compiler/21.3.0/compiler-21.3.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.truffle:truffle-api:jar:21.3.0:compile (file:///Users/nirvdrum/.m2/repository/org/graalvm/truffle/truffle-api/21.3.0/truffle-api-21.3.0.jar)
[INFO] ImageClasspath Entry: com.shopify.truffleruby:native-image-playground:jar:1.0-SNAPSHOT (file:///Users/nirvdrum/dev/workspaces/native-image-playground/target/native-image-playground-1.0-SNAPSHOT.jar)
[INFO] Executing: /Users/nirvdrum/dev/bin/graalvm-ce-java17-22.1.0-dev/Contents/Home/bin/native-image -cp /Users/nirvdrum/.m2/repository/org/graalvm/sdk/graal-sdk/21.3.0/graal-sdk-21.3.0.jar:/Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/svm/21.3.0/svm-21.3.0.jar:/Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/pointsto/21.3.0/pointsto-21.3.0.jar:/Users/nirvdrum/.m2/repository/org/graalvm/nativeimage/objectfile/21.3.0/objectfile-21.3.0.jar:/Users/nirvdrum/.m2/repository/org/graalvm/compiler/compiler/21.3.0/compiler-21.3.0.jar:/Users/nirvdrum/.m2/repository/org/graalvm/truffle/truffle-api/21.3.0/truffle-api-21.3.0.jar:/Users/nirvdrum/dev/workspaces/native-image-playground/target/native-image-playground-1.0-SNAPSHOT.jar -H:Class=com.shopify.truffleruby.App -H:Name=native-image-playground
Fatal error: com.oracle.svm.core.util.VMError$HostedError: Option name "AddAllCharsets" has multiple definitions: com.oracle.svm.hosted.jdk.localization.LocalizationFeature$Options.AddAllCharsets and com.oracle.svm.core.jdk.localization.LocalizationFeature$Options.AddAllCharsets
	at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:68)
	at com.oracle.svm.hosted.option.HostedOptionParser.lambda$collectOptions$0(HostedOptionParser.java:74)
	at com.oracle.svm.common.option.CommonOptionParser.collectOptions(CommonOptionParser.java:170)
	at com.oracle.svm.core.option.SubstrateOptionsParser.collectOptions(SubstrateOptionsParser.java:116)
	at com.oracle.svm.hosted.option.HostedOptionParser.collectOptions(HostedOptionParser.java:63)
	at com.oracle.svm.hosted.option.HostedOptionParser.<init>(HostedOptionParser.java:58)
	at com.oracle.svm.hosted.AbstractNativeImageClassLoaderSupport.setupHostedOptionParser(AbstractNativeImageClassLoaderSupport.java:118)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.installNativeImageClassLoader(NativeImageGeneratorRunner.java:179)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:121)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:603)
Error: Image build request failed with exit status 1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions