Skip to content

Commit

Permalink
Merge pull request #35772 from zakkak/2023-09-06-fix-experimental-pri…
Browse files Browse the repository at this point in the history
…ntanalysiscalltree

Wrap more options in `UnlockExperimentalVMOptions`
  • Loading branch information
gsmet authored Sep 7, 2023
2 parents 12ee4be + 3197103 commit edb23c9
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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) {
Expand All @@ -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");
}

/**
Expand All @@ -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+.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -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()) {
Expand All @@ -914,15 +914,16 @@ 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) {
Expand Down

0 comments on commit edb23c9

Please sign in to comment.