From 67a9f00c9125a927b5c57f44814d8aa45ebecdb6 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Wed, 6 Sep 2023 13:02:28 +0300 Subject: [PATCH] Wrap more options in `UnlockExperimentalVMOptions` --- .../pkg/steps/NativeImageBuildStep.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 1995c8d6b0533..5b0aa2993b3f4 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 @@ -713,7 +713,7 @@ public NativeImageInvokerInfo build() { } final String includeLocales = LocaleProcessor.nativeImageIncludeLocales(nativeConfig, localesBuildTimeConfig); if (!includeLocales.isEmpty()) { - nativeImageArgs.add("-H:IncludeLocales=" + includeLocales); + addExperimentalVMOption(nativeImageArgs, "-H:IncludeLocales=" + includeLocales); } nativeImageArgs.add("-J-Dfile.encoding=" + nativeConfig.fileEncoding()); @@ -744,7 +744,7 @@ public NativeImageInvokerInfo build() { * {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can * override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce */ - nativeImageArgs.add("-H:-ParseOnce"); + addExperimentalVMOption(nativeImageArgs, "-H:-ParseOnce"); } if (nativeConfig.debug().enabled() && graalVMVersion.compareTo(GraalVM.Version.VERSION_23_0_0) >= 0) { @@ -756,9 +756,9 @@ public NativeImageInvokerInfo build() { * * See https://github.com/quarkusio/quarkus/issues/30772 for more details. */ - nativeImageArgs.add("-H:+TrackNodeSourcePosition"); + addExperimentalVMOption(nativeImageArgs, "-H:+TrackNodeSourcePosition"); /* See https://github.com/Karm/mandrel-integration-tests/issues/154 for more details. */ - nativeImageArgs.add("-H:+DebugCodeInfoUseSourceMappings"); + addExperimentalVMOption(nativeImageArgs, "-H:+DebugCodeInfoUseSourceMappings"); } /** @@ -780,7 +780,7 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add("-J--add-opens=java.base/java.util=ALL-UNNAMED"); if (nativeConfig.enableReports()) { - nativeImageArgs.add("-H:PrintAnalysisCallTreeType=CSV"); + addExperimentalVMOption(nativeImageArgs, "-H:PrintAnalysisCallTreeType=CSV"); } // only available in GraalVM 22.3.0+. @@ -829,7 +829,7 @@ public NativeImageInvokerInfo build() { } if (nativeConfig.debug().enabled()) { nativeImageArgs.add("-g"); - nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES); + addExperimentalVMOption(nativeImageArgs, "-H:DebugInfoSourceSearchPath=" + APP_SOURCES); } if (nativeConfig.debugBuildProcess()) { String debugBuildProcessHost; @@ -864,14 +864,14 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add("--enable-url-protocols=" + String.join(",", protocols)); } if (!inlineBeforeAnalysis) { - nativeImageArgs.add("-H:-InlineBeforeAnalysis"); + addExperimentalVMOption(nativeImageArgs, "-H:-InlineBeforeAnalysis"); } if (!pie.isEmpty()) { nativeImageArgs.add("-H:NativeLinkerOption=" + pie); } if (!nativeConfig.enableIsolates()) { - nativeImageArgs.add("-H:-SpawnIsolates"); + addExperimentalVMOption(nativeImageArgs, "-H:-SpawnIsolates"); } if (!nativeConfig.enableJni()) { log.warn( @@ -887,7 +887,7 @@ public NativeImageInvokerInfo build() { + " will be removed in a future Quarkus version."); } if (nativeConfig.enableVmInspection()) { - nativeImageArgs.add("-H:+AllowVMInspection"); + addExperimentalVMOption(nativeImageArgs, "-H:+AllowVMInspection"); } if (nativeConfig.monitoring().isPresent()) { @@ -914,15 +914,15 @@ public NativeImageInvokerInfo build() { } if (nativeConfig.enableDashboardDump()) { - nativeImageArgs.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump"); - nativeImageArgs.add("-H:+DashboardAll"); + addExperimentalVMOption(nativeImageArgs, "-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump"); + addExperimentalVMOption(nativeImageArgs, "-H:+DashboardAll"); } if (nativeImageSecurityProviders != null && !nativeImageSecurityProviders.isEmpty()) { String additionalSecurityProviders = nativeImageSecurityProviders.stream() .map(p -> p.getSecurityProvider()) .collect(Collectors.joining(",")); - nativeImageArgs.add("-H:AdditionalSecurityProviders=" + additionalSecurityProviders); + addExperimentalVMOption(nativeImageArgs, "-H:AdditionalSecurityProviders=" + additionalSecurityProviders); } if (jpmsExports != null) {