From 3eb7792a0b6c22a3327516dd978ef679bf158b22 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 3 Aug 2023 17:32:18 +0200 Subject: [PATCH 01/17] Introduce `OptionDescriptor#getStability()`. --- .../options/processor/OptionProcessor.java | 15 +++++++++++---- .../compiler/options/test/TestOptionKey.java | 1 + .../compiler/options/OptionDescriptor.java | 18 +++++++++++++++--- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/compiler/src/jdk.internal.vm.compiler.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java b/compiler/src/jdk.internal.vm.compiler.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java index 77836d389ce8..50fc1b0ffd92 100644 --- a/compiler/src/jdk.internal.vm.compiler.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java +++ b/compiler/src/jdk.internal.vm.compiler.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java @@ -70,6 +70,7 @@ public class OptionProcessor extends AbstractProcessor { private static final String OPTION_CLASS_NAME = "org.graalvm.compiler.options.Option"; private static final String OPTION_KEY_CLASS_NAME = "org.graalvm.compiler.options.OptionKey"; private static final String OPTION_TYPE_CLASS_NAME = "org.graalvm.compiler.options.OptionType"; + private static final String OPTION_STABILITY_CLASS_NAME = "org.graalvm.compiler.options.OptionStability"; private static final String OPTION_TYPE_GROUP_NAME = "org.graalvm.compiler.options.OptionGroup"; private static final String OPTION_DESCRIPTOR_CLASS_NAME = "org.graalvm.compiler.options.OptionDescriptor"; private static final String OPTION_DESCRIPTORS_CLASS_NAME = "org.graalvm.compiler.options.OptionDescriptors"; @@ -228,8 +229,8 @@ private void processElement(Element element, OptionsInfo info) { } } - String optionStabilityName = getAnnotationValue(annotation, "stability", VariableElement.class).getSimpleName().toString(); - if (optionStabilityName.equals("STABLE")) { + String stability = getAnnotationValue(annotation, "stability", VariableElement.class).getSimpleName().toString(); + if (stability.equals("STABLE")) { if (help.length() == 0) { processingEnv.getMessager().printMessage(Kind.ERROR, "A stable option must have non-empty help text", element); return; @@ -239,7 +240,7 @@ private void processElement(Element element, OptionsInfo info) { String optionTypeName = getAnnotationValue(annotation, "type", VariableElement.class).getSimpleName().toString(); boolean deprecated = getAnnotationValue(annotation, "deprecated", Boolean.class); String deprecationMessage = getAnnotationValue(annotation, "deprecationMessage", String.class); - info.options.add(new OptionInfo(optionName, optionTypeName, help, extraHelp, optionType, declaringClass, field.getSimpleName().toString(), deprecated, deprecationMessage)); + info.options.add(new OptionInfo(optionName, optionTypeName, help, extraHelp, optionType, declaringClass, field.getSimpleName().toString(), stability, deprecated, deprecationMessage)); } private String resolveOptionPrefix(Element optionType) { @@ -279,6 +280,7 @@ public static void createOptionsDescriptorsFile(ProcessingEnvironment processing out.println("import java.util.*;"); out.println("import " + getPackageName(OPTION_DESCRIPTORS_CLASS_NAME) + ".*;"); out.println("import " + OPTION_TYPE_CLASS_NAME + ";"); + out.println("import " + OPTION_STABILITY_CLASS_NAME + ";"); out.println(""); String implementsClause = info.registerAsService ? " implements " + getSimpleName(OPTION_DESCRIPTORS_CLASS_NAME) : ""; if (info.registerAsService) { @@ -319,6 +321,7 @@ public static void createOptionsDescriptorsFile(ProcessingEnvironment processing List extraHelp = option.extraHelp; String declaringClass = option.declaringClass; String fieldName = option.field; + String stability = option.stability; boolean deprecated = option.deprecated; String deprecationMessage = option.deprecationMessage; out.printf(" return " + desc + ".create(\n"); @@ -336,6 +339,7 @@ public static void createOptionsDescriptorsFile(ProcessingEnvironment processing out.printf(" /*declaringClass*/ %s.class,\n", declaringClass); out.printf(" /*fieldName*/ \"%s\",\n", fieldName); out.printf(" /*option*/ %s,\n", optionField); + out.printf(" /*stability*/ %s.%s,\n", getSimpleName(OPTION_STABILITY_CLASS_NAME), stability); out.printf(" /*deprecated*/ %b,\n", deprecated); out.printf(" /*deprecationMessage*/ \"%s\");\n", deprecationMessage); out.println(" }"); @@ -379,10 +383,12 @@ public static class OptionInfo implements Comparable { public final String type; public final String declaringClass; public final String field; + public final String stability; public final boolean deprecated; public final String deprecationMessage; - public OptionInfo(String name, String optionType, String help, List extraHelp, String type, String declaringClass, String field, boolean deprecated, String deprecationMessage) { + public OptionInfo(String name, String optionType, String help, List extraHelp, String type, String declaringClass, String field, String stability, boolean deprecated, + String deprecationMessage) { this.name = name; this.optionType = optionType; this.help = help; @@ -390,6 +396,7 @@ public OptionInfo(String name, String optionType, String help, List extr this.type = type; this.declaringClass = declaringClass; this.field = field; + this.stability = stability; this.deprecated = deprecated; this.deprecationMessage = deprecationMessage; } diff --git a/compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/options/test/TestOptionKey.java b/compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/options/test/TestOptionKey.java index d05768cfbd75..ae7c8b336c84 100644 --- a/compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/options/test/TestOptionKey.java +++ b/compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/options/test/TestOptionKey.java @@ -115,6 +115,7 @@ public static class Options { /*declaringClass*/ Options.class, /*fieldName*/ "MyDeprecatedOption", /*option*/ MyDeprecatedOption, + /*stability*/ OptionStability.EXPERIMENTAL, /*deprecated*/ true, /*deprecationMessage*/ "Some deprecation message")); // @formatter:on diff --git a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/options/OptionDescriptor.java b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/options/OptionDescriptor.java index bf6d282f0a64..6938e6195be3 100644 --- a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/options/OptionDescriptor.java +++ b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/options/OptionDescriptor.java @@ -42,6 +42,7 @@ public final class OptionDescriptor { private final OptionKey optionKey; private final Class declaringClass; private final String fieldName; + private final OptionStability stability; private final boolean deprecated; private final String deprecationMessage; @@ -54,7 +55,7 @@ public static OptionDescriptor create(String name, Class declaringClass, String fieldName, OptionKey option) { - return create(name, optionType, optionValueType, help, NO_EXTRA_HELP, declaringClass, fieldName, option, false, ""); + return create(name, optionType, optionValueType, help, NO_EXTRA_HELP, declaringClass, fieldName, option, OptionStability.EXPERIMENTAL, false, ""); } public static OptionDescriptor create(String name, @@ -64,9 +65,10 @@ public static OptionDescriptor create(String name, Class declaringClass, String fieldName, OptionKey option, + OptionStability stability, boolean deprecated, String deprecationMessage) { - return create(name, optionType, optionValueType, help, NO_EXTRA_HELP, declaringClass, fieldName, option, deprecated, deprecationMessage); + return create(name, optionType, optionValueType, help, NO_EXTRA_HELP, declaringClass, fieldName, option, stability, deprecated, deprecationMessage); } public static OptionDescriptor create(String name, @@ -77,13 +79,14 @@ public static OptionDescriptor create(String name, Class declaringClass, String fieldName, OptionKey option, + OptionStability stability, boolean deprecated, String deprecationMessage) { assert option != null : declaringClass + "." + fieldName; OptionDescriptor result = option.getDescriptor(); if (result == null) { List extraHelpList = extraHelp == null || extraHelp.length == 0 ? Collections.emptyList() : Collections.unmodifiableList(Arrays.asList(extraHelp)); - result = new OptionDescriptor(name, optionType, optionValueType, help, extraHelpList, declaringClass, fieldName, option, deprecated, deprecationMessage); + result = new OptionDescriptor(name, optionType, optionValueType, help, extraHelpList, declaringClass, fieldName, option, stability, deprecated, deprecationMessage); option.setDescriptor(result); } assert result.name.equals(name) && result.optionValueType == optionValueType && result.declaringClass == declaringClass && result.fieldName.equals(fieldName) && result.optionKey == option; @@ -98,6 +101,7 @@ private OptionDescriptor(String name, Class declaringClass, String fieldName, OptionKey optionKey, + OptionStability stability, boolean deprecated, String deprecationMessage) { this.name = name; @@ -108,6 +112,7 @@ private OptionDescriptor(String name, this.optionKey = optionKey; this.declaringClass = declaringClass; this.fieldName = fieldName; + this.stability = stability; this.deprecated = deprecated || deprecationMessage != null && !deprecationMessage.isEmpty(); this.deprecationMessage = deprecationMessage; assert !optionValueType.isPrimitive() : "must use boxed optionValueType instead of " + optionValueType; @@ -176,6 +181,13 @@ public String getLocation() { return getDeclaringClass().getName() + "." + getFieldName(); } + /** + * Returns the stability of this option. + */ + public OptionStability getStability() { + return stability; + } + /** * Returns {@code true} if the option is deprecated. */ From 2cfb33a08dc1cc8629aad8474c7b7ca148bdf9e8 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 4 Aug 2023 14:48:04 +0200 Subject: [PATCH 02/17] Avoid redundant parsing of OptionOrigin. --- .../com/oracle/svm/driver/CmdLineOptionHandler.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/CmdLineOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/CmdLineOptionHandler.java index b7cfe6d37d17..92a1d53215ee 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/CmdLineOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/CmdLineOptionHandler.java @@ -63,10 +63,12 @@ class CmdLineOptionHandler extends NativeImage.OptionHandler { boolean consume(ArgumentQueue args) { String headArg = args.peek(); boolean consumed = consume(args, headArg); - OptionOrigin origin = OptionOrigin.from(args.argumentOrigin); - if (consumed && !origin.commandLineLike()) { - String msg = String.format("Using '%s' provided by %s is only allowed on command line.", headArg, origin); - throw NativeImage.showError(msg); + if (consumed) { + OptionOrigin origin = OptionOrigin.from(args.argumentOrigin); + if (!origin.commandLineLike()) { + String msg = String.format("Using '%s' provided by %s is only allowed on command line.", headArg, origin); + throw NativeImage.showError(msg); + } } return consumed; } From e601f6035961aeb1abe9151ec622ab4fc48a19dc Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 09:09:27 +0200 Subject: [PATCH 03/17] Mark selected hosted options as stable. --- .../src/com/oracle/svm/core/SubstrateOptions.java | 6 +++--- .../oracle/svm/graal/hosted/RuntimeCompilationFeature.java | 3 ++- .../src/com/oracle/svm/hosted/NativeImageOptions.java | 3 ++- .../src/com/oracle/svm/hosted/image/CCLinkerInvocation.java | 4 +++- .../svm/hosted/jdk/localization/LocalizationFeature.java | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java index c3f7586ac635..08e1da220d9a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java @@ -314,7 +314,7 @@ public static void setOptimizeValueUpdateHandler(ValueUpdateHandler IncludeNodeSourcePositions = new HostedOptionKey<>(false); - @Option(help = "Search path for C libraries passed to the linker (list of comma-separated directories)")// + @Option(help = "Search path for C libraries passed to the linker (list of comma-separated directories)", stability = OptionStability.STABLE)// @BundleMember(role = BundleMember.Role.Input)// public static final HostedOptionKey CLibraryPath = new HostedOptionKey<>(LocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); @@ -416,7 +416,7 @@ public static void updateMaxJavaStackTraceDepth(EconomicMap, Object @Option(help = "Prefix that is added to the names of entry point methods.")// public static final HostedOptionKey EntryPointNamePrefix = new HostedOptionKey<>(""); - @Option(help = "Prefix that is added to the names of API functions.")// + @Option(help = "Prefix that is added to the names of API functions.", stability = OptionStability.STABLE)// public static final HostedOptionKey APIFunctionPrefix = new HostedOptionKey<>("graal_"); @APIOption(name = "enable-http", fixedValue = "http", customHelp = "enable http support in the generated image")// @@ -651,7 +651,7 @@ public static boolean useLIRBackend() { @Option(help = "Provide java.lang.Terminator exit handlers", type = User)// public static final HostedOptionKey InstallExitHandlers = new HostedOptionKey<>(false); - @Option(help = "When set to true, the image generator verifies that the image heap does not contain a home directory as a substring", type = User)// + @Option(help = "When set to true, the image generator verifies that the image heap does not contain a home directory as a substring", type = User, stability = OptionStability.STABLE)// public static final HostedOptionKey DetectUserDirectoriesInImageHeap = new HostedOptionKey<>(false); @Option(help = "Determines if a null region is present between the heap base and the image heap.", type = Expert)// diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/RuntimeCompilationFeature.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/RuntimeCompilationFeature.java index c0f65e518f3c..2142b60dee66 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/RuntimeCompilationFeature.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/RuntimeCompilationFeature.java @@ -53,6 +53,7 @@ import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode; import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; import org.graalvm.compiler.options.Option; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.compiler.phases.OptimisticOptimizations; import org.graalvm.compiler.phases.tiers.Suites; import org.graalvm.compiler.phases.util.Providers; @@ -139,7 +140,7 @@ public static class Options { @Option(help = "Print call tree of methods reachable for runtime compilation")// public static final HostedOptionKey PrintRuntimeCompilationCallTree = new HostedOptionKey<>(false); - @Option(help = "Maximum number of methods allowed for runtime compilation.")// + @Option(help = "Maximum number of methods allowed for runtime compilation.", stability = OptionStability.STABLE)// public static final HostedOptionKey MaxRuntimeCompileMethods = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.build()); @Option(help = "Enforce checking of maximum number of methods allowed for runtime compilation. Useful for checking in the gate that the number of methods does not go up without a good reason.")// diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java index 516b85c14f0e..92d18ea9acbe 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java @@ -35,6 +35,7 @@ import org.graalvm.collections.EconomicMap; import org.graalvm.compiler.options.Option; import org.graalvm.compiler.options.OptionKey; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.serviceprovider.GraalServices; @@ -62,7 +63,7 @@ public class NativeImageOptions { "environment. Note that enabling features not present within the target environment " + "may result in application crashes. The specific options available are target " + "platform dependent. See --list-cpu-features for feature list. These features " + - "are in addition to -march.", type = User)// + "are in addition to -march.", type = User, stability = OptionStability.STABLE)// public static final HostedOptionKey CPUFeatures = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); @APIOption(name = "list-cpu-features")// diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java index fc9e1bc7cd71..17c94dcc4e19 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java @@ -38,6 +38,7 @@ import java.util.stream.Stream; import org.graalvm.compiler.options.Option; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.Platform; @@ -68,7 +69,8 @@ protected CCLinkerInvocation(AbstractImage.NativeImageKind imageKind, NativeLibr } public static class Options { - @Option(help = "Pass the provided raw option that will be appended to the linker command to produce the final binary. The possible options are platform specific and passed through without any validation.")// + @Option(help = "Pass the provided raw option that will be appended to the linker command to produce the final binary. The possible options are platform specific and passed through without any validation.", // + stability = OptionStability.STABLE)// public static final HostedOptionKey NativeLinkerOption = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.build()); } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java index e487ce99791f..3448859042df 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java @@ -65,6 +65,7 @@ import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; import org.graalvm.compiler.options.Option; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.compiler.options.OptionType; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.Platform; @@ -165,7 +166,7 @@ public static class Options { @Option(help = "Comma separated list of bundles to be included into the image.", type = OptionType.User)// public static final HostedOptionKey IncludeResourceBundles = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @Option(help = "Make all hosted charsets available at run time")// + @Option(help = "Make all hosted charsets available at run time", stability = OptionStability.STABLE)// public static final HostedOptionKey AddAllCharsets = new HostedOptionKey<>(false); @Option(help = "Default locale of the image, by the default it is the same as the default locale of the image builder.", type = OptionType.User, // From e4935fced6c03774fd0167dced8cdce32df3f817 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 4 Aug 2023 14:51:26 +0200 Subject: [PATCH 04/17] =?UTF-8?q?Introduce=20`-H:=C2=B1UnlockExperimentalV?= =?UTF-8?q?MOptions`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/oracle/svm/core/SubstrateOptions.java | 3 + .../svm/core/option/HostedOptionKey.java | 7 + .../svm/core/option/OptionClassFilter.java | 3 +- .../oracle/svm/core/option/OptionOrigin.java | 107 ++++++++++-- .../oracle/svm/driver/APIOptionHandler.java | 154 +++++++++++------- .../svm/driver/DefaultOptionHandler.java | 5 +- .../com/oracle/svm/driver/NativeImage.java | 43 +++-- 7 files changed, 229 insertions(+), 93 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java index 08e1da220d9a..f0f71326aff1 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java @@ -964,4 +964,7 @@ public enum ReportingMode { @Option(help = "Emit indirect branch target marker instructions.", type = OptionType.Expert) // public static final HostedOptionKey IndirectBranchTargetMarker = new HostedOptionKey<>(false); + + @Option(help = "Enable and disable normal processing of flags relating to experimental options.", type = OptionType.Expert, stability = OptionStability.EXPERIMENTAL) // + public static final HostedOptionKey UnlockExperimentalVMOptions = new HostedOptionKey<>(false); } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/HostedOptionKey.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/HostedOptionKey.java index 75689912916e..2fbf91cae97f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/HostedOptionKey.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/HostedOptionKey.java @@ -41,6 +41,7 @@ */ public class HostedOptionKey extends OptionKey implements SubstrateOptionKey { private final Consumer> validation; + private OptionOrigin lastOrigin; public HostedOptionKey(T defaultValue) { this(defaultValue, null); @@ -94,6 +95,8 @@ public void update(EconomicMap, Object> values, Object boxedValue) value.valueUpdate(boxedValue); super.update(values, value); } else { + /* store origin, last option update wins. */ + lastOrigin = OptionOrigin.from(LocatableOption.valueOrigin(boxedValue), false); super.update(values, LocatableOption.rawValue(boxedValue)); } } @@ -104,4 +107,8 @@ public void validate() { validation.accept(this); } } + + public OptionOrigin getLastOrigin() { + return lastOrigin; + } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionClassFilter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionClassFilter.java index 03e444adc821..fc79b8c39878 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionClassFilter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionClassFilter.java @@ -24,12 +24,11 @@ */ package com.oracle.svm.core.option; -import java.util.Collections; import java.util.Map; import java.util.Set; public class OptionClassFilter { - private final Set reasonCommandLine = Collections.singleton(OptionOrigin.commandLineOptionOriginSingleton); + private final Set reasonCommandLine = Set.of(OptionOrigin.commandLineAPIOptionOriginSingleton, OptionOrigin.commandLineNonAPIOptionOriginSingleton); private final Map> requireCompletePackageOrClass; private final Set requireCompleteModules; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionOrigin.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionOrigin.java index 5fe23cc112ef..76fca8ccfbb2 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionOrigin.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/OptionOrigin.java @@ -43,9 +43,23 @@ public abstract class OptionOrigin { - public static final OptionOrigin commandLineOptionOriginSingleton = new CommandLineOptionOrigin(); + public static final OptionOrigin commandLineAPIOptionOriginSingleton = new CommandLineOptionOrigin(true); + public static final OptionOrigin commandLineNonAPIOptionOriginSingleton = new CommandLineOptionOrigin(false); + public static final OptionOrigin driverStableOriginSingleton = new DriverOptionOrigin(); public static final String argFilePrefix = "argfile:"; + public static final String originUser = "user"; + + public static final String originDriver = "driver"; + + public static final String isAPISuffix = "+api"; + + protected final boolean isStable; + + public OptionOrigin(boolean isStable) { + this.isStable = isStable; + } + public URI container() { return null; } @@ -58,6 +72,14 @@ public boolean commandLineLike() { return false; } + public boolean isStable() { + return isStable; + } + + public boolean isInternal() { + return false; + } + /** * Return the option values contained in the redirection file specified by the given path. * Depending on the specific kind of OptionOrigin the method to retrieve those values can @@ -71,15 +93,26 @@ public static OptionOrigin from(String origin) { return from(origin, true); } - public static OptionOrigin from(String origin, boolean strict) { + public static OptionOrigin from(String originArg, boolean strict) { + String origin = originArg; - if (origin == null || origin.startsWith(argFilePrefix)) { - return commandLineOptionOriginSingleton; + boolean isStable = false; + if (origin != null && isAPI(origin)) { + isStable = true; + origin = origin.substring(0, origin.length() - isAPISuffix.length()); + } + + if (origin == null || originUser.equals(origin) || origin.startsWith(argFilePrefix)) { + return isStable ? commandLineAPIOptionOriginSingleton : commandLineNonAPIOptionOriginSingleton; + } + + if (originDriver.equals(origin)) { + return driverStableOriginSingleton; } URI originURI = originURI(origin); if (originURI == null) { - var macroOption = MacroOptionOrigin.from(origin); + var macroOption = MacroOptionOrigin.from(isStable, origin); if (macroOption != null) { return macroOption; } @@ -90,13 +123,13 @@ public static OptionOrigin from(String origin, boolean strict) { } switch (originURI.getScheme()) { case "jar": - return new JarOptionOrigin(originURI); + return new JarOptionOrigin(isStable, originURI); case "file": Path originPath = Path.of(originURI); if (!Files.isReadable(originPath) && strict) { VMError.shouldNotReachHere("Directory origin with path that cannot be read: " + originPath); } - return new DirectoryOptionOrigin(originPath); + return new DirectoryOptionOrigin(isStable, originPath); default: if (strict) { throw VMError.shouldNotReachHere("OptionOrigin of unsupported scheme: " + originURI); @@ -105,6 +138,10 @@ public static OptionOrigin from(String origin, boolean strict) { } } + public static boolean isAPI(String originArg) { + return originArg.endsWith(isAPISuffix); + } + protected static URI originURI(String origin) { try { return new URI(origin); @@ -122,18 +159,18 @@ static List getRedirectionValuesFromPath(Path normalizedRedirPath) throw } final class CommandLineOptionOrigin extends OptionOrigin { - - CommandLineOptionOrigin() { + CommandLineOptionOrigin(boolean isStable) { + super(isStable); } @Override public int hashCode() { - return 0; + return Objects.hash(System.identityHashCode(this), isStable); } @Override public boolean equals(Object obj) { - return obj instanceof CommandLineOptionOrigin; + return obj instanceof CommandLineOptionOrigin cloo && this.isStable == cloo.isStable; } @Override @@ -147,13 +184,45 @@ public String toString() { } } +final class DriverOptionOrigin extends OptionOrigin { + DriverOptionOrigin() { + super(false); + } + + @Override + public int hashCode() { + return Objects.hash(System.identityHashCode(this), isStable); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof DriverOptionOrigin doo && this.isStable == doo.isStable; + } + + @Override + public boolean commandLineLike() { + return true; + } + + @Override + public boolean isInternal() { + return true; + } + + @Override + public String toString() { + return "internal"; + } +} + final class MacroOptionOrigin extends OptionOrigin { public final OptionUtils.MacroOptionKind kind; public final String name; public final Path optionDirectory; - private MacroOptionOrigin(OptionUtils.MacroOptionKind kind, String name, URI optionDirectory) { + private MacroOptionOrigin(boolean isStable, OptionUtils.MacroOptionKind kind, String name, URI optionDirectory) { + super(isStable); this.kind = kind; this.name = name; VMError.guarantee(optionDirectory != null, "Invalid optionDirectory origin"); @@ -175,7 +244,7 @@ public boolean equals(Object obj) { return false; } - public static MacroOptionOrigin from(String rawOrigin) { + public static MacroOptionOrigin from(boolean isStable, String rawOrigin) { for (OptionUtils.MacroOptionKind kind : OptionUtils.MacroOptionKind.values()) { String prefix = kind.getDescriptionPrefix(true); if (rawOrigin.startsWith(prefix)) { @@ -187,7 +256,7 @@ public static MacroOptionOrigin from(String rawOrigin) { /* Strip optional trailing argumentOrigin */ optionDirectory = optionDirectory.substring(0, argumentOriginSep); } - return new MacroOptionOrigin(kind, rawOrigin.substring(prefix.length()), originURI(optionDirectory)); + return new MacroOptionOrigin(isStable, kind, rawOrigin.substring(prefix.length()), originURI(optionDirectory)); } } return null; @@ -212,6 +281,10 @@ public List getRedirectionValues(Path valuesFile) throws IOException { abstract class URIOptionOrigin extends OptionOrigin { + URIOptionOrigin(boolean isStable) { + super(isStable); + } + protected URI container; @Override @@ -248,7 +321,8 @@ public String toString() { } final class JarOptionOrigin extends URIOptionOrigin { - protected JarOptionOrigin(URI rawOrigin) { + protected JarOptionOrigin(boolean isStable, URI rawOrigin) { + super(isStable); var specific = rawOrigin.getSchemeSpecificPart(); int sep = specific.lastIndexOf('!'); VMError.guarantee(sep > 0, "Invalid jar origin"); @@ -280,7 +354,8 @@ public List getRedirectionValues(Path valuesFile) throws IOException { final class DirectoryOptionOrigin extends URIOptionOrigin { @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "originPath.getRoot() is never null") - protected DirectoryOptionOrigin(Path originPath) { + protected DirectoryOptionOrigin(boolean isStable, Path originPath) { + super(isStable); int pathPos = 0; int metaInfPos = -1; for (Path entry : originPath) { diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java index 2f8b22124a3f..1c59e5804fee 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java @@ -31,10 +31,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.ServiceLoader; +import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; import java.util.function.BiFunction; @@ -45,11 +47,13 @@ import org.graalvm.collections.EconomicMap; import org.graalvm.compiler.options.OptionDescriptor; import org.graalvm.compiler.options.OptionDescriptors; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature; import com.oracle.svm.common.option.LocatableOption; import com.oracle.svm.common.option.MultiOptionValue; +import com.oracle.svm.core.SubstrateOptions; import com.oracle.svm.core.option.APIOption; import com.oracle.svm.core.option.APIOption.APIOptionKind; import com.oracle.svm.core.option.APIOptionGroup; @@ -68,34 +72,11 @@ import com.oracle.svm.util.StringUtil; class APIOptionHandler extends NativeImage.OptionHandler { + private static final String ENTER_UNLOCK_SCOPE = SubstrateOptionsParser.commandArgument(SubstrateOptions.UnlockExperimentalVMOptions, "+"); + private static final String LEAVE_UNLOCK_SCOPE = SubstrateOptionsParser.commandArgument(SubstrateOptions.UnlockExperimentalVMOptions, "-"); - static final class OptionInfo { - final String[] variants; - final char[] valueSeparator; - final String builderOption; - final String defaultValue; - final String helpText; - final boolean defaultFinal; - final String deprecationWarning; - final boolean extra; - - final List> valueTransformers; - final APIOptionGroup group; - - OptionInfo(String[] variants, char[] valueSeparator, String builderOption, String defaultValue, String helpText, boolean defaultFinal, String deprecationWarning, - List> valueTransformers, APIOptionGroup group, boolean extra) { - this.variants = variants; - this.valueSeparator = valueSeparator; - this.builderOption = builderOption; - this.defaultValue = defaultValue; - this.helpText = helpText; - this.defaultFinal = defaultFinal; - this.deprecationWarning = deprecationWarning; - this.valueTransformers = valueTransformers; - this.group = group; - this.extra = extra; - } - + record OptionInfo(String[] variants, char[] valueSeparator, String builderOption, String defaultValue, String helpText, boolean defaultFinal, String deprecationWarning, + List> valueTransformers, APIOptionGroup group, boolean extra) { boolean isDeprecated() { return deprecationWarning.length() > 0; } @@ -114,32 +95,39 @@ static final class PathsOptionInfo { private final SortedMap apiOptions; private final Map groupInfos; private final Map pathOptions; + private final Set stableOptionNames; + + private boolean experimentalOptionsAreUnlocked = false; + private Set illegalExperimentalOptions = new HashSet<>(0); APIOptionHandler(NativeImage nativeImage) { super(nativeImage); if (NativeImage.IS_AOT) { APIOptionSupport support = ImageSingletons.lookup(APIOptionSupport.class); - groupInfos = support.groupInfos; - pathOptions = support.pathOptions; - apiOptions = support.options; + groupInfos = support.groupInfos(); + pathOptions = support.pathOptions(); + stableOptionNames = support.stableOptionNames(); + apiOptions = support.options(); } else { groupInfos = new HashMap<>(); pathOptions = new HashMap<>(); - apiOptions = extractOptions(ServiceLoader.load(OptionDescriptors.class, nativeImage.getClass().getClassLoader()), groupInfos, pathOptions); + stableOptionNames = new HashSet<>(); + apiOptions = extractOptions(ServiceLoader.load(OptionDescriptors.class, nativeImage.getClass().getClassLoader()), groupInfos, pathOptions, stableOptionNames); } } - static SortedMap extractOptions(ServiceLoader optionDescriptors, Map groupInfos, Map pathOptions) { + static SortedMap extractOptions(ServiceLoader optionDescriptors, Map groupInfos, Map pathOptions, + Set stableOptionNames) { EconomicMap hostedOptions = EconomicMap.create(); EconomicMap runtimeOptions = EconomicMap.create(); HostedOptionParser.collectOptions(optionDescriptors, hostedOptions, runtimeOptions); SortedMap apiOptions = new TreeMap<>(); Map, APIOptionGroup> groupInstances = new HashMap<>(); hostedOptions.getValues().forEach(o -> { - extractOption(NativeImage.oH, o, apiOptions, groupInfos, groupInstances); + extractOption(NativeImage.oH, o, apiOptions, groupInfos, groupInstances, stableOptionNames); extractPathOption(NativeImage.oH, o, pathOptions); }); - runtimeOptions.getValues().forEach(o -> extractOption(NativeImage.oR, o, apiOptions, groupInfos, groupInstances)); + runtimeOptions.getValues().forEach(o -> extractOption(NativeImage.oR, o, apiOptions, groupInfos, groupInstances, stableOptionNames)); groupInfos.forEach((groupName, groupInfo) -> { if (groupInfo.defaultValues.size() > 1) { VMError.shouldNotReachHere(String.format("APIOptionGroup %s must only have a single default (but has: %s)", @@ -150,8 +138,7 @@ static SortedMap extractOptions(ServiceLoader apiOptions, - Map groupInfos, Map, APIOptionGroup> groupInstances) { - + Map groupInfos, Map, APIOptionGroup> groupInstances, Set stableOptionNames) { for (APIOption apiAnnotation : getAnnotationsByType(optionDescriptor, APIOption.class)) { String builderOption = optionPrefix; if (apiAnnotation.name().length <= 0) { @@ -274,6 +261,11 @@ private static void extractOption(String optionPrefix, OptionDescriptor optionDe new APIOptionHandler.OptionInfo(apiAnnotation.name(), apiAnnotation.valueSeparator(), builderOption, defaultValue, helpText, defaultFinal, apiAnnotation.deprecated(), valueTransformers, group, apiAnnotation.extra())); } + + if (optionDescriptor.getStability() == OptionStability.STABLE) { + String infix = optionDescriptor.getOptionValueType() == Boolean.class ? "[+-]+" : ""; + stableOptionNames.add("^-H:" + infix + optionDescriptor.getName() + ".*"); + } } private static void extractPathOption(String optionPrefix, OptionDescriptor optionDescriptor, Map pathOptions) { @@ -294,8 +286,8 @@ private static void extractPathOption(String optionPrefix, OptionDescriptor opti private static List getAnnotationsByType(OptionDescriptor optionDescriptor, Class annotationClass) { try { - Field optionField = optionDescriptor.getDeclaringClass().getDeclaredField(optionDescriptor.getFieldName()); - return List.of(optionField.getAnnotationsByType(annotationClass)); + Field field = optionDescriptor.getDeclaringClass().getDeclaredField(optionDescriptor.getFieldName()); + return List.of(field.getAnnotationsByType(annotationClass)); } catch (NoSuchFieldException e) { return List.of(); } @@ -311,17 +303,24 @@ boolean consume(ArgumentQueue args) { String translatedOption = translateOption(args); if (translatedOption != null) { args.poll(); - nativeImage.addPlainImageBuilderArg(NativeImage.injectHostedOptionOrigin(translatedOption, args.argumentOrigin)); + nativeImage.addPlainImageBuilderArg(NativeImage.injectHostedOptionOrigin(translatedOption, args.argumentOrigin + OptionOrigin.isAPISuffix)); return true; - } else { - for (Entry entry : groupInfos.entrySet()) { - String groupNameAndSeparator = entry.getKey(); - if (headArg.startsWith(groupNameAndSeparator)) { - GroupInfo groupInfo = entry.getValue(); - String groupName = APIOption.Utils.optionName(groupInfo.group.name()); - NativeImage.showError("In " + args.argumentOrigin + " '" + headArg.substring(groupNameAndSeparator.length()) + "' is not a valid value for the option " + groupName + - ". Supported values are " + StringUtil.joinSingleQuoted(groupInfo.supportedValues) + "."); - } + } + if (ENTER_UNLOCK_SCOPE.equals(headArg)) { + experimentalOptionsAreUnlocked = true; + } else if (LEAVE_UNLOCK_SCOPE.equals(headArg)) { + VMError.guarantee(experimentalOptionsAreUnlocked, "ensureConsistentUnlockScopes() missed an open unlock scope"); + experimentalOptionsAreUnlocked = false; + } else if (!experimentalOptionsAreUnlocked && !OptionOrigin.isAPI(args.argumentOrigin) && headArg.startsWith(NativeImage.oH) && stableOptionNames.stream().noneMatch(p -> headArg.matches(p))) { + illegalExperimentalOptions.add(headArg); + } + for (Entry entry : groupInfos.entrySet()) { + String groupNameAndSeparator = entry.getKey(); + if (headArg.startsWith(groupNameAndSeparator)) { + GroupInfo groupInfo = entry.getValue(); + String groupName = APIOption.Utils.optionName(groupInfo.group.name()); + NativeImage.showError("In " + args.argumentOrigin + " '" + headArg.substring(groupNameAndSeparator.length()) + "' is not a valid value for the option " + groupName + + ". Supported values are " + StringUtil.joinSingleQuoted(groupInfo.supportedValues) + "."); } } return false; @@ -550,6 +549,47 @@ private static void printGroupOption(Consumer println, String groupName, SubstrateOptionsParser.printOption(println, "", sb.toString(), 4, 22, 66); } } + + public void ensureConsistentUnlockScopes(ArgumentQueue queue) { + boolean inUnlockScope = false; + for (String arg : queue.snapshot()) { + if (ENTER_UNLOCK_SCOPE.equals(arg)) { + if (inUnlockScope) { + LogUtils.warning("'" + ENTER_UNLOCK_SCOPE + "' was used repeatedly. " + + "Please check your build arguments, for example with '--verbose', and ensure experimental options are not unlocked more than once. " + + "Use '" + LEAVE_UNLOCK_SCOPE + "' to lock access to experimental options again."); + } + inUnlockScope = true; + } else if (LEAVE_UNLOCK_SCOPE.equals(arg)) { + if (!inUnlockScope) { + throw NativeImage.showError("'" + LEAVE_UNLOCK_SCOPE + "' was used but experimental options are not unlocked via '" + ENTER_UNLOCK_SCOPE + "'. " + + "Please check your build arguments, for example with '--verbose', and ensure access to experimental options is only locked after it has been unlocked."); + } + inUnlockScope = false; + } + } + /* Make sure any unlock scope is closed in the queue. */ + if (inUnlockScope) { + queue.add(LEAVE_UNLOCK_SCOPE); + } + } + + public void validateExperimentalOptions() { + if (illegalExperimentalOptions.isEmpty()) { + return; + } + + for (var illegalOption : illegalExperimentalOptions) { + LogUtils.warning("The option '" + illegalOption + "' is experimental and must be enabled via " + ENTER_UNLOCK_SCOPE + " in the future."); + } + LogUtils.warning("Please re-evaluate whether any experimental option is required, and either remove or unlock it. " + + "The build output lists all active experimental options, including where they come from and possible alternatives. " + + "If you think an experimental option should be considered as stable, please file an issue."); + + if ("true".equalsIgnoreCase(System.getenv().get("NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL"))) { + throw NativeImage.showError("Not all experimental options were unlocked."); + } + } } class GroupInfo { @@ -564,17 +604,8 @@ class GroupInfo { } } -final class APIOptionSupport { - - final Map groupInfos; - final SortedMap options; - final Map pathOptions; - - APIOptionSupport(Map groupInfos, SortedMap options, Map pathOptions) { - this.groupInfos = groupInfos; - this.options = options; - this.pathOptions = pathOptions; - } +record APIOptionSupport(Map groupInfos, SortedMap options, Map pathOptions, + Set stableOptionNames) { } final class APIOptionFeature implements Feature { @@ -590,8 +621,9 @@ public void duringSetup(DuringSetupAccess access) { FeatureImpl.DuringSetupAccessImpl accessImpl = (FeatureImpl.DuringSetupAccessImpl) access; Map groupInfos = new HashMap<>(); Map pathOptions = new HashMap<>(); + Set stableOptionNames = new HashSet<>(); ServiceLoader optionDescriptors = ServiceLoader.load(OptionDescriptors.class, accessImpl.getImageClassLoader().getClassLoader()); - SortedMap options = APIOptionHandler.extractOptions(optionDescriptors, groupInfos, pathOptions); - ImageSingletons.add(APIOptionSupport.class, new APIOptionSupport(groupInfos, options, pathOptions)); + SortedMap options = APIOptionHandler.extractOptions(optionDescriptors, groupInfos, pathOptions, stableOptionNames); + ImageSingletons.add(APIOptionSupport.class, new APIOptionSupport(groupInfos, options, pathOptions, stableOptionNames)); } } diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java index 5b2fa4cc53dc..1276497dd50f 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java @@ -29,6 +29,7 @@ import java.nio.file.Path; import java.nio.file.Paths; +import com.oracle.svm.core.option.OptionOrigin; import com.oracle.svm.driver.NativeImage.ArgumentQueue; import com.oracle.svm.util.LogUtils; @@ -84,9 +85,9 @@ public boolean consume(ArgumentQueue args) { } String[] mainClassModuleArgParts = mainClassModuleArg.split("/", 2); if (mainClassModuleArgParts.length > 1) { - nativeImage.addPlainImageBuilderArg(nativeImage.oHClass + mainClassModuleArgParts[1]); + nativeImage.addPlainImageBuilderArg(NativeImage.injectHostedOptionOrigin(nativeImage.oHClass + mainClassModuleArgParts[1], OptionOrigin.originDriver)); } - nativeImage.addPlainImageBuilderArg(nativeImage.oHModule + mainClassModuleArgParts[0]); + nativeImage.addPlainImageBuilderArg(NativeImage.injectHostedOptionOrigin(nativeImage.oHModule + mainClassModuleArgParts[0], OptionOrigin.originDriver)); nativeImage.setModuleOptionMode(true); return true; case addModulesOption: diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java index 5e6ed53c7de5..f8781b866b0e 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java @@ -68,6 +68,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import com.oracle.svm.core.option.OptionOrigin; import org.graalvm.compiler.options.OptionKey; import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import org.graalvm.nativeimage.Platform; @@ -231,6 +232,10 @@ private static String oHEnabled(OptionKey option) { return oHEnabled + option.getName(); } + private static String oHEnabledByDriver(OptionKey option) { + return oHEnabled(option) + "@" + OptionOrigin.originDriver; + } + private static String oHDisabled(OptionKey option) { return oHDisabled + option.getName(); } @@ -243,10 +248,10 @@ private static String oR(OptionKey option) { final String oHClass = oH(SubstrateOptions.Class); final String oHName = oH(SubstrateOptions.Name); final String oHPath = oH(SubstrateOptions.Path); - final String oHEnableSharedLibraryFlag = oHEnabled(SubstrateOptions.SharedLibrary); - final String oHEnableBuildOutputColorful = oHEnabled(SubstrateOptions.BuildOutputColorful); - final String oHEnableBuildOutputProgress = oHEnabled(SubstrateOptions.BuildOutputProgress); - final String oHEnableBuildOutputLinks = oHEnabled(SubstrateOptions.BuildOutputLinks); + final String oHEnableSharedLibraryFlagPrefix = oHEnabled + SubstrateOptions.SharedLibrary.getName(); + final String oHEnableBuildOutputColorful = oHEnabledByDriver(SubstrateOptions.BuildOutputColorful); + final String oHEnableBuildOutputProgress = oHEnabledByDriver(SubstrateOptions.BuildOutputProgress); + final String oHEnableBuildOutputLinks = oHEnabledByDriver(SubstrateOptions.BuildOutputLinks); final String oHCLibraryPath = oH(SubstrateOptions.CLibraryPath); final String oHFallbackThreshold = oH(SubstrateOptions.FallbackThreshold); final String oHFallbackExecutorJavaArg = oH(FallbackExecutor.Options.FallbackExecutorJavaArg); @@ -622,7 +627,15 @@ public Optional getResourcesJar() { class DriverMetaInfProcessor implements NativeImageMetaInfResourceProcessor { @Override public void processMetaInfResource(Path classpathEntry, Path resourceRoot, Path resourcePath, MetaInfFileType type) throws IOException { - NativeImageArgsProcessor args = NativeImage.this.new NativeImageArgsProcessor(resourcePath.toUri().toString()); + boolean isNativeImagePropertiesFile = type.equals(MetaInfFileType.Properties); + + /* + * All MetaInfFileType values that are lowered to options are considered stable (not + * true for native-image.properties). + */ + String originSuffix = isNativeImagePropertiesFile ? "" : OptionOrigin.isAPISuffix; + + NativeImageArgsProcessor args = NativeImage.this.new NativeImageArgsProcessor(resourcePath.toUri().toString() + originSuffix); Path componentDirectory = resourceRoot.relativize(resourcePath).getParent(); Function resolver = str -> { int nameCount = componentDirectory.getNameCount(); @@ -634,7 +647,7 @@ public void processMetaInfResource(Path classpathEntry, Path resourceRoot, Path return resolvePropertyValue(str, optionArg, componentDirectory, config); }; - if (type == MetaInfFileType.Properties) { + if (isNativeImagePropertiesFile) { Map properties = loadProperties(Files.newInputStream(resourcePath)); String imageNameValue = properties.get("ImageName"); if (imageNameValue != null) { @@ -691,6 +704,7 @@ private ArrayList createFallbackBuildArgs() { buildArgs.add(fallbackExecutorJavaArg); } + buildArgs.add(oHEnabled(SubstrateOptions.UnlockExperimentalVMOptions)); buildArgs.add(oHEnabled(SubstrateOptions.BuildOutputSilent)); buildArgs.add(oHEnabled(SubstrateOptions.ParseRuntimeOptions)); Path imagePathPath; @@ -718,6 +732,7 @@ private ArrayList createFallbackBuildArgs() { buildArgs.add(oHPath + imagePathPath.toString()); buildArgs.add(oH(FallbackExecutor.Options.FallbackExecutorClasspath) + classpathString); buildArgs.add(oH(FallbackExecutor.Options.FallbackExecutorMainClass) + mainClass); + buildArgs.add(oHDisabled(SubstrateOptions.UnlockExperimentalVMOptions)); /* * The fallback image on purpose captures the Java home directory used for image generation, @@ -779,7 +794,7 @@ protected NativeImage(BuildConfiguration config) { } // Generate images into the current directory - addPlainImageBuilderArg(oHPath + config.getWorkingDirectory()); + addPlainImageBuilderArg(injectHostedOptionOrigin(oHPath + config.getWorkingDirectory(), OptionOrigin.originDriver)); /* Discover supported MacroOptions */ optionRegistry = new MacroOption.Registry(); @@ -1003,6 +1018,7 @@ private void handleModuleExports(String modulesValues, OptionKey option) { private int completeImageBuild() { List leftoverArgs = processNativeImageArgs(); + apiOptionHandler.validateExperimentalOptions(); config.getBuilderClasspath().forEach(this::addImageBuilderClasspath); @@ -1078,9 +1094,9 @@ private int completeImageBuild() { imageBuilderJavaArgs.addAll(getAgentArguments()); mainClass = getHostedOptionFinalArgumentValue(imageBuilderArgs, oHClass); - boolean buildExecutable = imageBuilderArgs.stream().noneMatch(arg -> arg.contains(oHEnableSharedLibraryFlag)); + boolean buildExecutable = imageBuilderArgs.stream().noneMatch(arg -> arg.startsWith(oHEnableSharedLibraryFlagPrefix)); boolean listModules = imageBuilderArgs.stream().anyMatch(arg -> arg.contains(oH + "+" + "ListModules")); - printFlags |= imageBuilderArgs.stream().anyMatch(arg -> arg.contains("-H:MicroArchitecture=list")); + printFlags |= imageBuilderArgs.stream().anyMatch(arg -> arg.matches("-H:MicroArchitecture(@[^=]*)?=list")); if (printFlags || listModules) { /* Ensure name for bundle support */ @@ -1190,7 +1206,7 @@ private int completeImageBuild() { assert argsDigest.matches("[0-9a-f]+") && argsDigest.length() >= 32 : "Expecting a hex string"; imageBuildID = SubstrateUtil.getUUIDFromString(argsDigest).toString(); } - addPlainImageBuilderArg(oH(SubstrateOptions.ImageBuildID) + imageBuildID); + addPlainImageBuilderArg(oH(SubstrateOptions.ImageBuildID, OptionOrigin.originDriver) + imageBuildID); if (!leftoverArgs.isEmpty()) { showError("Unrecognized option(s): " + StringUtil.joinSingleQuoted(leftoverArgs)); @@ -1752,7 +1768,7 @@ public static void agentBuild(Path javaHome, Path workDir, List buildArg public static List translateAPIOptions(List arguments) { var handler = new APIOptionHandler(new NativeImage(new BuildConfiguration(arguments))); - var argumentQueue = new ArgumentQueue(null); + var argumentQueue = new ArgumentQueue(OptionOrigin.originDriver); handler.nativeImage.config.args.forEach(argumentQueue::add); List translatedOptions = new ArrayList<>(); while (!argumentQueue.isEmpty()) { @@ -1940,6 +1956,8 @@ List apply(boolean strict) { } } + apiOptionHandler.ensureConsistentUnlockScopes(queue); + List leftoverArgs = new ArrayList<>(); while (!queue.isEmpty()) { boolean consumed = false; @@ -1960,6 +1978,7 @@ List apply(boolean strict) { } } } + return leftoverArgs; } } @@ -2244,7 +2263,7 @@ protected static List getJars(Path dir, String... jarBaseNames) { } private List processNativeImageArgs() { - NativeImageArgsProcessor argsProcessor = new NativeImageArgsProcessor(null); + NativeImageArgsProcessor argsProcessor = new NativeImageArgsProcessor(OptionOrigin.originUser); for (String arg : getNativeImageArgs()) { argsProcessor.accept(arg); } From c29976ceae5a93ece42ff1adeaa727780cace942 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 4 Aug 2023 14:51:58 +0200 Subject: [PATCH 05/17] Show list of experimental options in build output. --- .../native-image/BuildOutput.md | 6 ++ .../core/option/SubstrateOptionsParser.java | 8 +- .../oracle/svm/hosted/ProgressReporter.java | 74 ++++++++++++++++++- 3 files changed, 80 insertions(+), 8 deletions(-) diff --git a/docs/reference-manual/native-image/BuildOutput.md b/docs/reference-manual/native-image/BuildOutput.md index ceed0a84983f..01bf6a7b4f2d 100644 --- a/docs/reference-manual/native-image/BuildOutput.md +++ b/docs/reference-manual/native-image/BuildOutput.md @@ -122,6 +122,12 @@ Use the `-R:MaxHeapSize` option when building with Native Image to pre-configure All [`Features`](https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/hosted/Feature.html) that are either provided or specifically enabled by the user, or implicitly registered for the user, for example, by a framework. GraalVM Native Image deploys a number of internal features, which are excluded from this list. +#### Experimental Options +A list of all active experimental options, including their origin and possible API option alternatives if available. + +Using experimental options should be avoided in production and can change in any release. +If you rely on experimental features and would like an option to be considered stable, please file an issue. + #### Build Resources The memory limit and number of threads used by the build process. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java index a824bab452f1..fe0c4f9cc6e5 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java @@ -184,11 +184,6 @@ public static String commandArgument(OptionKey option, String value, String a APIOption[] apiOptions = field.getAnnotationsByType(APIOption.class); - for (APIOption apiOption : apiOptions) { - String selected = selectVariant(apiOption, apiOptionName); - assert selected == null || apiOption.deprecated().equals("") : "Using the deprecated option in a description: " + apiOption; - } - if (option.getDescriptor().getOptionValueType() == Boolean.class) { VMError.guarantee(value.equals("+") || value.equals("-"), "Boolean option value can be only + or -"); for (APIOption apiOption : apiOptions) { @@ -257,6 +252,9 @@ private static String formatCommandArgument(String optionMessage, boolean escape private static String selectVariant(APIOption apiOption, String apiOptionName) { VMError.guarantee(apiOption.name().length > 0, "APIOption requires at least one name"); + if (!apiOption.deprecated().equals("")) { + return null; /* Never select deprecated API options. */ + } if (apiOptionName == null) { return apiOption.name()[0]; } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java index 5c8f895b8bbb..1299d44fc9a3 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -49,6 +50,8 @@ import java.util.function.Consumer; import java.util.stream.Collectors; +import org.graalvm.compiler.options.OptionKey; +import org.graalvm.compiler.options.OptionStability; import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.serviceprovider.GraalServices; import org.graalvm.nativeimage.ImageSingletons; @@ -70,7 +73,10 @@ import com.oracle.svm.core.heap.Heap; import com.oracle.svm.core.hub.ClassForNameSupport; import com.oracle.svm.core.jdk.Resources; +import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.HostedOptionValues; +import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.OptionOrigin; import com.oracle.svm.core.option.SubstrateOptionsParser; import com.oracle.svm.core.util.VMError; import com.oracle.svm.core.util.json.JsonWriter; @@ -241,8 +247,7 @@ public void printInitializeEnd(List features) { l().a(" ").doclink("Garbage collector", "#glossary-gc").a(": ").a(gcName).a(" (").doclink("max heap size", "#glossary-gc-max-heap-size").a(": ").a(maxHeapValue).a(")").println(); printFeatures(features); - - l().printLineSeparator(); + printExperimentalOptions(); printResourceInfo(); } @@ -273,6 +278,68 @@ private static void printFeature(DirectPrinter printer, Feature feature) { printer.println(); } + record ExperimentalOptionDetails(String origin, String alternatives) { + } + + private void printExperimentalOptions() { + Map experimentalOptions = new HashMap<>(); + var hostedOptionValues = HostedOptionValues.singleton().getMap(); + + for (OptionKey option : hostedOptionValues.getKeys()) { + if (option == SubstrateOptions.UnlockExperimentalVMOptions) { + continue; + } + if (option instanceof HostedOptionKey hok && option.getDescriptor().getStability() == OptionStability.EXPERIMENTAL) { + String optionPrefix = "-H:"; + String originText; + String alternatives = null; + Object value = option.getValueOrDefault(hostedOptionValues); + if (value instanceof LocatableMultiOptionValue lmov) { + if (lmov.getValuesWithOrigins().allMatch(o -> o.getRight().isStable())) { + continue; + } else { + originText = lmov.getValuesWithOrigins().map(p -> p.getRight().toString()).collect(Collectors.joining(", ")); + alternatives = lmov.getValuesWithOrigins().map(p -> SubstrateOptionsParser.commandArgument(hok, p.getLeft().toString())).filter(c -> !c.startsWith("-H:")) + .collect(Collectors.joining(", ")); + } + } else { + OptionOrigin origin = hok.getLastOrigin(); + if (origin == null /* unknown */ || origin.isStable() || origin.isInternal()) { + continue; + } + originText = origin.toString(); + String valueString; + if (hok.getDescriptor().getOptionValueType() == Boolean.class) { + valueString = Boolean.valueOf(value.toString()) ? "+" : "-"; + optionPrefix += valueString; + } else { + valueString = value.toString(); + } + + String command = SubstrateOptionsParser.commandArgument(hok, valueString); + if (!command.startsWith("-H:")) { + alternatives = command; + } + } + + experimentalOptions.put(optionPrefix + hok.getName(), new ExperimentalOptionDetails(originText, alternatives)); + } + } + if (experimentalOptions.isEmpty()) { + return; + } + l().printLineSeparator(); + l().yellowBold().a(" ").a(experimentalOptions.size()).a(" ").doclink("Experimental option(s)", "#glossary-experimental-options").a(" in use:").reset().println(); + for (var optionToOriginEntry : experimentalOptions.entrySet()) { + l().a(" ").a(optionToOriginEntry.getKey()).println(); + ExperimentalOptionDetails details = optionToOriginEntry.getValue(); + l().a(" Origin: ").a(details.origin).println(); + if (details.alternatives != null) { + l().a(" Alternative API option(s): " + details.alternatives).println(); + } + } + } + private void printResourceInfo() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); @@ -300,7 +367,8 @@ private void printResourceInfo() { maxNumberOfThreadsSuffix = "set via '%s'".formatted(SubstrateOptionsParser.commandArgument(NativeImageOptions.NumberOfThreads, Integer.toString(maxNumberOfThreads))); } - l().a(" ").doclink("Build resources", "#glossary-build-resources").a(":").println(); + l().printLineSeparator(); + l().yellowBold().doclink("Build resources", "#glossary-build-resources").a(":").reset().println(); l().a(" - %.2fGB of memory (%.1f%% of %.2fGB system memory, %s)", ByteFormattingUtil.bytesToGiB(maxMemory), Utils.toPercentage(maxMemory, totalMemorySize), ByteFormattingUtil.bytesToGiB(totalMemorySize), maxHeapSuffix).println(); l().a(" - %s thread(s) (%.1f%% of %s available processor(s), %s)", From e239f27e114354c9b1ccf55bd0601c8b878f1971 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 4 Aug 2023 15:44:32 +0200 Subject: [PATCH 06/17] Use `UnlockExperimentalVMOptions` in mx infra. --- espresso/mx.espresso/mx_espresso.py | 7 +- .../mx.java-benchmarks/mx_java_benchmarks.py | 37 +++--- sdk/mx.sdk/mx_sdk_vm_impl.py | 34 +++-- substratevm/mx.substratevm/mx_substratevm.py | 116 ++++++++++-------- .../mx_substratevm_benchmark.py | 7 +- sulong/mx.sulong/mx_sulong.py | 5 +- vm/mx.vm/mx_vm.py | 7 +- vm/mx.vm/mx_vm_benchmark.py | 44 +++---- vm/mx.vm/mx_vm_gate.py | 13 +- 9 files changed, 154 insertions(+), 116 deletions(-) diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index 4fc6b3c0e87b..50f6e2d1a2d2 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -193,12 +193,13 @@ def _espresso_gate_runner(args, tasks): language='java', jar_distributions=['espresso:LIB_JAVAVM'], build_args=[ - '-H:-JNIExportSymbols', '-R:+EnableSignalHandling', '-R:+InstallSegfaultHandler', - '-H:+DumpThreadStacksOnSignal', '--features=com.oracle.truffle.espresso.ref.FinalizationFeature', - ], + ] + mx_sdk_vm_impl.svm_experimental_options([ + '-H:-JNIExportSymbols', + '-H:+DumpThreadStacksOnSignal', + ]), ) if mx_sdk_vm.base_jdk_version() not in (17,): diff --git a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py index b5f63d62b17b..d2196a527452 100644 --- a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py +++ b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py @@ -40,6 +40,7 @@ from mx_benchmark import ParserEntry import mx_sdk_benchmark from mx_sdk_benchmark import NativeImageBenchmarkMixin, NativeImageBundleBasedBenchmarkMixin +import mx_sdk_vm_impl _suite = mx.suite('java-benchmarks') @@ -353,19 +354,11 @@ def extra_image_build_argument(self, benchmark, args): '-J-Duser.language=en', '-J-Duser.country=US', '-J-Dfile.encoding=UTF-8', - '-H:-ParseOnce', '-J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED', '-J--add-opens=java.base/java.text=ALL-UNNAMED', - '-H:+JNI', - '-H:+AllowFoldMethods', '-J-Djava.awt.headless=true', - '-H:FallbackThreshold=0', - '-H:+ReportExceptionStackTraces', - '-H:+AddAllCharsets', - '-H:EnableURLProtocols=http', - '-H:NativeLinkerOption=-no-pie', - '-H:-UseServiceLoaderFeature', - '-H:+AllowDeprecatedBuilderClassesOnImageClasspath', # needs to be removed once GR-41746 is fixed + '--no-fallback', + '--enable-http', '--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED', '--add-exports=org.graalvm.nativeimage.base/com.oracle.svm.util=ALL-UNNAMED', '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED', @@ -374,7 +367,15 @@ def extra_image_build_argument(self, benchmark, args): '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jni=ALL-UNNAMED', '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.threadlocal=ALL-UNNAMED', '--initialize-at-run-time=io.netty.internal.tcnative.SSL,io.netty.handler.codec.compression.ZstdOptions', - '-H:+StackTrace'] + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args) + '-H:NativeLinkerOption=-no-pie', + '-H:+AddAllCharsets', + ] + mx_sdk_vm_impl.svm_experimental_options([ + '-H:-ParseOnce', + '-H:+AllowFoldMethods', + '-H:+ReportExceptionStackTraces', + '-H:-UseServiceLoaderFeature', + '-H:+AllowDeprecatedBuilderClassesOnImageClasspath', # needs to be removed once GR-41746 is fixed + ]) + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args) class BaseTikaBenchmarkSuite(BaseQuarkusBenchmarkSuite): @@ -527,14 +528,9 @@ def extra_image_build_argument(self, benchmark, args): '-J--add-opens=java.base/java.io=ALL-UNNAMED', '-J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED', '-J--add-opens=java.base/java.util=ALL-UNNAMED', - '-H:+AllowFoldMethods', '-J-Djava.awt.headless=true', '--no-fallback', - '-H:+ReportExceptionStackTraces', - '-H:-AddAllCharsets', '--enable-url-protocols=http,https', - '-H:-UseServiceLoaderFeature', - '-H:+StackTrace', '-J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED', '-J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED', '--exclude-config' , @@ -542,8 +538,13 @@ def extra_image_build_argument(self, benchmark, args): '/META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json', '--exclude-config', 'io\.netty\.netty-handler', - '/META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json' - ] + super(BaseQuarkusBenchmarkSuite,self).extra_image_build_argument(benchmark, args) + '/META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json', + '-H:-AddAllCharsets', + ] + mx_sdk_vm_impl.svm_experimental_options([ + '-H:+AllowFoldMethods', + '-H:+ReportExceptionStackTraces', + '-H:-UseServiceLoaderFeature', + ]) + super(BaseQuarkusBenchmarkSuite,self).extra_image_build_argument(benchmark, args) mx_benchmark.add_bm_suite(BaseQuarkusRegistryBenchmark()) diff --git a/sdk/mx.sdk/mx_sdk_vm_impl.py b/sdk/mx.sdk/mx_sdk_vm_impl.py index f75f1ea50052..256f69d3c859 100644 --- a/sdk/mx.sdk/mx_sdk_vm_impl.py +++ b/sdk/mx.sdk/mx_sdk_vm_impl.py @@ -111,6 +111,11 @@ def unicode_utf8(string): mx.add_argument('--base-dist-name', help='Sets the name of the GraalVM base image ( for complete, ruby ... images), default to "base"', default='base') + +def svm_experimental_options(experimental_options): + return ['-H:+UnlockExperimentalVMOptions'] + experimental_options + ['-H:-UnlockExperimentalVMOptions'] + + mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJreComponent( suite=_suite, name='Polyglot Launcher', @@ -123,10 +128,9 @@ def unicode_utf8(string): jar_distributions=['sdk:LAUNCHER_COMMON'], main_class='org.graalvm.launcher.PolyglotLauncher', build_args=[ - '-H:-ParseRuntimeOptions', - '-H:Features=org.graalvm.launcher.PolyglotLauncherFeature', + '--features=org.graalvm.launcher.PolyglotLauncherFeature', '--tool:all', - ], + ] + svm_experimental_options(['-H:-ParseRuntimeOptions']), is_main_launcher=True, default_symlinks=True, is_sdk_launcher=True, @@ -1174,9 +1178,9 @@ def native_image(self, build_args, output_file, allow_server=False, nonZeroIsFat native_image_bin = join(stage1.output, stage1.find_single_source_location('dependency:' + native_image_project_name)) native_image_command = [native_image_bin] + build_args output_directory = dirname(output_file) - native_image_command += [ + native_image_command += svm_experimental_options([ '-H:Path=' + output_directory or ".", - ] + ]) return mx.run(native_image_command, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err) def is_debug_supported(self): @@ -1195,7 +1199,7 @@ def get_debug_flags(self, image_config): assert self.is_debug_supported() flags = ['-g'] if self.generate_separate_debug_info(image_config): - flags += ['-H:+StripDebugInfo'] + flags += svm_experimental_options(['-H:+StripDebugInfo']) return flags @@ -1320,12 +1324,13 @@ def contents(self): build_args = [ '--no-fallback', '-march=compatibility', # Target maximum portability of all GraalVM images. + '-Dorg.graalvm.version={}'.format(_suite.release_version()), + ] + svm_experimental_options([ '-H:+AssertInitializationSpecifiedForAllClasses', '-H:+EnforceMaxRuntimeCompileMethods', - '-Dorg.graalvm.version={}'.format(_suite.release_version()), - ] + ]) if _debug_images(): - build_args += ['-ea', '-O0', '-H:+PreserveFramePointer', '-H:-DeleteLocalSymbols'] + build_args += ['-ea', '-O0',] + svm_experimental_options(['-H:+PreserveFramePointer', '-H:-DeleteLocalSymbols']) if _get_svm_support().generate_debug_info(image_config): build_args += _get_svm_support().get_debug_flags(image_config) if getattr(image_config, 'link_at_build_time', True): @@ -1338,7 +1343,7 @@ def contents(self): suffix = _lib_suffix if _get_svm_support().is_pgo_supported(): # If pgo is supported, we should dump on exit also for library launchers - build_args.append('-H:+ProfilingEnableProfileDumpHooks') + build_args += svm_experimental_options(['-H:+ProfilingEnableProfileDumpHooks']) build_args.append('--shared') project_name_f = GraalVmNativeImage.project_name elif isinstance(image_config, mx_sdk.LauncherConfig): @@ -1370,16 +1375,17 @@ def contents(self): build_args += [ '--install-exit-handlers', '--enable-monitoring=jvmstat,heapdump,jfr', + ] + svm_experimental_options([ '-H:+DumpRuntimeCompilationOnSignal', '-H:+ReportExceptionStackTraces', - ] + ]) if isinstance(image_config, (mx_sdk.LauncherConfig, mx_sdk.LanguageLibraryConfig)): if image_config.is_sdk_launcher: launcher_classpath = NativePropertiesBuildTask.get_launcher_classpath(self._graalvm_dist, graalvm_home, image_config, self.subject.component, exclude_implicit=True) build_args += ['-Dorg.graalvm.launcher.classpath=' + os.pathsep.join(launcher_classpath)] if isinstance(image_config, mx_sdk.LauncherConfig): - build_args += ['-H:-ParseRuntimeOptions'] + build_args += svm_experimental_options(['-H:-ParseRuntimeOptions']) if has_component('svmee', stage1=True): build_args += [ @@ -2332,9 +2338,11 @@ def _get_command_file(self): def get_build_args(self): build_args = [ '--parallelism=' + str(self.parallelism), + ] + svm_experimental_options([ '-H:+BuildOutputPrefix', '-H:+GenerateBuildArtifactsFile', # generate 'build-artifacts.json' - '--macro:' + GraalVmNativeProperties.macro_name(self.subject.native_image_config), + ]) + [ + '--macro:' + GraalVmNativeProperties.macro_name(self.subject.native_image_config), # last to allow overrides ] if self.subject.native_image_config.is_polyglot: build_args += ["--macro:truffle", "--language:all"] diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index 3263730ac987..670b2ad3b158 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -50,6 +50,7 @@ import mx_substratevm_benchmark # pylint: disable=unused-import from mx_compiler import GraalArchiveParticipant from mx_gate import Task +from mx_sdk_vm_impl import svm_experimental_options from mx_unittest import _run_tests, _VMLauncher import sys @@ -125,8 +126,8 @@ def is_musl_supported(): def build_native_image_agent(native_image): agentfile = mx_subst.path_substitutions.substitute('') - agentname = agentfile.rsplit('.', 1)[0] # remove platform-specific file extension - native_image(['--macro:native-image-agent-library', '-H:Name=' + agentname, '-H:Path=' + svmbuild_dir()]) + agentname = join(svmbuild_dir(), agentfile.rsplit('.', 1)[0]) # remove platform-specific file extension + native_image(['--macro:native-image-agent-library', '-o', agentname]) return svmbuild_dir() + '/' + agentfile @@ -226,8 +227,13 @@ def vm_executable_path(executable, config=None): @contextmanager def native_image_context(common_args=None, hosted_assertions=True, native_image_cmd='', config=None, build_if_missing=False): common_args = [] if common_args is None else common_args - base_args = ['--no-fallback', '-H:+EnforceMaxRuntimeCompileMethods', '-H:+ReportExceptionStackTraces'] - base_args += ['-H:Path=' + svmbuild_dir()] + base_args = [ + '--no-fallback', + ] + svm_experimental_options([ + '-H:+EnforceMaxRuntimeCompileMethods', + '-H:+ReportExceptionStackTraces', + '-H:Path=' + svmbuild_dir(), + ]) if mx.get_opts().verbose: base_args += ['--verbose'] if mx.get_opts().very_verbose: @@ -297,7 +303,7 @@ def native_image_func(args, **kwargs): native_image_context.hosted_assertions = ['-J-ea', '-J-esa'] _native_unittest_features = '--features=com.oracle.svm.test.ImageInfoTest$TestFeature,com.oracle.svm.test.ServiceLoaderTest$TestFeature,com.oracle.svm.test.SecurityServiceTest$TestFeature' -IMAGE_ASSERTION_FLAGS = ['-H:+VerifyGraalGraphs', '-H:+VerifyPhases'] +IMAGE_ASSERTION_FLAGS = svm_experimental_options(['-H:+VerifyGraalGraphs', '-H:+VerifyPhases']) def image_demo_task(extra_image_args=None, flightrecorder=True): @@ -318,9 +324,11 @@ def image_demo_task(extra_image_args=None, flightrecorder=True): def truffle_args(extra_build_args): assert isinstance(extra_build_args, list) - build_args = ['--build-args', '--macro:truffle', '--language:nfi', - '--add-exports=java.base/jdk.internal.module=ALL-UNNAMED', - '-H:MaxRuntimeCompileMethods=5000', '-H:+TruffleCheckBlackListedMethods'] + build_args = [ + '--build-args', '--macro:truffle', '--language:nfi', + '--add-exports=java.base/jdk.internal.module=ALL-UNNAMED', + '-H:MaxRuntimeCompileMethods=5000', + ] run_args = ['--run-args', '--very-verbose', '--enable-timing'] return build_args + extra_build_args + run_args @@ -345,7 +353,7 @@ def truffle_unittest_task(extra_build_args=None): # White Box Truffle compilation tests that need access to compiler graphs. if '-Ob' not in extra_build_args: # GR-44492 - native_unittest(['org.graalvm.compiler.truffle.test.ContextLookupCompilationTest'] + truffle_args(extra_build_args + ['-H:-SupportCompileInIsolates'])) + native_unittest(['org.graalvm.compiler.truffle.test.ContextLookupCompilationTest'] + truffle_args(extra_build_args + svm_experimental_options(['-H:-SupportCompileInIsolates']))) def truffle_context_pre_init_unittest_task(extra_build_args): @@ -357,7 +365,7 @@ def svm_gate_body(args, tasks): if t: with native_image_context(IMAGE_ASSERTION_FLAGS) as native_image: image_demo_task(args.extra_image_builder_arguments) - helloworld(["-H:+RunMainInNewThread"] + args.extra_image_builder_arguments) + helloworld(svm_experimental_options(['-H:+RunMainInNewThread']) + args.extra_image_builder_arguments) with Task('image debuginfotest', tasks, tags=[GraalTags.debuginfotest]) as t: if t: @@ -393,8 +401,7 @@ def svm_gate_body(args, tasks): '--macro:truffle', '--language:nfi', '--add-exports=java.base/jdk.internal.module=ALL-UNNAMED', - '-H:MaxRuntimeCompileMethods=2000', - '-H:+TruffleCheckBlackListedMethods'] + args.extra_image_builder_arguments + [ + '-H:MaxRuntimeCompileMethods=2000',] + args.extra_image_builder_arguments + [ '--run-args', testlib, '--very-verbose', '--enable-timing'] native_unittest(native_unittest_args) @@ -433,7 +440,7 @@ def help_stdout_check(output): ] build_output_file = join(svmbuild_dir(), 'build-output.json') - helloworld(['--output-path', svmbuild_dir(), f'-H:BuildOutputJSONFile={build_output_file}', '-H:+GenerateBuildArtifactsFile']) + helloworld(['--output-path', svmbuild_dir()] + svm_experimental_options([f'-H:BuildOutputJSONFile={build_output_file}', '-H:+GenerateBuildArtifactsFile'])) try: for json_file, schema_file in json_and_schema_file_pairs: @@ -455,10 +462,10 @@ def native_unittests_task(extra_build_args=None): # GR-24075 mx_unittest.add_global_ignore_glob('com.oracle.svm.test.ProcessPropertiesTest') - additional_build_args = [ + additional_build_args = svm_experimental_options([ '-H:AdditionalSecurityProviders=com.oracle.svm.test.SecurityServiceTest$NoOpProvider', - '-H:AdditionalSecurityServiceTypes=com.oracle.svm.test.SecurityServiceTest$JCACompliantNoOpService' - ] + '-H:AdditionalSecurityServiceTypes=com.oracle.svm.test.SecurityServiceTest$JCACompliantNoOpService', + ]) if extra_build_args is not None: additional_build_args += extra_build_args @@ -492,7 +499,7 @@ def run_nic_conditional_config_test(agent_path, conditional_config_filter_path): test_cases = [ "createConfigPartOne", "createConfigPartTwo", - "createConfigPartThree" + "createConfigPartThree", ] config_directories = [] nic_test_dir = join(svmbuild_dir(), 'nic-cond-config-test') @@ -580,7 +587,7 @@ def dummy_harness(test_deps, vm_launcher, vm_args): custom_env['USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM'] = 'false' else: custom_env = None - unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file, '-H:Path=' + junit_test_dir], env=custom_env) + unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file] + svm_experimental_options(['-H:Path=' + junit_test_dir]), env=custom_env) image_pattern_replacement = unittest_image + ".exe" if mx.is_windows() else unittest_image run_args = [arg.replace('${unittest.image}', image_pattern_replacement) for arg in run_args] mx.log('Running: ' + ' '.join(map(pipes.quote, [unittest_image] + run_args))) @@ -717,7 +724,7 @@ def _cinterfacetutorial(native_image, args=None): mx.ensure_dir_exists(build_dir) # Build the shared library from Java code - native_image(['--shared', '-H:Path=' + build_dir, '-H:Name=libcinterfacetutorial', '-Dcom.oracle.svm.tutorial.headerfile=' + join(c_source_dir, 'mydata.h'), + native_image(['--shared', '-o', join(build_dir, 'libcinterfacetutorial'), '-Dcom.oracle.svm.tutorial.headerfile=' + join(c_source_dir, 'mydata.h'), '-H:CLibraryPath=' + tutorial_proj.dir, '-cp', tutorial_proj.output_dir()] + args) # Build the C executable @@ -797,7 +804,10 @@ def _helloworld(native_image, javac_command, path, build_only, args, variant=lis for key, value in javaProperties.items(): args.append("-D" + key + "=" + value) - native_image(["--native-image-info", "-H:Path=" + path, '-H:+VerifyNamingConventions', '-cp', path, 'HelloWorld'] + args) + binary_path = join(path, "helloworld") + native_image(["--native-image-info", "-o", binary_path,] + + svm_experimental_options(['-H:+VerifyNamingConventions']) + + ['-cp', path, 'HelloWorld'] + args) if not build_only: expected_output = [(output + os.linesep).encode()] @@ -832,7 +842,7 @@ def _helloworld(native_image, javac_command, path, build_only, args, variant=lis def _collector(x): actual_output.append(x.encode()) mx.log(x) - mx.run([join(path, 'helloworld')], out=_collector, env=env) + mx.run([binary_path], out=_collector, env=env) if actual_output != expected_output: raise Exception('Unexpected output: ' + str(actual_output) + " != " + str(expected_output)) @@ -863,13 +873,14 @@ def _debuginfotest(native_image, path, build_only, with_isolates_only, args): '--native-compiler-options=-I' + cincludepath, '-H:CLibraryPath=' + sourcepath, '--native-image-info', - '-H:+VerifyNamingConventions', '-cp', classpath('com.oracle.svm.test'), '-Dgraal.LogFile=graal.log', '-g', + ] + svm_experimental_options([ + '-H:+VerifyNamingConventions', '-H:+SourceLevelDebug', '-H:DebugInfoSourceSearchPath=' + sourcepath, - ] + args + ]) + args def build_debug_test(variant_name, image_name, extra_args): per_build_path = join(path, variant_name) @@ -895,12 +906,12 @@ def build_debug_test(variant_name, image_name, extra_args): os.environ.update({'debuginfotest_arch' : mx.get_arch()}) if not with_isolates_only: - hello_binary = build_debug_test('isolates_off', 'hello_image', testhello_args + ['-H:-SpawnIsolates']) + hello_binary = build_debug_test('isolates_off', 'hello_image', testhello_args + svm_experimental_options(['-H:-SpawnIsolates'])) if mx.get_os() == 'linux' and not build_only: os.environ.update({'debuginfotest_isolates' : 'no'}) mx.run([os.environ.get('GDB_BIN', 'gdb'), '-ex', 'python "ISOLATES=False"', '-x', gdb_utils_py, '-x', testhello_py, hello_binary]) - hello_binary = build_debug_test('isolates_on', 'hello_image', testhello_args + ['-H:+SpawnIsolates']) + hello_binary = build_debug_test('isolates_on', 'hello_image', testhello_args + svm_experimental_options(['-H:+SpawnIsolates'])) if mx.get_os() == 'linux' and not build_only: os.environ.update({'debuginfotest_isolates' : 'yes'}) mx.run([os.environ.get('GDB_BIN', 'gdb'), '-ex', 'python "ISOLATES=True"', '-x', gdb_utils_py, '-x', testhello_py, hello_binary]) @@ -911,9 +922,9 @@ def _javac_image(native_image, path, args=None): # Build an image for the javac compiler, so that we test and gate-check javac all the time. # Dynamic class loading code is reachable (used by the annotation processor), so -H:+ReportUnsupportedElementsAtRuntime is a necessary option - native_image(["-H:Path=" + path, "com.sun.tools.javac.Main", "javac", + native_image(["-o", join(path, "javac"), "com.sun.tools.javac.Main", "javac"] + svm_experimental_options([ "-H:+ReportUnsupportedElementsAtRuntime", "-H:+AllowIncompleteClasspath", - "-H:IncludeResourceBundles=com.sun.tools.javac.resources.compiler,com.sun.tools.javac.resources.javac,com.sun.tools.javac.resources.version"] + args) + "-H:IncludeResourceBundles=com.sun.tools.javac.resources.compiler,com.sun.tools.javac.resources.javac,com.sun.tools.javac.resources.version"]) + args) orig_command_benchmark = mx.command_function('benchmark') @@ -1002,11 +1013,12 @@ def _native_image_launcher_extra_jvm_args(): return res driver_build_args = [ - '-H:-ParseRuntimeOptions', '--features=com.oracle.svm.driver.APIOptionFeature', '--initialize-at-build-time=com.oracle.svm.driver', '--link-at-build-time=com.oracle.svm.driver,com.oracle.svm.driver.metainf', -] +] + svm_experimental_options([ + '-H:-ParseRuntimeOptions', +]) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJreComponent( suite=suite, @@ -1185,10 +1197,8 @@ def _native_image_launcher_extra_jvm_args(): ], polyglot_lib_build_args=[ "--macro:truffle", - "-H:Features=org.graalvm.polyglot.nativeapi.PolyglotNativeAPIFeature", + "--features=org.graalvm.polyglot.nativeapi.PolyglotNativeAPIFeature", "-Dorg.graalvm.polyglot.nativeapi.libraryPath=${java.home}/lib/polyglot/", - "-H:CStandard=C11", - "-H:+SpawnIsolates", # Temporary solution for polyglot-native-api.jar on classpath, will be fixed by modularization, GR-45104. "--add-exports org.graalvm.nativeimage.builder/com.oracle.svm.core=ALL-UNNAMED", "--add-exports org.graalvm.nativeimage.builder/com.oracle.svm.core.c.function=ALL-UNNAMED", @@ -1203,7 +1213,10 @@ def _native_image_launcher_extra_jvm_args(): "--add-exports org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c=ALL-UNNAMED", "--add-exports org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c.util=ALL-UNNAMED", "--add-exports org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED", - ], + ] + svm_experimental_options([ + "-H:CStandard=C11", + "-H:+SpawnIsolates", + ]), polyglot_lib_jar_dependencies=[ "substratevm:POLYGLOT_NATIVE_API", ], @@ -1264,6 +1277,7 @@ def _native_image_launcher_extra_jvm_args(): '--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED', '--initialize-at-build-time=org.graalvm.compiler,org.graalvm.libgraal,com.oracle.truffle', +] + svm_experimental_options([ '-H:-UseServiceLoaderFeature', '-H:+AllowFoldMethods', '-H:+ReportExceptionStackTraces', @@ -1291,7 +1305,7 @@ def _native_image_launcher_extra_jvm_args(): ] if mx.get_arch() == 'aarch64' else []) + ([ # Build libgraal with 'Full RELRO' to prevent GOT overwriting exploits on Linux (GR-46838) '-H:NativeLinkerOption=-Wl,-z,relro,-z,now', -] if mx.is_linux() else []) +] if mx.is_linux() else [])) libgraal = mx_sdk_vm.GraalVmJreComponent( suite=suite, @@ -1345,9 +1359,9 @@ def _native_image_configure_extra_jvm_args(): destination='bin/', jar_distributions=['substratevm:SVM_CONFIGURE'], main_class='com.oracle.svm.configure.ConfigurationTool', - build_args=[ + build_args=svm_experimental_options([ '-H:-ParseRuntimeOptions', - ], + ]), extra_jvm_args=_native_image_configure_extra_jvm_args(), ) ], @@ -1413,7 +1427,7 @@ def debuginfotestshared(args, config=None): """ # set an explicit path to the source tree for the tutorial code sourcepath = mx.project('com.oracle.svm.tutorial').source_dirs()[0] - all_args = ['-H:GenerateDebugInfo=1', '-H:+SourceLevelDebug', '-H:DebugInfoSourceSearchPath=' + sourcepath, '-H:-DeleteLocalSymbols'] + args + all_args = svm_experimental_options(['-H:GenerateDebugInfo=1', '-H:+SourceLevelDebug', '-H:DebugInfoSourceSearchPath=' + sourcepath, '-H:-DeleteLocalSymbols']) + args # build and run the native image using debug info # ideally we ought to script a gdb run native_image_context_run(_cinterfacetutorial, all_args) @@ -1457,9 +1471,9 @@ def hellomodule(args): # Build module into native image mx.log('Building image from java modules: ' + str(module_path)) - built_image = native_image([ - '--verbose', '-H:Path=' + build_dir, - ] + args + moduletest_run_args) + built_image = native_image( + ['--verbose'] + svm_experimental_options(['-H:Path=' + build_dir]) + args + moduletest_run_args + ) mx.log('Running image ' + built_image + ' built from module:') mx.run([built_image]) @@ -1489,17 +1503,23 @@ def build_and_test_clinittest_image(native_image, args, new_class_init_policy): mx.ensure_dir_exists(build_dir) if new_class_init_policy: - policy_args = ['-H:-UseDeprecatedOldClassInitialization', '-H:+SimulateClassInitializer', '-H:Features=com.oracle.svm.test.clinit.TestClassInitializationFeatureNewPolicyFeature'] + policy_args = svm_experimental_options(['-H:-UseDeprecatedOldClassInitialization', '-H:+SimulateClassInitializer']) + ['--features=com.oracle.svm.test.clinit.TestClassInitializationFeatureNewPolicyFeature'] else: - policy_args = ['-H:+UseDeprecatedOldClassInitialization', '-H:-SimulateClassInitializer', '-H:Features=com.oracle.svm.test.clinit.TestClassInitializationFeatureOldPolicyFeature'] + policy_args = svm_experimental_options(['-H:+UseDeprecatedOldClassInitialization', '-H:-SimulateClassInitializer']) + ['--features=com.oracle.svm.test.clinit.TestClassInitializationFeatureOldPolicyFeature'] # Build and run the example - native_image( - ['-H:Path=' + build_dir, '-cp', test_cp, '-H:Class=com.oracle.svm.test.clinit.TestClassInitialization', - '-J--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED', - '-J-ea', '-J-esa', - '-H:+PrintClassInitialization', '-H:Name=clinittest', '-H:+ReportExceptionStackTraces'] + policy_args + args) - mx.run([join(build_dir, 'clinittest')]) + binary_path = join(build_dir, 'clinittest') + native_image([ + '-cp', test_cp, + '-J--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED', + '-J-ea', '-J-esa', + '-o', binary_path, + ] + svm_experimental_options([ + '-H:Class=com.oracle.svm.test.clinit.TestClassInitialization', + '-H:+PrintClassInitialization', + '-H:+ReportExceptionStackTraces', + ]) + policy_args + args) + mx.run([binary_path]) # Check the reports for initialized classes def check_class_initialization(classes_file_name): diff --git a/substratevm/mx.substratevm/mx_substratevm_benchmark.py b/substratevm/mx.substratevm/mx_substratevm_benchmark.py index 69af993131c4..a01840ae4c0d 100644 --- a/substratevm/mx.substratevm/mx_substratevm_benchmark.py +++ b/substratevm/mx.substratevm/mx_substratevm_benchmark.py @@ -38,6 +38,7 @@ import mx_benchmark import mx_sdk_benchmark import mx_java_benchmarks +import mx_sdk_vm_impl _suite = mx.suite("substratevm") _successful_stage_pattern = re.compile(r'Successfully finished the last specified stage:.*$', re.MULTILINE) @@ -117,9 +118,9 @@ def list_jars(path): force_buildtime_init_slf4j_1_7_73, force_runtime_init_netty_4_1_72 ], - 'dotty' : [ + 'dotty' : mx_sdk_vm_impl.svm_experimental_options([ '-H:+AllowJRTFileSystem' - ] + ]) } _renaissance_pre014_config = { @@ -824,7 +825,7 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs): return args def extra_image_build_argument(self, benchmark, args): - return super(SpecJVM2008NativeImageBenchmarkSuite, self).extra_image_build_argument(benchmark, args) + ["-H:-ParseRuntimeOptions", "-Djava.awt.headless=false"] + return super(SpecJVM2008NativeImageBenchmarkSuite, self).extra_image_build_argument(benchmark, args) + mx_sdk_vm_impl.svm_experimental_options(['-H:-ParseRuntimeOptions']) + ['-Djava.awt.headless=false'] mx_benchmark.add_bm_suite(SpecJVM2008NativeImageBenchmarkSuite()) diff --git a/sulong/mx.sulong/mx_sulong.py b/sulong/mx.sulong/mx_sulong.py index 6fdf7a13ebae..0fc46e483b7a 100644 --- a/sulong/mx.sulong/mx_sulong.py +++ b/sulong/mx.sulong/mx_sulong.py @@ -460,9 +460,10 @@ def get_launcher_configs(self): main_class=self._tool_to_main(tool), build_args=[ '--initialize-at-build-time=com.oracle.truffle.llvm.toolchain.launchers', - '-H:-ParseRuntimeOptions', # we do not want `-D` options parsed by SVM '--gc=epsilon', - ], + ] + mx_sdk_vm_impl.svm_experimental_options([ + '-H:-ParseRuntimeOptions', # we do not want `-D` options parsed by SVM + ]), is_main_launcher=False, default_symlinks=False, links=[os.path.join(self.name, 'bin', e) for e in self._tool_to_aliases(tool)[1:]], diff --git a/vm/mx.vm/mx_vm.py b/vm/mx.vm/mx_vm.py index 2d493facbbd7..aa47291624e2 100644 --- a/vm/mx.vm/mx_vm.py +++ b/vm/mx.vm/mx_vm.py @@ -103,11 +103,12 @@ jar_distributions=['vm:POLYBENCH'], main_class='org.graalvm.polybench.PolyBenchLauncher', build_args=[ - '-H:-ParseRuntimeOptions', - '-H:Features=org.graalvm.launcher.PolyglotLauncherFeature', + '--features=org.graalvm.launcher.PolyglotLauncherFeature', '--initialize-at-build-time=org.graalvm.polybench', '--tool:all', - ], + ] + mx_sdk_vm_impl.svm_experimental_options([ + '-H:-ParseRuntimeOptions', + ]), is_main_launcher=True, default_symlinks=True, is_sdk_launcher=True, diff --git a/vm/mx.vm/mx_vm_benchmark.py b/vm/mx.vm/mx_vm_benchmark.py index 63370f03b9ce..96297f3ff650 100644 --- a/vm/mx.vm/mx_vm_benchmark.py +++ b/vm/mx.vm/mx_vm_benchmark.py @@ -42,6 +42,7 @@ import mx_benchmark import mx_sdk_vm import mx_sdk_vm_impl +from mx_sdk_vm_impl import svm_experimental_options _suite = mx.suite('vm') _polybench_vm_registry = mx_benchmark.VmRegistry('PolyBench', 'polybench-vm') @@ -175,8 +176,8 @@ def __init__(self, vm, bm_suite, args): self.log_dir = self.output_dir self.base_image_build_args = [os.path.join(vm.home(), 'bin', 'native-image')] self.base_image_build_args += ['--no-fallback', '-g'] - self.base_image_build_args += ['-H:+VerifyGraalGraphs', '-H:+VerifyPhases', '--diagnostics-mode'] if vm.is_gate else [] - self.base_image_build_args += ['-H:+ReportExceptionStackTraces'] + self.base_image_build_args += svm_experimental_options(['-H:+VerifyGraalGraphs', '-H:+VerifyPhases', '--diagnostics-mode']) if vm.is_gate else [] + self.base_image_build_args += svm_experimental_options(['-H:+ReportExceptionStackTraces']) self.base_image_build_args += bm_suite.build_assertions(self.benchmark_name, vm.is_gate) self.base_image_build_args += self.system_properties @@ -185,12 +186,13 @@ def __init__(self, vm, bm_suite, args): if not self.bundle_path: self.base_image_build_args += self.classpath_arguments self.base_image_build_args += self.executable - self.base_image_build_args += ['-H:Path=' + self.output_dir] - self.base_image_build_args += ['-H:ConfigurationFileDirectories=' + self.config_dir] - self.base_image_build_args += ['-H:+PrintAnalysisStatistics'] - self.base_image_build_args += ['-H:+PrintCallEdges'] - self.base_image_build_args += ['-H:+CollectImageBuildStatistics'] - + self.base_image_build_args += svm_experimental_options(['-H:Path=' + self.output_dir]) + self.base_image_build_args += svm_experimental_options([ + '-H:ConfigurationFileDirectories=' + self.config_dir, + '-H:+PrintAnalysisStatistics', + '-H:+PrintCallEdges', + '-H:+CollectImageBuildStatistics', + ]) self.image_build_reports_directory = os.path.join(self.output_dir, 'reports') if self.bundle_create_path is not None: self.image_build_reports_directory = os.path.join(self.output_dir, self.bundle_create_path) @@ -199,24 +201,24 @@ def __init__(self, vm, bm_suite, args): if vm.is_quickbuild: self.base_image_build_args += ['-Ob'] if vm.use_string_inlining: - self.base_image_build_args += ['-H:+UseStringInlining'] + self.base_image_build_args += svm_experimental_options(['-H:+UseStringInlining']) if vm.is_llvm: - self.base_image_build_args += ['-H:CompilerBackend=llvm', '-H:Features=org.graalvm.home.HomeFinderFeature', '-H:DeadlockWatchdogInterval=0'] + self.base_image_build_args += ['--features=org.graalvm.home.HomeFinderFeature'] + svm_experimental_options(['-H:CompilerBackend=llvm', '-H:DeadlockWatchdogInterval=0']) if vm.gc: - self.base_image_build_args += ['--gc=' + vm.gc, '-H:+SpawnIsolates'] + self.base_image_build_args += ['--gc=' + vm.gc] + svm_experimental_options(['-H:+SpawnIsolates']) if vm.native_architecture: self.base_image_build_args += ['-march=native'] if vm.analysis_context_sensitivity: - self.base_image_build_args += ['-H:AnalysisContextSensitivity=' + vm.analysis_context_sensitivity, '-H:-RemoveSaturatedTypeFlows', '-H:+AliasArrayTypeFlows'] + self.base_image_build_args += svm_experimental_options(['-H:AnalysisContextSensitivity=' + vm.analysis_context_sensitivity, '-H:-RemoveSaturatedTypeFlows', '-H:+AliasArrayTypeFlows']) if vm.no_inlining_before_analysis: - self.base_image_build_args += ['-H:-InlineBeforeAnalysis'] + self.base_image_build_args += svm_experimental_options(['-H:-InlineBeforeAnalysis']) if vm.optimization_level: self.base_image_build_args += ['-' + vm.optimization_level] if vm.async_sampler: self.base_image_build_args += ['-R:+FlightRecorder', '-R:StartFlightRecording=filename=default.jfr', '--enable-monitoring=jfr', - '-H:+SignalHandlerBasedExecutionSampler'] + ] + svm_experimental_options(['-H:+SignalHandlerBasedExecutionSampler']) for stage in ('instrument-image', 'instrument-run'): if stage in self.stages: self.stages.remove(stage) @@ -921,12 +923,12 @@ def run_stage_agent(self, config, stages): zipf.write(os.path.join(root, file), os.path.relpath(os.path.join(root, file), os.path.join(path, '..'))) def run_stage_instrument_image(self, config, stages, out, i, instrumentation_image_name, image_path, image_path_latest, instrumented_iterations): - executable_name_args = ['-H:Name=' + instrumentation_image_name] + executable_name_args = ['-o', instrumentation_image_name] pgo_args = ['--pgo=' + config.latest_profile_path] - pgo_args += ['-H:' + ('+' if self.pgo_context_sensitive else '-') + 'PGOContextSensitivityEnabled'] + pgo_args += svm_experimental_options(['-H:' + ('+' if self.pgo_context_sensitive else '-') + 'PGOContextSensitivityEnabled']) instrument_args = ['--pgo-instrument'] + ([] if i == 0 else pgo_args) if self.jdk_profiles_collect: - instrument_args += ['-H:+ProfilingEnabled', '-H:+AOTPriorityInline', '-H:-SamplingCollect', f'-H:ProfilingPackagePrefixes={self.generate_profiling_package_prefixes()}'] + instrument_args += svm_experimental_options(['-H:+ProfilingEnabled', '-H:+AOTPriorityInline', '-H:-SamplingCollect', f'-H:ProfilingPackagePrefixes={self.generate_profiling_package_prefixes()}']) with stages.set_command(config.base_image_build_args + executable_name_args + instrument_args) as s: s.execute_command() @@ -976,9 +978,9 @@ def _print_binary_size(self, config, out): out(f'The executed image size for benchmark {config.benchmark_suite_name}:{config.benchmark_name} is {image_size} B') def run_stage_image(self, config, stages, out): - executable_name_args = ['-H:Name=' + config.final_image_name] + executable_name_args = ['-o', config.final_image_name] pgo_args = ['--pgo=' + config.latest_profile_path] - pgo_args += ['-H:' + ('+' if self.pgo_context_sensitive else '-') + 'PGOContextSensitivityEnabled'] + pgo_args += svm_experimental_options(['-H:' + ('+' if self.pgo_context_sensitive else '-') + 'PGOContextSensitivityEnabled']) instrumented_iterations = self.pgo_instrumented_iterations if config.pgo_iteration_num is None else int(config.pgo_iteration_num) if self.adopted_jdk_pgo: # choose appropriate profiles @@ -994,11 +996,11 @@ def run_stage_image(self, config, stages, out): else: mx.warn(f'SubstrateVM Enterprise with JDK{jdk_version} does not contain JDK profiles.') adopted_profile = join(mx.suite('substratevm-enterprise').mxDir, 'empty.iprof') - jdk_profiles_args = [f'-H:AdoptedPGOEnabled={adopted_profile}'] + jdk_profiles_args = svm_experimental_options([f'-H:AdoptedPGOEnabled={adopted_profile}']) else: jdk_profiles_args = [] if self.profile_inference_feature_extraction: - ml_args = ['-H:+MLGraphFeaturesExtraction', '-H:+ProfileInferenceDumpFeatures'] + ml_args = svm_experimental_options(['-H:+MLGraphFeaturesExtraction', '-H:+ProfileInferenceDumpFeatures']) dump_file_flag = 'ProfileInferenceDumpFile' if dump_file_flag not in ''.join(config.base_image_build_args): mx.warn("To dump the profile inference features to a specific location, please set the '{}' flag.".format(dump_file_flag)) diff --git a/vm/mx.vm/mx_vm_gate.py b/vm/mx.vm/mx_vm_gate.py index 57fedb44290c..ede3cedf087f 100644 --- a/vm/mx.vm/mx_vm_gate.py +++ b/vm/mx.vm/mx_vm_gate.py @@ -593,10 +593,10 @@ def gate_substratevm(tasks, quickbuild=False): '--language:nfi', '--add-exports=java.base/jdk.internal.module=ALL-UNNAMED', '--add-exports=org.graalvm.polyglot/org.graalvm.polyglot.impl=ALL-UNNAMED', - '-H:MaxRuntimeCompileMethods=5000', '-R:MaxHeapSize=2g', '--enable-url-protocols=jar', - '--enable-url-protocols=http' + '--enable-url-protocols=http', + '-H:MaxRuntimeCompileMethods=5000', ] truffle_without_compilation = truffle_with_compilation + [ '-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime' @@ -674,6 +674,7 @@ def _collect_excludes(suite, suite_import, excludes): report_file = join(svmbuild, "language_permissions.log") options = macro_options + [ '--features=com.oracle.svm.truffle.tck.PermissionsFeature', + ] + mx_sdk_vm_impl.svm_experimental_options([ '-H:ClassInitialization=:build_time', '-H:+EnforceMaxRuntimeCompileMethods', '-H:-InlineBeforeAnalysis', @@ -684,10 +685,11 @@ def _collect_excludes(suite, suite_import, excludes): '-H:-FoldSecurityManagerGetter', f'-H:TruffleTCKPermissionsReportFile={report_file}', f'-H:Path={svmbuild}', + ]) + [ 'com.oracle.svm.truffle.tck.MockMain' ] if excludes: - options.append(f"-H:TruffleTCKPermissionsExcludeFiles={','.join(excludes)}") + options += mx_sdk_vm_impl.svm_experimental_options([f"-H:TruffleTCKPermissionsExcludeFiles={','.join(excludes)}"]) native_image(options) if isfile(report_file) and getsize(report_file) > 0: message = f"Failed: Language {language_id} performs following privileged calls:\n\n" @@ -766,7 +768,7 @@ def build_tests_image(image_dir, options, unit_tests=None, additional_deps=None, native_image_context, svm = graalvm_svm() with native_image_context(svm.IMAGE_ASSERTION_FLAGS) as native_image: import mx_compiler - build_options = ['-H:+GenerateBuildArtifactsFile'] + options + build_options = mx_sdk_vm_impl.svm_experimental_options(['-H:+GenerateBuildArtifactsFile']) + options if shared_lib: build_options = build_options + ['--shared'] build_deps = [] @@ -817,9 +819,10 @@ def gate_svm_sl_tck(tasks): options = [ '--macro:truffle', '--tool:all', + ] + mx_sdk_vm_impl.svm_experimental_options([ f'-H:Path={svmbuild}', '-H:Class=org.junit.runner.JUnitCore', - ] + ]) tests_image_path, tests_file = build_tests_image(svmbuild, options, ['com.oracle.truffle.tck.tests'], ['truffle:TRUFFLE_SL_TCK', 'truffle:TRUFFLE_TCK_INSTRUMENTATION']) with open(tests_file) as f: test_classes = [l.rstrip() for l in f.readlines()] From 6174062c85041eb902e9e3004472bc5f7efb3da7 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 7 Aug 2023 11:00:06 +0200 Subject: [PATCH 07/17] Use `UnlockExperimentalVMOptions` in properties. --- .../mx.espresso/native-image-preinit.properties | 10 +++++----- espresso/mx.espresso/native-image.properties | 11 +++++------ regex/mx.regex/native-image.properties | 4 ++-- .../org.graalvm.home/native-image.properties | 2 +- .../native-image.properties | 3 --- .../resource-config.json | 15 +++++++++++++++ .../mx.substratevm/language-nfi.properties | 2 +- substratevm/mx.substratevm/macro-junit.properties | 8 +++++--- .../mx.substratevm/macro-junitcp.properties | 8 +++++--- .../mx.substratevm/macro-truffle.properties | 4 ++-- .../META-INF/native-image/native-image.properties | 1 - .../META-INF/native-image/resource-config.json | 9 +++++++++ sulong/mx.sulong/native-image.properties | 4 ++-- tools/mx.tools/tools-chromeinspector.properties | 5 +++-- tools/mx.tools/tools-coverage.properties | 4 ++-- tools/mx.tools/tools-dap.properties | 6 ++++-- tools/mx.tools/tools-insight.properties | 6 +++--- tools/mx.tools/tools-lsp.properties | 4 ++-- tools/mx.tools/tools-profiler.properties | 6 ++---- .../resource-config.json | 9 +++++++++ truffle/mx.truffle/language-icu4j.properties | 2 +- .../native-image.properties | 2 +- .../META-INF/native-image/native-image.properties | 3 +-- .../META-INF/native-image/resource-config.json | 9 +++++++++ vm/mx.vm/language-pmh.properties | 4 ++-- .../r/jre/languages/R/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- .../jre/languages/python/native-image.properties | 6 ++++-- .../jre/languages/python/native-image.properties | 6 ++++-- .../jre/languages/python/native-image.properties | 4 +++- .../jre/languages/R/native-image.properties | 6 ++++-- .../jre/languages/R/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- .../jre/languages/ruby/native-image.properties | 6 ++++-- wasm/mx.wasm/native-image.properties | 5 +++-- 38 files changed, 141 insertions(+), 75 deletions(-) create mode 100644 sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/resource-config.json create mode 100644 substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/resource-config.json create mode 100644 tools/src/com.oracle.truffle.tools.profiler/src/META-INF/native-image/com.oracle.truffle.tools.profiler/resource-config.json create mode 100644 truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/resource-config.json diff --git a/espresso/mx.espresso/native-image-preinit.properties b/espresso/mx.espresso/native-image-preinit.properties index f441a16e38a0..08f81d3fa8ed 100644 --- a/espresso/mx.espresso/native-image-preinit.properties +++ b/espresso/mx.espresso/native-image-preinit.properties @@ -1,10 +1,10 @@ Requires = language:nfi -Args = -H:MaxRuntimeCompileMethods=7000 \ - -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ - -H:+TruffleCheckBlockListMethods \ - --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ - --initialize-at-build-time=com.oracle.truffle.espresso +Args = --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ + --initialize-at-build-time=com.oracle.truffle.espresso \ + -H:MaxRuntimeCompileMethods=7000 \ + -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ + -H:+TruffleCheckBlockListMethods \ JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=java \ -Dpolyglot.image-build-time.PreinitializeContextsWithNative=true diff --git a/espresso/mx.espresso/native-image.properties b/espresso/mx.espresso/native-image.properties index dd3d34962339..4328d2a76de7 100644 --- a/espresso/mx.espresso/native-image.properties +++ b/espresso/mx.espresso/native-image.properties @@ -1,8 +1,7 @@ Requires = language:nfi -Args = -H:MaxRuntimeCompileMethods=7000 \ - -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ - -H:+TruffleCheckBlockListMethods \ - --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ - --initialize-at-build-time=com.oracle.truffle.espresso - +Args = --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ + --initialize-at-build-time=com.oracle.truffle.espresso \ + -H:MaxRuntimeCompileMethods=7000 \ + -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ + -H:+TruffleCheckBlockListMethods \ diff --git a/regex/mx.regex/native-image.properties b/regex/mx.regex/native-image.properties index 4a80da1a8601..4aeebcb63f21 100644 --- a/regex/mx.regex/native-image.properties +++ b/regex/mx.regex/native-image.properties @@ -2,5 +2,5 @@ ExcludeFromAll=true Requires = language:icu4j -Args = -H:MaxRuntimeCompileMethods=900 \ - --initialize-at-build-time=com.oracle.truffle.regex +Args = --initialize-at-build-time=com.oracle.truffle.regex \ + -H:MaxRuntimeCompileMethods=900 \ diff --git a/sdk/src/org.graalvm.home/src/META-INF/native-image/org.graalvm.home/native-image.properties b/sdk/src/org.graalvm.home/src/META-INF/native-image/org.graalvm.home/native-image.properties index 491793248cc5..cb9a689a4829 100644 --- a/sdk/src/org.graalvm.home/src/META-INF/native-image/org.graalvm.home/native-image.properties +++ b/sdk/src/org.graalvm.home/src/META-INF/native-image/org.graalvm.home/native-image.properties @@ -1 +1 @@ -Args = -H:Features=org.graalvm.home.HomeFinderFeature +Args = --features=org.graalvm.home.HomeFinderFeature diff --git a/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/native-image.properties b/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/native-image.properties index bf14bd430dae..337e654be7b8 100644 --- a/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/native-image.properties +++ b/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/native-image.properties @@ -2,6 +2,3 @@ # OSUtils detects current OS capabilities in static ctor Args = --initialize-at-build-time=org.graalvm.shadowed.org.jline \ --initialize-at-run-time=org.graalvm.shadowed.org.jline.utils.AttributedCharSequence,org.graalvm.shadowed.org.jline.utils.OSUtils \ - -H:IncludeResources=org/graalvm/shadowed/org/jline/utils/.+\.caps$ \ - -H:IncludeResources=org/graalvm/shadowed/org/jline/utils/.+\.txt$ \ - -H:IncludeResources=org/graalvm/shadowed/org/jline/builtins/.+\.txt$ diff --git a/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/resource-config.json b/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/resource-config.json new file mode 100644 index 000000000000..81d023f62aff --- /dev/null +++ b/sdk/src/org.graalvm.shadowed.org.jline/src/META-INF/native-image/org.graalvm.shadowed.org.jline/resource-config.json @@ -0,0 +1,15 @@ +{ + "resources": { + "includes": [ + { + "pattern": "org/graalvm/shadowed/org/jline/utils/.+\\.caps$" + }, + { + "pattern": "org/graalvm/shadowed/org/jline/utils/.+\\.txt$" + }, + { + "pattern": "org/graalvm/shadowed/org/jline/builtins/.+\\.txt$" + } + ] + } +} diff --git a/substratevm/mx.substratevm/language-nfi.properties b/substratevm/mx.substratevm/language-nfi.properties index 1b7fcde4eff1..51c5c65cde4e 100644 --- a/substratevm/mx.substratevm/language-nfi.properties +++ b/substratevm/mx.substratevm/language-nfi.properties @@ -6,7 +6,7 @@ Args = --features=com.oracle.svm.truffle.nfi.TruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.posix.PosixTruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.windows.WindowsTruffleNFIFeature \ -H:CLibraryPath=${.}/builder/clibraries-${*} \ - -H:MaxRuntimeCompileMethods=600 + -H:MaxRuntimeCompileMethods=600 \ ImageClasspath = ${.}/truffle-nfi.jar:${.}/truffle-nfi-${*}.jar diff --git a/substratevm/mx.substratevm/macro-junit.properties b/substratevm/mx.substratevm/macro-junit.properties index 4c424d24815a..9e87b69f3f1e 100644 --- a/substratevm/mx.substratevm/macro-junit.properties +++ b/substratevm/mx.substratevm/macro-junit.properties @@ -5,8 +5,10 @@ ImageName = svmjunit ImageModulePath = ${.}/junit-support.jar ImageClasspath = ${.}/junit-tool.jar:${.}/junit.jar:${.}/hamcrest.jar -Args = -H:Features=com.oracle.svm.junit.JUnitFeature \ +Args = --features=com.oracle.svm.junit.JUnitFeature \ + --initialize-at-build-time=org.junit,com.oracle.mxtool.junit \ + --link-at-build-time=@svm-junit.packages \ + -H:+UnlockExperimentalVMOptions \ -H:Class=com.oracle.svm.junit.SVMJUnitRunner \ -H:TestFile=${*} \ - --initialize-at-build-time=org.junit,com.oracle.mxtool.junit \ - --link-at-build-time=@svm-junit.packages \ No newline at end of file + -H:-UnlockExperimentalVMOptions diff --git a/substratevm/mx.substratevm/macro-junitcp.properties b/substratevm/mx.substratevm/macro-junitcp.properties index 9ffa49e86046..cfa618e36a9a 100644 --- a/substratevm/mx.substratevm/macro-junitcp.properties +++ b/substratevm/mx.substratevm/macro-junitcp.properties @@ -4,8 +4,10 @@ ImageName = svmjunit ImageClasspath = ${.}/junit-support.jar:${.}/junit-tool.jar:${.}/junit.jar:${.}/hamcrest.jar -Args = -H:Features=com.oracle.svm.junit.JUnitFeature \ +Args = --features=com.oracle.svm.junit.JUnitFeature \ + --initialize-at-build-time=org.junit,com.oracle.mxtool.junit \ + --link-at-build-time=@svm-junit.packages \ + -H:+UnlockExperimentalVMOptions \ -H:Class=com.oracle.svm.junit.SVMJUnitRunner \ -H:TestFile=${*} \ - --initialize-at-build-time=org.junit,com.oracle.mxtool.junit \ - --link-at-build-time=@svm-junit.packages + -H:-UnlockExperimentalVMOptions diff --git a/substratevm/mx.substratevm/macro-truffle.properties b/substratevm/mx.substratevm/macro-truffle.properties index d9775633b7a5..620f1b12ef4f 100644 --- a/substratevm/mx.substratevm/macro-truffle.properties +++ b/substratevm/mx.substratevm/macro-truffle.properties @@ -3,7 +3,6 @@ Args = --features=com.oracle.svm.truffle.TruffleFeature \ --features=com.oracle.svm.truffle.TruffleBaseFeature \ --features=com.oracle.svm.truffle.TruffleJFRFeature \ --features=org.graalvm.home.HomeFinderFeature \ - -H:MaxRuntimeCompileMethods=2500 \ --initialize-at-build-time=com.oracle.truffle \ --initialize-at-build-time=org.graalvm.shadowed.org.jcodings \ --initialize-at-build-time=org.graalvm.jniutils \ @@ -12,7 +11,8 @@ Args = --features=com.oracle.svm.truffle.TruffleFeature \ --initialize-at-build-time=com.oracle.truffle.tools.utils.json \ --initialize-at-build-time=org.graalvm.shadowed.org.jline,org.graalvm.shadowed.org.fusesource.jansi \ --initialize-at-run-time=sun.rmi \ - --initialize-at-run-time=java.rmi + --initialize-at-run-time=java.rmi \ + -H:MaxRuntimeCompileMethods=2500 \ # The `--add-exports` are a temporary solution for languages on classpath, will be fixed by languages modularization, GR-44217. JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleRuntime \ diff --git a/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties index 383d9568d011..b0a75f117b16 100644 --- a/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties +++ b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties @@ -1,4 +1,3 @@ Args = \ --add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED \ --add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.util.json=ALL-UNNAMED \ - -H:IncludeResources=com/oracle/svm/configure/test/config/.*json diff --git a/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/resource-config.json b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/resource-config.json new file mode 100644 index 000000000000..49dfbaaa0e58 --- /dev/null +++ b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/resource-config.json @@ -0,0 +1,9 @@ +{ + "resources": { + "includes": [ + { + "pattern": "com/oracle/svm/configure/test/config/.*\\.json" + } + ] + } +} diff --git a/sulong/mx.sulong/native-image.properties b/sulong/mx.sulong/native-image.properties index 6f857f04a1f8..1e684b49887e 100644 --- a/sulong/mx.sulong/native-image.properties +++ b/sulong/mx.sulong/native-image.properties @@ -3,6 +3,6 @@ Requires = language:nfi language:antlr4 -Args = -H:MaxRuntimeCompileMethods=10000 \ +Args = --initialize-at-build-time=com.oracle.truffle.llvm,org.antlr.v4.runtime \ + -H:MaxRuntimeCompileMethods=10000 \ -H:+AddAllCharsets \ - --initialize-at-build-time=com.oracle.truffle.llvm,org.antlr.v4.runtime diff --git a/tools/mx.tools/tools-chromeinspector.properties b/tools/mx.tools/tools-chromeinspector.properties index d356bd9dc2f7..59daf868f260 100644 --- a/tools/mx.tools/tools-chromeinspector.properties +++ b/tools/mx.tools/tools-chromeinspector.properties @@ -1,3 +1,4 @@ Requires = tool:profiler language:truffle-json -Args = -H:MaxRuntimeCompileMethods=300 \ - --initialize-at-build-time=com.oracle.truffle.tools.chromeinspector +Args = --initialize-at-build-time=com.oracle.truffle.tools.chromeinspector \ + -H:MaxRuntimeCompileMethods=300 + diff --git a/tools/mx.tools/tools-coverage.properties b/tools/mx.tools/tools-coverage.properties index dba5df17c196..24049163e862 100644 --- a/tools/mx.tools/tools-coverage.properties +++ b/tools/mx.tools/tools-coverage.properties @@ -1,3 +1,3 @@ Requires = macro:truffle language:truffle-json -Args = -H:MaxRuntimeCompileMethods=100 \ - --initialize-at-build-time=com.oracle.truffle.tools.coverage +Args = --initialize-at-build-time=com.oracle.truffle.tools.coverage \ + -H:MaxRuntimeCompileMethods=100 diff --git a/tools/mx.tools/tools-dap.properties b/tools/mx.tools/tools-dap.properties index 6834b6bf79b6..837dca9c66e3 100644 --- a/tools/mx.tools/tools-dap.properties +++ b/tools/mx.tools/tools-dap.properties @@ -1,3 +1,5 @@ Requires = macro:truffle language:truffle-json -Args = -H:MaxRuntimeCompileMethods=100 \ - --initialize-at-build-time=com.oracle.truffle.tools.dap +Args = --initialize-at-build-time=com.oracle.truffle.tools.dap \ + -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=100 \ + -H:-UnlockExperimentalVMOptions diff --git a/tools/mx.tools/tools-insight.properties b/tools/mx.tools/tools-insight.properties index cbdd64f99ff0..3af290d61d56 100644 --- a/tools/mx.tools/tools-insight.properties +++ b/tools/mx.tools/tools-insight.properties @@ -1,3 +1,3 @@ -Args = -H:MaxRuntimeCompileMethods=300 \ - --initialize-at-build-time=com.oracle.truffle.tools.agentscript \ - --initialize-at-build-time=org.graalvm.tools.insight +Args = --initialize-at-build-time=com.oracle.truffle.tools.agentscript \ + --initialize-at-build-time=org.graalvm.tools.insight \ + -H:MaxRuntimeCompileMethods=300 diff --git a/tools/mx.tools/tools-lsp.properties b/tools/mx.tools/tools-lsp.properties index ff0bee4c2d7b..2df4fb535997 100644 --- a/tools/mx.tools/tools-lsp.properties +++ b/tools/mx.tools/tools-lsp.properties @@ -1,3 +1,3 @@ Requires = macro:truffle language:truffle-json -Args = -H:MaxRuntimeCompileMethods=100 \ - --initialize-at-build-time=org.graalvm.tools.lsp,org.graalvm.tools.api.lsp +Args = --initialize-at-build-time=org.graalvm.tools.lsp,org.graalvm.tools.api.lsp \ + -H:MaxRuntimeCompileMethods=100 diff --git a/tools/mx.tools/tools-profiler.properties b/tools/mx.tools/tools-profiler.properties index 58a87ad9fecf..21d928095401 100644 --- a/tools/mx.tools/tools-profiler.properties +++ b/tools/mx.tools/tools-profiler.properties @@ -1,5 +1,3 @@ Requires = macro:truffle language:truffle-json -Args = -H:MaxRuntimeCompileMethods=100 \ - -H:IncludeResources=com/oracle/truffle/tools/profiler/impl/resources/.+js \ - --initialize-at-build-time=com.oracle.truffle.tools.profiler - +Args = --initialize-at-build-time=com.oracle.truffle.tools.profiler \ + -H:MaxRuntimeCompileMethods=100 diff --git a/tools/src/com.oracle.truffle.tools.profiler/src/META-INF/native-image/com.oracle.truffle.tools.profiler/resource-config.json b/tools/src/com.oracle.truffle.tools.profiler/src/META-INF/native-image/com.oracle.truffle.tools.profiler/resource-config.json new file mode 100644 index 000000000000..abe6b139bfb1 --- /dev/null +++ b/tools/src/com.oracle.truffle.tools.profiler/src/META-INF/native-image/com.oracle.truffle.tools.profiler/resource-config.json @@ -0,0 +1,9 @@ +{ + "resources": { + "includes": [ + { + "pattern": "com/oracle/truffle/tools/profiler/impl/resources/.+js" + } + ] + } +} \ No newline at end of file diff --git a/truffle/mx.truffle/language-icu4j.properties b/truffle/mx.truffle/language-icu4j.properties index 48763c52d9fe..adf53bdd6ce0 100644 --- a/truffle/mx.truffle/language-icu4j.properties +++ b/truffle/mx.truffle/language-icu4j.properties @@ -3,4 +3,4 @@ ImageClasspath = ${.}/truffle-icu4j.jar #ImageModulePath = ${.}/truffle-icu4j.jar -Args = -H:ClassInitialization=org.graalvm.shadowed.com.ibm.icu:rerun +Args = --rerun-class-initialization-at-runtime=org.graalvm.shadowed.com.ibm.icu diff --git a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties index 4718a0cae742..23e884ec35e0 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties +++ b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties @@ -1,4 +1,4 @@ Args = --features=com.oracle.svm.truffle.nfi.TruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.posix.PosixTruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.windows.WindowsTruffleNFIFeature \ - -H:MaxRuntimeCompileMethods=600 + -H:MaxRuntimeCompileMethods=600 \ diff --git a/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/native-image.properties b/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/native-image.properties index 11c16d7df0be..a83026593ce9 100644 --- a/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/native-image.properties +++ b/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/native-image.properties @@ -1,2 +1 @@ -Args = -H:MaxRuntimeCompileMethods=3000 \ - -H:IncludeResources=com/oracle/truffle/sl/tck/resources/.* +Args = -H:MaxRuntimeCompileMethods=3000 diff --git a/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/resource-config.json b/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/resource-config.json new file mode 100644 index 000000000000..459167a23ef0 --- /dev/null +++ b/truffle/src/com.oracle.truffle.sl.tck/src/META-INF/native-image/resource-config.json @@ -0,0 +1,9 @@ +{ + "resources": { + "includes": [ + { + "pattern": "com/oracle/truffle/sl/tck/resources/.*" + } + ] + } +} diff --git a/vm/mx.vm/language-pmh.properties b/vm/mx.vm/language-pmh.properties index 5df2daad5230..75237a9580a2 100644 --- a/vm/mx.vm/language-pmh.properties +++ b/vm/mx.vm/language-pmh.properties @@ -1,4 +1,4 @@ Requires = language:nfi -Args = -H:MaxRuntimeCompileMethods=2000 \ - --initialize-at-build-time=org.graalvm.polybench +Args = --initialize-at-build-time=org.graalvm.polybench \ + -H:MaxRuntimeCompileMethods=2000 \ diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties index 0909c669d51c..86648792e292 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties @@ -19,8 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:MaxRuntimeCompileMethods=8000 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=8000 \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ -H:EnableURLProtocols=http \ - -H:-UseServiceLoaderFeature + -H:-UseServiceLoaderFeature \ + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties index ef2b56324711..582d6b2853a9 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties @@ -10,5 +10,7 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:MaxRuntimeCompileMethods=7000 \ - -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=7000 \ + -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json \ + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties index ef2b56324711..582d6b2853a9 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties @@ -10,5 +10,7 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:MaxRuntimeCompileMethods=7000 \ - -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=7000 \ + -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json \ + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties index ef2b56324711..d334bd29d688 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties @@ -10,5 +10,7 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:MaxRuntimeCompileMethods=7000 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=7000 \ -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties index 0909c669d51c..86648792e292 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties @@ -19,8 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:MaxRuntimeCompileMethods=8000 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=8000 \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ -H:EnableURLProtocols=http \ - -H:-UseServiceLoaderFeature + -H:-UseServiceLoaderFeature \ + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties index 0909c669d51c..86648792e292 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties @@ -19,8 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:MaxRuntimeCompileMethods=8000 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=8000 \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ -H:EnableURLProtocols=http \ - -H:-UseServiceLoaderFeature + -H:-UseServiceLoaderFeature \ + -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties index d6c0a2b243ba..4d95f357a226 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties @@ -8,9 +8,11 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:MaxRuntimeCompileMethods=5400 \ +Args = -H:+UnlockExperimentalVMOptions \ + -H:MaxRuntimeCompileMethods=5400 \ -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ - -H:+AddAllCharsets + -H:+AddAllCharsets \ + -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/wasm/mx.wasm/native-image.properties b/wasm/mx.wasm/native-image.properties index fe9e6b7ec71b..fb226a2a837f 100644 --- a/wasm/mx.wasm/native-image.properties +++ b/wasm/mx.wasm/native-image.properties @@ -1,4 +1,5 @@ # This file contains native-image arguments needed to build graal-wasm -Args = -H:MaxRuntimeCompileMethods=2000 \ - --initialize-at-build-time=org.graalvm.wasm \ No newline at end of file +Args = --initialize-at-build-time=org.graalvm.wasm \ + -H:MaxRuntimeCompileMethods=2000 \ + \ No newline at end of file From 3133bba5c8b585322a7a0382576e2cdff86eebc5 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 10:54:38 +0200 Subject: [PATCH 08/17] Revise Native Image config files in espresso/. --- espresso/mx.espresso/native-image-preinit.properties | 10 +++------- espresso/mx.espresso/native-image.properties | 8 +++----- espresso/mx.espresso/suite.py | 11 ++--------- .../com.oracle.truffle.espresso/reflect-config.json} | 0 4 files changed, 8 insertions(+), 21 deletions(-) rename espresso/{mx.espresso/reflectconfig.json => src/com.oracle.truffle.espresso/src/META-INF/native-image/com.oracle.truffle.espresso/reflect-config.json} (100%) diff --git a/espresso/mx.espresso/native-image-preinit.properties b/espresso/mx.espresso/native-image-preinit.properties index 08f81d3fa8ed..4b1ffd1c1466 100644 --- a/espresso/mx.espresso/native-image-preinit.properties +++ b/espresso/mx.espresso/native-image-preinit.properties @@ -1,12 +1,8 @@ Requires = language:nfi -Args = --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ - --initialize-at-build-time=com.oracle.truffle.espresso \ - -H:MaxRuntimeCompileMethods=7000 \ - -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ - -H:+TruffleCheckBlockListMethods \ +Args = --initialize-at-build-time=com.oracle.truffle.espresso \ + --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ + -H:MaxRuntimeCompileMethods=7000 JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=java \ -Dpolyglot.image-build-time.PreinitializeContextsWithNative=true - - diff --git a/espresso/mx.espresso/native-image.properties b/espresso/mx.espresso/native-image.properties index 4328d2a76de7..e8dfc87fb445 100644 --- a/espresso/mx.espresso/native-image.properties +++ b/espresso/mx.espresso/native-image.properties @@ -1,7 +1,5 @@ Requires = language:nfi -Args = --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ - --initialize-at-build-time=com.oracle.truffle.espresso \ - -H:MaxRuntimeCompileMethods=7000 \ - -H:ReflectionConfigurationFiles=${.}/reflectconfig.json \ - -H:+TruffleCheckBlockListMethods \ +Args = --initialize-at-build-time=com.oracle.truffle.espresso \ + --features=com.oracle.truffle.espresso.ref.FinalizationFeature \ + -H:MaxRuntimeCompileMethods=7000 diff --git a/espresso/mx.espresso/suite.py b/espresso/mx.espresso/suite.py index 97b041282a0b..27e8970ac69e 100644 --- a/espresso/mx.espresso/suite.py +++ b/espresso/mx.espresso/suite.py @@ -377,7 +377,6 @@ "linux": { "": { "layout": { - "./": ["file:mx.espresso/reflectconfig.json"], "./native-image.properties": ["file:mx.espresso/native-image-preinit.properties"], "LICENSE_JAVAONTRUFFLE": "file:LICENSE", "lib/": [ @@ -394,10 +393,7 @@ "linux-musl": { "": { "layout": { - "./": [ - "file:mx.espresso/reflectconfig.json", - "file:mx.espresso/native-image.properties", - ], + "./": ["file:mx.espresso/native-image.properties"], "LICENSE_JAVAONTRUFFLE": "file:LICENSE", "lib/": [ "dependency:espresso:com.oracle.truffle.espresso.native/", @@ -412,10 +408,7 @@ "": { "": { "layout": { - "./": [ - "file:mx.espresso/native-image.properties", - "file:mx.espresso/reflectconfig.json", - ], + "./": ["file:mx.espresso/native-image.properties"], "LICENSE_JAVAONTRUFFLE": "file:LICENSE", "lib/": [ "dependency:espresso:com.oracle.truffle.espresso.eden/", diff --git a/espresso/mx.espresso/reflectconfig.json b/espresso/src/com.oracle.truffle.espresso/src/META-INF/native-image/com.oracle.truffle.espresso/reflect-config.json similarity index 100% rename from espresso/mx.espresso/reflectconfig.json rename to espresso/src/com.oracle.truffle.espresso/src/META-INF/native-image/com.oracle.truffle.espresso/reflect-config.json From e52c1701940c4f3b0fcaf2bfefa8d8e5f9d3675b Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 11:00:30 +0200 Subject: [PATCH 09/17] Revise `com.oracle.truffle.api.test` config. --- .../META-INF/native-image/native-image.properties | 5 +---- .../native-image/proxy-config.json} | 0 .../native-image/reflect-config.json} | 0 .../native-image/serialization-config.json} | 0 .../api/test/polyglot/ExposeToGuestTest.java | 10 +++++----- .../truffle/api/test/polyglot/GR22815Test.java | 4 ++-- .../truffle/api/test/polyglot/HostAccessTest.java | 14 +++++++------- .../api/test/polyglot/HostStackTraceTest.java | 2 +- .../RegisterTestClassesForReflectionFeature.java | 4 ++-- .../truffle/api/test/polyglot/ValueAPITest.java | 10 +++++----- .../api/test/polyglot/ValueHostConversionTest.java | 2 +- .../api/test/polyglot/ValueHostInteropTest.java | 6 +++--- 12 files changed, 27 insertions(+), 30 deletions(-) rename truffle/src/com.oracle.truffle.api.test/src/{com/oracle/truffle/api/test/polyglot/proxys.json => META-INF/native-image/proxy-config.json} (100%) rename truffle/src/com.oracle.truffle.api.test/src/{com/oracle/truffle/api/test/polyglot/reflection.json => META-INF/native-image/reflect-config.json} (100%) rename truffle/src/com.oracle.truffle.api.test/src/{com/oracle/truffle/api/test/polyglot/serialization.json => META-INF/native-image/serialization-config.json} (100%) diff --git a/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/native-image.properties b/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/native-image.properties index f7e985ad096d..73173586a62a 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/native-image.properties +++ b/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/native-image.properties @@ -1,7 +1,4 @@ -Args = -H:Features=com.oracle.truffle.api.test.polyglot.RegisterTestClassesForReflectionFeature \ - -H:ReflectionConfigurationResources=com/oracle/truffle/api/test/polyglot/reflection.json \ - -H:DynamicProxyConfigurationResources=com/oracle/truffle/api/test/polyglot/proxys.json \ - -H:SerializationConfigurationResources=com/oracle/truffle/api/test/polyglot/serialization.json \ +Args = --features=com.oracle.truffle.api.test.polyglot.RegisterTestClassesForReflectionFeature \ --initialize-at-build-time=com.google.common.jimfs.SystemJimfsFileSystemProvider,com.google.common.collect.MapMakerInternalMap,com.google.common.collect.MapMakerInternalMap$StrongKeyWeakValueSegment,com.google.common.collect.MapMakerInternalMap$EntrySet,com.google.common.collect.MapMakerInternalMap$1,com.google.common.collect.MapMakerInternalMap$StrongKeyWeakValueEntry$Helper,com.google.common.base.Equivalence$Equals \ -Dpolyglot.image-build-time.PreinitializeContexts=ContextPreintializationNativeImageLanguage \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/proxys.json b/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/proxy-config.json similarity index 100% rename from truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/proxys.json rename to truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/proxy-config.json diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/reflection.json b/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/reflect-config.json similarity index 100% rename from truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/reflection.json rename to truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/reflect-config.json diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/serialization.json b/truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/serialization-config.json similarity index 100% rename from truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/serialization.json rename to truffle/src/com.oracle.truffle.api.test/src/META-INF/native-image/serialization-config.json diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ExposeToGuestTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ExposeToGuestTest.java index 1a92ed71da74..dbf4369e1b23 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ExposeToGuestTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ExposeToGuestTest.java @@ -504,13 +504,13 @@ public void staticConstructorAccessIsForbidden() throws InteropException { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ interface EmptyInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ interface UnmarkedInterface { @@ -519,7 +519,7 @@ interface UnmarkedInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @Implementable interface MarkedInterface { @@ -529,7 +529,7 @@ interface MarkedInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface interface MarkedFunctional { @@ -539,7 +539,7 @@ interface MarkedFunctional { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ interface UnmarkedFunctional { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR22815Test.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR22815Test.java index e5308291a881..b382bec7e260 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR22815Test.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR22815Test.java @@ -53,7 +53,7 @@ public class GR22815Test { /* - * Referenced in reflection.json + * Referenced in reflect-config.json */ @Export public static String log(String msg, Throwable thrown) { @@ -61,7 +61,7 @@ public static String log(String msg, Throwable thrown) { } /* - * Referenced in reflection.json + * Referenced in reflect-config.json */ @Export public static String log(Throwable thrown, String msgSupplier) { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostAccessTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostAccessTest.java index 646cf065f79c..ae6acd7dce0b 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostAccessTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostAccessTest.java @@ -887,7 +887,7 @@ public void testConverterMapString() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @Implementable public interface ConverterProxy { @@ -931,7 +931,7 @@ public void testConverterProxy() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface ConverterFunction { @@ -1232,7 +1232,7 @@ public static class NoCoercion { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @Implementable public interface TestInterface { @@ -1871,7 +1871,7 @@ public int y() { } /** - * Referenced in {@code proxys.json}. + * Referenced in {@code proxy-config.json}. */ public interface ProxiedPoint { /** Not exported. */ @@ -1894,7 +1894,7 @@ default int z() { } /** - * Referenced in {@code proxys.json}. + * Referenced in {@code proxy-config.json}. */ public interface ProxiedPoint2 extends ProxiedPoint { @Export @@ -2390,7 +2390,7 @@ Object getIteratorNextElement() throws StopIterationException { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface interface FuncInterface { @@ -2398,7 +2398,7 @@ interface FuncInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ interface HostMembers { } diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostStackTraceTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostStackTraceTest.java index 6b328eb32e4a..f897348b8481 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostStackTraceTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostStackTraceTest.java @@ -212,7 +212,7 @@ public Object get() { } /* - * Referenced in reflection.json + * Referenced in reflect-config.json */ public void v0() { throw new RuntimeException(); diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java index b90ae6f2942f..533347206a12 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java @@ -49,8 +49,8 @@ /** * Register all named inner classes under {@link #TEST_CLASSES} for reflection, so that they - * do not need to be listed in {@code reflection.json}. Anonymous inner classes however must be - * listed in {@code reflection.json}, as Java provides no way to list those. + * do not need to be listed in {@code reflect-config.json}. Anonymous inner classes however must be + * listed in {@code reflect-config.json}, as Java provides no way to list those. */ public class RegisterTestClassesForReflectionFeature implements Feature { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java index 7b23f58e2623..6f1a92b44816 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java @@ -1774,7 +1774,7 @@ public interface ExecutableInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface OtherInterface0 { @@ -1784,7 +1784,7 @@ public interface OtherInterface0 { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface OtherInterface1 { @@ -1794,7 +1794,7 @@ public interface OtherInterface1 { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface OtherInterface2 { @@ -2036,7 +2036,7 @@ public void testPolyglotMapRemoveEntry() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @Implementable public interface EmptyInterface { @@ -2048,7 +2048,7 @@ public interface EmptyInterface { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface EmptyFunctionalInterface { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java index df2d0b5fff3a..843ae362e1af 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java @@ -1180,7 +1180,7 @@ public void testExceptionFrames2() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ private interface TestExceptionFrames3 { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostInteropTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostInteropTest.java index 6c1adc75ab45..7d5282cf8401 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostInteropTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostInteropTest.java @@ -466,7 +466,7 @@ public void testClassStaticIdentity() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface FunctionalWithDefaults { @@ -485,7 +485,7 @@ public void functionalInterfaceOverridingObjectMethods() throws Exception { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ @FunctionalInterface public interface FunctionalWithObjectMethodOverrides { @@ -874,7 +874,7 @@ public void testRemoveMap() { } /* - * Referenced in proxys.json + * Referenced in proxy-config.json */ public interface XYPlus { List arr(); From 6f36b5dea9e32d639c913fb2cf80156f8a0b7bf4 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 12:28:02 +0200 Subject: [PATCH 10/17] Revise `com.oracle.truffle.tck.tests` config. --- .../src/META-INF/native-image/native-image.properties | 3 --- .../proxys.json => META-INF/native-image/proxy-config.json} | 0 .../native-image/reflect-config.json} | 0 3 files changed, 3 deletions(-) rename truffle/src/com.oracle.truffle.tck.tests/src/{com/oracle/truffle/tck/tests/proxys.json => META-INF/native-image/proxy-config.json} (100%) rename truffle/src/com.oracle.truffle.tck.tests/src/{com/oracle/truffle/tck/tests/reflection.json => META-INF/native-image/reflect-config.json} (100%) diff --git a/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties index ff3ebdf43825..aada40c2565d 100644 --- a/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties +++ b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties @@ -1,5 +1,2 @@ Args = --initialize-at-build-time=org.hamcrest,org.junit \ --features=com.oracle.truffle.tck.tests.TruffleTCKFeature \ - -H:ReflectionConfigurationResources=com/oracle/truffle/tck/tests/reflection.json \ - -H:DynamicProxyConfigurationResources=com/oracle/truffle/tck/tests/proxys.json - diff --git a/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/proxys.json b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/proxy-config.json similarity index 100% rename from truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/proxys.json rename to truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/proxy-config.json diff --git a/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/reflection.json b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/reflect-config.json similarity index 100% rename from truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/reflection.json rename to truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/reflect-config.json From 863da8259644f80b5616825110b6cadaf2327606 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 12:52:30 +0200 Subject: [PATCH 11/17] Revise `org.graalvm.launcher` config. --- .../org.graalvm.launcher/{launcher.jniconfig => jni-config.json} | 0 .../native-image/org.graalvm.launcher/native-image.properties | 1 - 2 files changed, 1 deletion(-) rename sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/{launcher.jniconfig => jni-config.json} (100%) diff --git a/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/launcher.jniconfig b/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/jni-config.json similarity index 100% rename from sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/launcher.jniconfig rename to sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/jni-config.json diff --git a/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties b/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties index abb53a003140..b2d72f1f38aa 100644 --- a/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties +++ b/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties @@ -1,4 +1,3 @@ Args = --add-exports=java.base/jdk.internal.module=ALL-UNNAMED \ --features=org.graalvm.launcher.JLine3FeatureModuleAccessFeature \ --initialize-at-build-time=org.graalvm.launcher,org.graalvm.shadowed.org.jline \ - -H:JNIConfigurationResources=${.}/launcher.jniconfig From 31b4116bb56dae6186afdf8e77d4770c8c9f2cbb Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 12:52:49 +0200 Subject: [PATCH 12/17] Resive `org.graalvm.component.installer.test` config. --- .../jre/languages/ruby/native-image.properties | 1 - .../repo/19.3.0.0/r/jre/languages/R/native-image.properties | 4 ++-- .../19.3.0.0/ruby/jre/languages/ruby/native-image.properties | 5 +---- .../1.1.0.0/jre/languages/ruby/native-image.properties | 5 +---- .../1.0.0.0/jre/languages/python/native-image.properties | 5 +---- .../1.0.1.0/jre/languages/python/native-image.properties | 5 +---- .../1.1.0.0/jre/languages/python/native-image.properties | 5 +---- .../repo/r/1.0.1.0/jre/languages/R/native-image.properties | 4 ++-- .../repo/r/1.1.0.0/jre/languages/R/native-image.properties | 4 ++-- .../ruby/1.0.1.0/jre/languages/ruby/native-image.properties | 5 +---- .../ruby/1.0.1.1/jre/languages/ruby/native-image.properties | 5 +---- .../ruby/1.1.0.0/jre/languages/ruby/native-image.properties | 5 +---- .../1.1.0_1.0/jre/languages/ruby/native-image.properties | 5 +---- 13 files changed, 15 insertions(+), 43 deletions(-) diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/llvm-toolchain/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/llvm-toolchain/jre/languages/ruby/native-image.properties index d6c0a2b243ba..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/llvm-toolchain/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/llvm-toolchain/jre/languages/ruby/native-image.properties @@ -9,7 +9,6 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties index 86648792e292..0b896fe5ce53 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/r/jre/languages/R/native-image.properties @@ -19,10 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ +Args = --enable-http \ -H:MaxRuntimeCompileMethods=8000 \ + -H:+UnlockExperimentalVMOptions \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ - -H:EnableURLProtocols=http \ -H:-UseServiceLoaderFeature \ -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties index 582d6b2853a9..2492501f8012 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties @@ -10,7 +10,4 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=7000 \ - -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json \ - -H:-UnlockExperimentalVMOptions +Args = -H:MaxRuntimeCompileMethods=7000 \ diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties index 582d6b2853a9..2492501f8012 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.1.0/jre/languages/python/native-image.properties @@ -10,7 +10,4 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=7000 \ - -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json \ - -H:-UnlockExperimentalVMOptions +Args = -H:MaxRuntimeCompileMethods=7000 \ diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties index d334bd29d688..bb816bb158d7 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.1.0.0/jre/languages/python/native-image.properties @@ -10,7 +10,4 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=7000 \ - -H:SubstitutionResources=com/oracle/graal/python/aot/substitutions.json - -H:-UnlockExperimentalVMOptions +Args = -H:MaxRuntimeCompileMethods=7000 diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties index 86648792e292..0b896fe5ce53 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.0.1.0/jre/languages/R/native-image.properties @@ -19,10 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ +Args = --enable-http \ -H:MaxRuntimeCompileMethods=8000 \ + -H:+UnlockExperimentalVMOptions \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ - -H:EnableURLProtocols=http \ -H:-UseServiceLoaderFeature \ -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties index 86648792e292..0b896fe5ce53 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/r/1.1.0.0/jre/languages/R/native-image.properties @@ -19,10 +19,10 @@ JavaArgs = \ LauncherClass = com.oracle.truffle.r.launcher.RMain LauncherClassPath = lib/graalvm/launcher-common.jar:languages/R/fastr-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ +Args = --enable-http \ -H:MaxRuntimeCompileMethods=8000 \ + -H:+UnlockExperimentalVMOptions \ -H:-TruffleCheckFrameImplementation \ -H:+TruffleCheckNeverPartOfCompilation \ - -H:EnableURLProtocols=http \ -H:-UseServiceLoaderFeature \ -H:-UnlockExperimentalVMOptions diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties index 4d95f357a226..a1dc636c5d54 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties @@ -8,11 +8,8 @@ Requires = tool:truffle tool:nfi LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar -Args = -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=5400 \ - -H:SubstitutionResources=org/truffleruby/aot/substitutions.json \ +Args = -H:MaxRuntimeCompileMethods=5400 \ -H:+AddAllCharsets \ - -H:-UnlockExperimentalVMOptions JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs From 72261953d4f7a86cd2d25573d8c905c230275f99 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 15:05:14 +0200 Subject: [PATCH 13/17] Move `com.oracle.svm.test` config files. --- .../native-image/{ => com.oracle.svm.test}/proxy-config.json | 0 .../native-image/{ => com.oracle.svm.test}/reflect-config.json | 0 .../{ => com.oracle.svm.test}/serialization-config.json | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename substratevm/src/com.oracle.svm.test/src/META-INF/native-image/{ => com.oracle.svm.test}/proxy-config.json (100%) rename substratevm/src/com.oracle.svm.test/src/META-INF/native-image/{ => com.oracle.svm.test}/reflect-config.json (100%) rename substratevm/src/com.oracle.svm.test/src/META-INF/native-image/{ => com.oracle.svm.test}/serialization-config.json (100%) diff --git a/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/proxy-config.json b/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/proxy-config.json similarity index 100% rename from substratevm/src/com.oracle.svm.test/src/META-INF/native-image/proxy-config.json rename to substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/proxy-config.json diff --git a/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/reflect-config.json b/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/reflect-config.json similarity index 100% rename from substratevm/src/com.oracle.svm.test/src/META-INF/native-image/reflect-config.json rename to substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/reflect-config.json diff --git a/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/serialization-config.json b/substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/serialization-config.json similarity index 100% rename from substratevm/src/com.oracle.svm.test/src/META-INF/native-image/serialization-config.json rename to substratevm/src/com.oracle.svm.test/src/META-INF/native-image/com.oracle.svm.test/serialization-config.json From d353fb5b0faf7a7945b361b9779556ac3491828e Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 9 Aug 2023 17:03:07 +0200 Subject: [PATCH 14/17] Use `UnlockExperimentalVMOptions` in jsonnet. --- substratevm/ci/ci_common/svm-gate.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substratevm/ci/ci_common/svm-gate.libsonnet b/substratevm/ci/ci_common/svm-gate.libsonnet index 62a9d9b9cbb9..3c06acd8d20e 100644 --- a/substratevm/ci/ci_common/svm-gate.libsonnet +++ b/substratevm/ci/ci_common/svm-gate.libsonnet @@ -86,7 +86,7 @@ use_llvm:: task_spec({ mxgate_config+::["llvm"], - mxgate_extra_args+: ["--extra-image-builder-arguments=-H:CompilerBackend=llvm"], + mxgate_extra_args+: ["--extra-image-builder-arguments=-H:+UnlockExperimentalVMOptions -H:CompilerBackend=llvm -H:-UnlockExperimentalVMOptions"], }), use_ecj:: task_spec({ From d9b4bc54ef82ffe65f5af96d719dbeef7a4e13fa Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 10 Aug 2023 13:40:09 +0200 Subject: [PATCH 15/17] Drop trailing `\` in properties files. --- regex/mx.regex/native-image.properties | 2 +- .../native-image/org.graalvm.launcher/native-image.properties | 2 +- substratevm/mx.substratevm/language-nfi.properties | 2 +- substratevm/mx.substratevm/macro-truffle.properties | 2 +- .../src/META-INF/native-image/native-image.properties | 2 +- .../org.graalvm.truffle.runtime.svm/native-image.properties | 2 +- sulong/mx.sulong/native-image.properties | 2 +- tools/mx.tools/tools-dap.properties | 4 +--- .../native-image.properties | 2 +- .../org.graalvm.truffle.runtime/native-image.properties | 4 ++-- .../src/META-INF/native-image/native-image.properties | 2 +- vm/mx.vm/language-pmh.properties | 2 +- .../19.3.0.0/ruby/jre/languages/ruby/native-image.properties | 2 +- .../1.1.0.0/jre/languages/ruby/native-image.properties | 2 +- .../1.0.0.0/jre/languages/python/native-image.properties | 2 +- .../ruby/1.0.1.0/jre/languages/ruby/native-image.properties | 2 +- .../ruby/1.0.1.1/jre/languages/ruby/native-image.properties | 2 +- .../ruby/1.1.0.0/jre/languages/ruby/native-image.properties | 2 +- .../ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties | 2 +- wasm/mx.wasm/native-image.properties | 3 +-- 20 files changed, 21 insertions(+), 24 deletions(-) diff --git a/regex/mx.regex/native-image.properties b/regex/mx.regex/native-image.properties index 4aeebcb63f21..9894fd9f90d8 100644 --- a/regex/mx.regex/native-image.properties +++ b/regex/mx.regex/native-image.properties @@ -3,4 +3,4 @@ ExcludeFromAll=true Requires = language:icu4j Args = --initialize-at-build-time=com.oracle.truffle.regex \ - -H:MaxRuntimeCompileMethods=900 \ + -H:MaxRuntimeCompileMethods=900 diff --git a/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties b/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties index b2d72f1f38aa..0fe24e7303ff 100644 --- a/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties +++ b/sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties @@ -1,3 +1,3 @@ Args = --add-exports=java.base/jdk.internal.module=ALL-UNNAMED \ --features=org.graalvm.launcher.JLine3FeatureModuleAccessFeature \ - --initialize-at-build-time=org.graalvm.launcher,org.graalvm.shadowed.org.jline \ + --initialize-at-build-time=org.graalvm.launcher,org.graalvm.shadowed.org.jline diff --git a/substratevm/mx.substratevm/language-nfi.properties b/substratevm/mx.substratevm/language-nfi.properties index 51c5c65cde4e..1b7fcde4eff1 100644 --- a/substratevm/mx.substratevm/language-nfi.properties +++ b/substratevm/mx.substratevm/language-nfi.properties @@ -6,7 +6,7 @@ Args = --features=com.oracle.svm.truffle.nfi.TruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.posix.PosixTruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.windows.WindowsTruffleNFIFeature \ -H:CLibraryPath=${.}/builder/clibraries-${*} \ - -H:MaxRuntimeCompileMethods=600 \ + -H:MaxRuntimeCompileMethods=600 ImageClasspath = ${.}/truffle-nfi.jar:${.}/truffle-nfi-${*}.jar diff --git a/substratevm/mx.substratevm/macro-truffle.properties b/substratevm/mx.substratevm/macro-truffle.properties index 620f1b12ef4f..84adbdb32a12 100644 --- a/substratevm/mx.substratevm/macro-truffle.properties +++ b/substratevm/mx.substratevm/macro-truffle.properties @@ -12,7 +12,7 @@ Args = --features=com.oracle.svm.truffle.TruffleFeature \ --initialize-at-build-time=org.graalvm.shadowed.org.jline,org.graalvm.shadowed.org.fusesource.jansi \ --initialize-at-run-time=sun.rmi \ --initialize-at-run-time=java.rmi \ - -H:MaxRuntimeCompileMethods=2500 \ + -H:MaxRuntimeCompileMethods=2500 # The `--add-exports` are a temporary solution for languages on classpath, will be fixed by languages modularization, GR-44217. JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleRuntime \ diff --git a/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties index b0a75f117b16..667fe86268ab 100644 --- a/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties +++ b/substratevm/src/com.oracle.svm.configure.test/src/META-INF/native-image/native-image.properties @@ -1,3 +1,3 @@ Args = \ --add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED \ - --add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.util.json=ALL-UNNAMED \ + --add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.util.json=ALL-UNNAMED diff --git a/substratevm/src/com.oracle.svm.truffle/src/META-INF/native-image/org.graalvm.truffle.runtime.svm/native-image.properties b/substratevm/src/com.oracle.svm.truffle/src/META-INF/native-image/org.graalvm.truffle.runtime.svm/native-image.properties index fc017a5c5f6d..29289651f840 100644 --- a/substratevm/src/com.oracle.svm.truffle/src/META-INF/native-image/org.graalvm.truffle.runtime.svm/native-image.properties +++ b/substratevm/src/com.oracle.svm.truffle/src/META-INF/native-image/org.graalvm.truffle.runtime.svm/native-image.properties @@ -1,4 +1,4 @@ Args = --add-opens=org.graalvm.polyglot/org.graalvm.polyglot=org.graalvm.truffle \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=org.graalvm.truffle.runtime.svm \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=org.graalvm.truffle.runtime.svm \ - --add-exports=java.base/jdk.internal.misc=org.graalvm.truffle.runtime.svm \ + --add-exports=java.base/jdk.internal.misc=org.graalvm.truffle.runtime.svm diff --git a/sulong/mx.sulong/native-image.properties b/sulong/mx.sulong/native-image.properties index 1e684b49887e..a0a5a10312fe 100644 --- a/sulong/mx.sulong/native-image.properties +++ b/sulong/mx.sulong/native-image.properties @@ -5,4 +5,4 @@ Requires = language:nfi language:antlr4 Args = --initialize-at-build-time=com.oracle.truffle.llvm,org.antlr.v4.runtime \ -H:MaxRuntimeCompileMethods=10000 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets diff --git a/tools/mx.tools/tools-dap.properties b/tools/mx.tools/tools-dap.properties index 837dca9c66e3..f00d3e764608 100644 --- a/tools/mx.tools/tools-dap.properties +++ b/tools/mx.tools/tools-dap.properties @@ -1,5 +1,3 @@ Requires = macro:truffle language:truffle-json Args = --initialize-at-build-time=com.oracle.truffle.tools.dap \ - -H:+UnlockExperimentalVMOptions \ - -H:MaxRuntimeCompileMethods=100 \ - -H:-UnlockExperimentalVMOptions + -H:MaxRuntimeCompileMethods=100 diff --git a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties index 23e884ec35e0..4718a0cae742 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties +++ b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/META-INF/native-image/com.oracle.truffle.truffle_nfi_libffi/native-image.properties @@ -1,4 +1,4 @@ Args = --features=com.oracle.svm.truffle.nfi.TruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.posix.PosixTruffleNFIFeature \ --features=com.oracle.svm.truffle.nfi.windows.WindowsTruffleNFIFeature \ - -H:MaxRuntimeCompileMethods=600 \ + -H:MaxRuntimeCompileMethods=600 diff --git a/truffle/src/com.oracle.truffle.runtime/src/META-INF/native-image/org.graalvm.truffle.runtime/native-image.properties b/truffle/src/com.oracle.truffle.runtime/src/META-INF/native-image/org.graalvm.truffle.runtime/native-image.properties index e18fbaabe7a5..15235cfbeb46 100644 --- a/truffle/src/com.oracle.truffle.runtime/src/META-INF/native-image/org.graalvm.truffle.runtime/native-image.properties +++ b/truffle/src/com.oracle.truffle.runtime/src/META-INF/native-image/org.graalvm.truffle.runtime/native-image.properties @@ -1,7 +1,7 @@ Args = --macro:truffle-svm \ --features=com.oracle.svm.truffle.TruffleFeature \ --features=com.oracle.svm.truffle.TruffleJFRFeature \ - -H:MaxRuntimeCompileMethods=2500 \ + -H:MaxRuntimeCompileMethods=2500 JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleRuntime \ - -Dgraalvm.ForcePolyglotInvalid=false \ + -Dgraalvm.ForcePolyglotInvalid=false diff --git a/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties index aada40c2565d..7481f61fbcb0 100644 --- a/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties +++ b/truffle/src/com.oracle.truffle.tck.tests/src/META-INF/native-image/native-image.properties @@ -1,2 +1,2 @@ Args = --initialize-at-build-time=org.hamcrest,org.junit \ - --features=com.oracle.truffle.tck.tests.TruffleTCKFeature \ + --features=com.oracle.truffle.tck.tests.TruffleTCKFeature diff --git a/vm/mx.vm/language-pmh.properties b/vm/mx.vm/language-pmh.properties index 75237a9580a2..04e9bacdde4c 100644 --- a/vm/mx.vm/language-pmh.properties +++ b/vm/mx.vm/language-pmh.properties @@ -1,4 +1,4 @@ Requires = language:nfi Args = --initialize-at-build-time=org.graalvm.polybench \ - -H:MaxRuntimeCompileMethods=2000 \ + -H:MaxRuntimeCompileMethods=2000 diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/19.3.0.0/ruby/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/llvm-toolchain/1.1.0.0/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties index 2492501f8012..bb816bb158d7 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/python/1.0.0.0/jre/languages/python/native-image.properties @@ -10,4 +10,4 @@ LauncherClassPath = lib/graalvm/launcher-common.jar:lib/graalvm/graalpython-laun JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=python -Args = -H:MaxRuntimeCompileMethods=7000 \ +Args = -H:MaxRuntimeCompileMethods=7000 diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.0/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.0.1.1/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0.0/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties index a1dc636c5d54..69c2e64ac39f 100644 --- a/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties +++ b/vm/src/org.graalvm.component.installer.test/src/org/graalvm/component/installer/repo/ruby/1.1.0_1.0/jre/languages/ruby/native-image.properties @@ -9,7 +9,7 @@ LauncherClass = org.truffleruby.launcher.RubyLauncher LauncherClassPath = languages/ruby/truffleruby-annotations.jar:languages/ruby/truffleruby-shared.jar:lib/graalvm/launcher-common.jar:lib/graalvm/truffleruby-launcher.jar Args = -H:MaxRuntimeCompileMethods=5400 \ - -H:+AddAllCharsets \ + -H:+AddAllCharsets JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \ -Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs diff --git a/wasm/mx.wasm/native-image.properties b/wasm/mx.wasm/native-image.properties index fb226a2a837f..d9d75fb49211 100644 --- a/wasm/mx.wasm/native-image.properties +++ b/wasm/mx.wasm/native-image.properties @@ -1,5 +1,4 @@ # This file contains native-image arguments needed to build graal-wasm Args = --initialize-at-build-time=org.graalvm.wasm \ - -H:MaxRuntimeCompileMethods=2000 \ - \ No newline at end of file + -H:MaxRuntimeCompileMethods=2000 From fe48b27418ef09f5689186cab2f9b9303f371edc Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 10 Aug 2023 13:44:38 +0200 Subject: [PATCH 16/17] `-H:+StripDebugInfo` is used by default if available. --- sdk/mx.sdk/mx_sdk_vm_impl.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/mx.sdk/mx_sdk_vm_impl.py b/sdk/mx.sdk/mx_sdk_vm_impl.py index 256f69d3c859..06ba552ea8b3 100644 --- a/sdk/mx.sdk/mx_sdk_vm_impl.py +++ b/sdk/mx.sdk/mx_sdk_vm_impl.py @@ -1198,8 +1198,6 @@ def separate_debuginfo_ext(self): def get_debug_flags(self, image_config): assert self.is_debug_supported() flags = ['-g'] - if self.generate_separate_debug_info(image_config): - flags += svm_experimental_options(['-H:+StripDebugInfo']) return flags From 9f9b2a006ddf2a8e35b4f4712ff752821cb45c4d Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 10 Aug 2023 18:54:18 +0200 Subject: [PATCH 17/17] Add changelog entry. --- substratevm/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/substratevm/CHANGELOG.md b/substratevm/CHANGELOG.md index 33f0dc723366..01abb6d5dba0 100644 --- a/substratevm/CHANGELOG.md +++ b/substratevm/CHANGELOG.md @@ -15,6 +15,7 @@ This changelog summarizes major changes to GraalVM Native Image. * (GR-46064) Add option `-H:±IndirectBranchTargetMarker` to mark indirect branch targets on AMD64 with an endbranch instruction. This is a prerequisite for future Intel CET support. * (GR-46740) Add support for foreign downcalls (part of "Project Panama") on the AMD64 platform. * (GR-27034) Add `-H:ImageBuildID` option to generate Image Build ID, which is a 128-bit UUID string generated randomly, once per bundle or digest of input args when bundles are not used. +* (GR-47647) Add `-H:±UnlockExperimentalVMOptions` for unlocking access to experimental options similar to HotSpot's `-XX:UnlockExperimentalVMOptions`. Explicit unlocking will be required in a future release, which can be tested with the env setting `NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL=true`. For more details, see [issue #7105](https://github.com/oracle/graal/issues/7105). ## GraalVM for JDK 17 and GraalVM for JDK 20 (Internal Version 23.0.0) * (GR-40187) Report invalid use of SVM specific classes on image class- or module-path as error. As a temporary workaround, `-H:+AllowDeprecatedBuilderClassesOnImageClasspath` allows turning the error into a warning.