Skip to content

[Native Image] Unable to use RuntimeSystemPropertiesSupport in app layer #12867

@galderz

Description

@galderz

Describe the Issue

When building Quarkus as an app layer, it is unable to invoke org.graalvm.nativeimage.hosted.RuntimeSystemProperties.register. it fails with:

com.oracle.svm.core.util.UserError$UserException: Singleton is forbidden in current layer. Key: org.graalvm.nativeimage.impl.RuntimeSystemPropertiesSupport
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:54)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ImageSingletonsSupportImpl$HostedManagement.doLookup(ImageSingletonsSupportImpl.java:609)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ImageSingletonsSupportImpl.lookup(ImageSingletonsSupportImpl.java:86)
	at org.graalvm.nativeimage/org.graalvm.nativeimage.ImageSingletons.lookup(ImageSingletons.java:86)
	at org.graalvm.nativeimage/org.graalvm.nativeimage.hosted.RuntimeSystemProperties.register(RuntimeSystemProperties.java:65)
	at io.quarkus.runner.Feature.beforeAnalysis(Unknown Source)
...

Quarkus uses that API to deal with changes related to locales that came in GraalVM 24.2, see quarkusio/quarkus@7f7d3d0 (more details in PR)

/cc @cstancu @Zeavee

Using the latest version of GraalVM can resolve many issues.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions