Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap more options in UnlockExperimentalVMOptions #35772

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
zakkak marked this conversation as resolved.
Show resolved Hide resolved
}

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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old option, which should be --enable-monitoring instead. I think since we have a minimal of 22.3 (which supports it), it would be fine to flip to that internally? Ideally, we'd deprecate the option too (if not already done).

Copy link
Contributor Author

@zakkak zakkak Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, however, that minimum is still 22.2, but we can probably bump it.

public static final Version MINIMUM = VERSION_22_2_0;

Ideally, we'd deprecate the option too (if not already done).

It's already deprecated.

}

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