From bda05baea27b82dca98f7e2a1d34866aa1cd82bf Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 10 Oct 2023 13:37:31 +0300 Subject: [PATCH] Enable ThrowMissingRegistrationErrors with GraalVM >= 23.1 This feature will become available as non-experimental in the next release (GraalVM for Java 22), and will be promoted to the default behavior as the community adopts it. --- .../quarkus/deployment/pkg/steps/NativeImageBuildStep.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index bf693290fda4b0..379494edb8cfa3 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -814,9 +814,13 @@ 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. + // only available in GraalVM 23.1.0+. if (graalVMVersion.compareTo(GraalVM.Version.VERSION_23_1_0) >= 0) { + // Expected to become the default in GraalVM 24.0.0. nativeImageArgs.add("--strict-image-heap"); + // This feature will become available as non-experimental in the next release (GraalVM for Java 22, + // GraalVM 24.0.0), and will be promoted to the default behavior as the community adopts it. + addExperimentalVMOption(nativeImageArgs, "-H:ThrowMissingRegistrationErrors="); } /*