Skip to content

Commit

Permalink
Adopt --strict-image-heap that will land in GraalVM for JDK 21
Browse files Browse the repository at this point in the history
oracle/graal#7393 adds a new --strict-image-heap option, that will
eventually become the new default. Quarkus should start using the option
with GraalVM for JDK 21 (23.1.0) to be able to test it before it becomes
the new default.

Closes quarkusio#35901
  • Loading branch information
zakkak committed Sep 15, 2023
1 parent 8625c06 commit 59939ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,11 @@ public NativeImageInvokerInfo build() {
"-H:BuildOutputJSONFile=" + nativeImageName + "-build-output-stats.json");
}

// only available in GraalVM 23.1.0+. Expected to become the default in GraalVM 24.0.0.
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_23_1_0) >= 0) {
nativeImageArgs.add("--strict-image-heap");
}

/*
* Any parameters following this call are forced over the user provided parameters in
* quarkus.native.additional-build-args. So if you need a parameter to be overridable through
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class NativeImageFeatureStep {
@BuildStep
void addExportsToNativeImage(BuildProducer<JPMSExportBuildItem> features) {
// required in order to access org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport
// prior to 23.1 the class was provided by org.graalvm.sdk module and with 23.1 onwards, it's provided by org.graalvm.nativimage instead
// prior to 23.1 the class was provided by org.graalvm.sdk module and with 23.1 onwards, it's provided by org.graalvm.nativeimage instead
features.produce(new JPMSExportBuildItem("org.graalvm.sdk", "org.graalvm.nativeimage.impl", null,
GraalVM.Version.VERSION_23_1_0));
features.produce(new JPMSExportBuildItem("org.graalvm.nativeimage", "org.graalvm.nativeimage.impl",
Expand Down

0 comments on commit 59939ce

Please sign in to comment.