Skip to content

Commit 721466c

Browse files
committed
Deprecate --report-usupported-elements-at-runtime
The option is now enabled by default.
1 parent ee40fc1 commit 721466c

File tree

4 files changed

+13
-23
lines changed

4 files changed

+13
-23
lines changed

docs/reference-manual/native-image/BuildOptions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Run `native-image --help` for help on build options.
6969
* `--pgo`: provide a comma-separated list of files from which to read the data collected for Profile-guided optimization of AOT-compiled code (reads from _default.iprof_ if nothing is specified). Each file must contain a single `PGOProfiles` object, serialized in JSON format, optionally compressed by gzip. (Not available in GraalVM Community Edition.)
7070
* `--pgo-instrument`: instrument AOT-compiled code to collect data for Profile-guided optimization into the _default.iprof_ file. (Not available in GraalVM Community Edition.)
7171
* `--pgo-sampling`: perform profiling by sampling the AOT compiled code to collect data for Profile-guided optimization. (Not available in GraalVM Community Edition.)
72-
* `--report-unsupported-elements-at-runtime`: report the usage of unsupported methods and fields at run time when they are accessed the first time, instead of an error during executable's building
7372
* `--shared`: build a shared library
7473
* `--silent`: silence build output
7574
* `--static`: build a statically-linked executable (requires `libc` and `zlib` static libraries)

substratevm/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This changelog summarizes major changes to GraalVM Native Image.
1919
* (GR-52534) Change the digest (used e.g. for symbol names) from SHA-1 encoded as a hex string (40 bytes) to 128-bit Murmur3 as a Base-62 string (22 bytes).
2020
* (GR-52578) Print information about embedded resources into `embedded-resources.json` using the `-H:+GenerateEmbeddedResourcesFile` option.
2121
* (GR-51172) Add support to catch OutOfMemoryError exceptions on native image if there is no memory left.
22+
* (GR-43837) `--report-unsupported-elements-at-runtime` is now enabled by default and the option is deprecated.
2223

2324
## GraalVM for JDK 22 (Internal Version 24.0.0)
2425
* (GR-48304) Red Hat added support for the JFR event ThreadAllocationStatistics.

substratevm/mx.substratevm/mx_substratevm_benchmark.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ def list_jars(path):
7777
io.netty.util.internal.PlatformDependent0,io.netty.util,io.netty.bootstrap,io.netty.channel,io.netty.buffer,io.netty.resolver,io.netty.handler.codec.CodecOutputList'
7878
_RENAISSANCE_EXTRA_IMAGE_BUILD_ARGS = {
7979
'als' : [
80-
'--report-unsupported-elements-at-runtime',
8180
force_buildtime_init_slf4j_1_7_73,
8281
force_runtime_init_netty_4_1_72
8382
],
8483
'chi-square' : [
85-
'--report-unsupported-elements-at-runtime',
8684
force_buildtime_init_slf4j_1_7_73,
8785
force_buildtime_init_slf4j_1_7_73_spark,
8886
force_buildtime_init_netty_4_1_72,
@@ -99,12 +97,10 @@ def list_jars(path):
9997
force_runtime_init_netty_4_1_72
10098
],
10199
'log-regression' : [
102-
'--report-unsupported-elements-at-runtime',
103100
force_buildtime_init_slf4j_1_7_73,
104101
force_runtime_init_netty_4_1_72
105102
],
106103
'movie-lens' : [
107-
'--report-unsupported-elements-at-runtime',
108104
force_buildtime_init_slf4j_1_7_73,
109105
force_buildtime_init_slf4j_1_7_73_spark,
110106
force_buildtime_init_netty_4_1_72,
@@ -114,12 +110,10 @@ def list_jars(path):
114110
'-H:ReflectionConfigurationFiles=' + movie_lens_reflection_config
115111
],
116112
'dec-tree' : [
117-
'--report-unsupported-elements-at-runtime',
118113
force_buildtime_init_slf4j_1_7_73,
119114
force_runtime_init_netty_4_1_72
120115
],
121116
'page-rank' : [
122-
'--report-unsupported-elements-at-runtime',
123117
force_buildtime_init_slf4j_1_7_73,
124118
force_buildtime_init_slf4j_1_7_73_spark,
125119
force_buildtime_init_netty_4_1_72,
@@ -128,12 +122,10 @@ def list_jars(path):
128122
force_runtime_init_slf4j_1_7_73
129123
],
130124
'naive-bayes' : [
131-
'--report-unsupported-elements-at-runtime',
132125
force_buildtime_init_slf4j_1_7_73,
133126
force_runtime_init_netty_4_1_72
134127
],
135128
'gauss-mix' : [
136-
'--report-unsupported-elements-at-runtime',
137129
force_buildtime_init_slf4j_1_7_73,
138130
force_buildtime_init_slf4j_1_7_73_spark,
139131
force_buildtime_init_netty_4_1_72,
@@ -142,7 +134,6 @@ def list_jars(path):
142134
force_runtime_init_slf4j_1_7_73
143135
],
144136
'neo4j-analytics': [
145-
'--report-unsupported-elements-at-runtime',
146137
force_buildtime_init_slf4j_1_7_73,
147138
force_runtime_init_netty_4_1_72
148139
],
@@ -352,8 +343,7 @@ def _empty_file():
352343
'pmd': [],
353344
# org.apache.crimson.parser.Parser2 is force initialized at build-time due to non-determinism in class initialization
354345
# order that can lead to runtime issues. See GR-26324.
355-
'xalan': ['--report-unsupported-elements-at-runtime',
356-
'--initialize-at-build-time=org.apache.crimson.parser.Parser2,org.apache.crimson.parser.Parser2$Catalog,org.apache.crimson.parser.Parser2$NullHandler,org.apache.xml.utils.res.CharArrayWrapper'],
346+
'xalan': ['--initialize-at-build-time=org.apache.crimson.parser.Parser2,org.apache.crimson.parser.Parser2$Catalog,org.apache.crimson.parser.Parser2$NullHandler,org.apache.xml.utils.res.CharArrayWrapper'],
357347
# There are two main issues with fop:
358348
# 1. LoggingFeature is enabled by default, causing the LogManager configuration to be parsed at build-time. However
359349
# DaCapo Harness sets the `java.util.logging.config.file` property at run-time. Therefore, we set
@@ -362,8 +352,7 @@ def _empty_file():
362352
# not exist and would fail the benchmark when assertions are enabled.
363353
# 2. Native-image picks a different service provider than the JVM for javax.xml.transform.TransformerFactory.
364354
# We can simply remove the jar containing that provider as it is not required for the benchmark to run.
365-
'fop': ['--report-unsupported-elements-at-runtime',
366-
f"-Djava.util.logging.config.file={_empty_file()}",
355+
'fop': [f"-Djava.util.logging.config.file={_empty_file()}",
367356
'--initialize-at-run-time=org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList'],
368357
'batik': []
369358
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,7 @@
3333
import java.util.Date;
3434
import java.util.concurrent.ForkJoinPool;
3535

36-
import com.oracle.svm.util.LogUtils;
3736
import org.graalvm.collections.EconomicMap;
38-
import jdk.graal.compiler.options.Option;
39-
import jdk.graal.compiler.options.OptionKey;
40-
import jdk.graal.compiler.options.OptionStability;
41-
import jdk.graal.compiler.options.OptionValues;
42-
import jdk.graal.compiler.serviceprovider.GraalServices;
4337

4438
import com.oracle.graal.pointsto.reports.ReportUtils;
4539
import com.oracle.svm.core.SubstrateOptions;
@@ -52,8 +46,15 @@
5246
import com.oracle.svm.core.util.UserError;
5347
import com.oracle.svm.hosted.classinitialization.ClassInitializationOptions;
5448
import com.oracle.svm.hosted.util.CPUType;
49+
import com.oracle.svm.util.LogUtils;
5550
import com.oracle.svm.util.StringUtil;
5651

52+
import jdk.graal.compiler.options.Option;
53+
import jdk.graal.compiler.options.OptionKey;
54+
import jdk.graal.compiler.options.OptionStability;
55+
import jdk.graal.compiler.options.OptionValues;
56+
import jdk.graal.compiler.serviceprovider.GraalServices;
57+
5758
public class NativeImageOptions {
5859

5960
public static final int DEFAULT_MAX_ANALYSIS_SCALING = 16;
@@ -142,9 +143,9 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
142143
@Option(help = "Allow MethodTypeFlow to see @Fold methods")//
143144
public static final HostedOptionKey<Boolean> AllowFoldMethods = new HostedOptionKey<>(false);
144145

145-
@APIOption(name = "report-unsupported-elements-at-runtime")//
146-
@Option(help = "Report usage of unsupported methods and fields at run time when they are accessed the first time, instead of as an error during image building", type = User)//
147-
public static final HostedOptionKey<Boolean> ReportUnsupportedElementsAtRuntime = new HostedOptionKey<>(false);
146+
@APIOption(name = "report-unsupported-elements-at-runtime", deprecated = "The flag is not needed anymore as usage of unsupported elements is now reported at run time by default.")//
147+
@Option(help = "Report usage of unsupported methods and fields at run time when they are accessed the first time, instead of as an error during image building", type = Debug)//
148+
public static final HostedOptionKey<Boolean> ReportUnsupportedElementsAtRuntime = new HostedOptionKey<>(true);
148149

149150
@APIOption(name = "allow-incomplete-classpath", deprecated = "Allowing an incomplete classpath is now the default. Use --link-at-build-time to report linking errors at image build time for a class or package.")//
150151
@Option(help = "Deprecated", type = User)//

0 commit comments

Comments
 (0)