diff --git a/docs/reference-manual/native-image/AutomaticMetadataCollection.md b/docs/reference-manual/native-image/AutomaticMetadataCollection.md index 70994606b288..1485b28780a5 100644 --- a/docs/reference-manual/native-image/AutomaticMetadataCollection.md +++ b/docs/reference-manual/native-image/AutomaticMetadataCollection.md @@ -20,7 +20,7 @@ To learn how to compute dynamic feature calls in code, see [Reachability Metadat * [Tracing Agent](#tracing-agent) * [Conditional Metadata Collection](#conditional-metadata-collection) * [Agent Advanced Usage](#agent-advanced-usage) -* [Native Image Configure Tool](#native-image-configure-tool) +* [Native Image Utils Tool](#native-image-utils-tool) ## Tracing Agent @@ -160,10 +160,10 @@ However, for a better understanding of the execution, the agent can also write a $JAVA_HOME/bin/java -agentlib:native-image-agent=trace-output=/path/to/trace-file.json ... ``` -The `native-image-configure` tool can transform trace files to configuration files. +The `native-image-utils` tool can transform trace files to configuration files. The following command reads and processes `trace-file.json` and generates a set of configuration files in the directory `/path/to/config-dir/`: ```shell -native-image-configure generate --trace-input=/path/to/trace-file.json --output-dir=/path/to/config-dir/ +native-image-utils generate --trace-input=/path/to/trace-file.json --output-dir=/path/to/config-dir/ ``` ### Interoperability @@ -179,16 +179,16 @@ In this case, it is necessary to provide the absolute path of the agent: The agent has options which are currently experimental and might be enabled in future releases, but can also be changed or removed entirely. See the [ExperimentalAgentOptions.md](ExperimentalAgentOptions.md) guide. -## Native Image Configure Tool +## Native Image Utils Tool When using the agent in multiple processes at the same time as described in the previous section, `config-output-dir` is a safe option, but it results in multiple sets of configuration files. -The `native-image-configure` tool can be used to merge these configuration files: +The `native-image-utils` tool can be used to merge these configuration files: ```shell -native-image-configure generate --input-dir=/path/to/config-dir-0/ --input-dir=/path/to/config-dir-1/ --output-dir=/path/to/merged-config-dir/ +native-image-utils generate --input-dir=/path/to/config-dir-0/ --input-dir=/path/to/config-dir-1/ --output-dir=/path/to/merged-config-dir/ ``` This command reads one set of configuration files from `/path/to/config-dir-0/` and another from `/path/to/config-dir-1/` and then writes a set of configuration files that contains both of their information to `/path/to/merged-config-dir/`. -An arbitrary number of `--input-dir` arguments with sets of configuration files can be specified. See `native-image-configure help` for all options. +An arbitrary number of `--input-dir` arguments with sets of configuration files can be specified. See `native-image-utils help` for all options. ### Further Reading diff --git a/docs/reference-manual/native-image/BuildOutput.md b/docs/reference-manual/native-image/BuildOutput.md index c4a221bc4c6e..bf00d2431282 100644 --- a/docs/reference-manual/native-image/BuildOutput.md +++ b/docs/reference-manual/native-image/BuildOutput.md @@ -343,7 +343,7 @@ Advanced obfuscation is applied to your application code and third-party depende * Names of annotations, lambdas, and proxies To export a mapping from original to obfuscated names, use `-H:AdvancedObfuscation=export-mapping`. -Use the mapping file and the `native-image-configure deobfuscate` command to deobfuscate stack traces. +Use the mapping file and the `native-image-utils deobfuscate` command to deobfuscate stack traces. See the [build report](BuildReport.md) for summary statistics, such as the percentage of class and method names that were obfuscated. For more information, see [Advanced Obfuscation in Native Image](../../security/Obfuscation.md). diff --git a/docs/reference-manual/native-image/ExperimentalAgentOptions.md b/docs/reference-manual/native-image/ExperimentalAgentOptions.md index c7d5daeb935a..682e8bafeb0a 100644 --- a/docs/reference-manual/native-image/ExperimentalAgentOptions.md +++ b/docs/reference-manual/native-image/ExperimentalAgentOptions.md @@ -63,11 +63,10 @@ To further filter the generated configuration, you can use `conditional-config-c ### Generating Conditional Configuration From Multiple Agent Runs Conditional configuration can be generated from multiple agent runs that reach different code paths in the application. -Each agent run produces configuration with metadata. `native-image-configure` is then used to merge the collected data and produce a conditional configuration. -To run the agent in this mode, add `experimental-conditional-config-part` to the agent's command line. -Once all the agent runs have finished, you can generate a conditional configuration by invoking: +Each agent run produces configuration with metadata. After all agent runs have finished, you can use `native-image-utils` is then used to merge the collected data and produce a conditional configuration. +To generate a conditional configuration, invoke: ```shell -native-image-configure generate-conditional --user-code-filter= --class-name-filter= --input-dir= --input-dir= ... --output-dir= +native-image-utils generate-conditional --user-code-filter= --class-name-filter= --input-dir= --input-dir= ... --output-dir= ``` where: - `--user-code-filter=`: path to an agent filter file that specifies user classes diff --git a/docs/reference-manual/native-image/InspectTool.md b/docs/reference-manual/native-image/InspectTool.md index 9a9c363338ba..523f5d9a210b 100644 --- a/docs/reference-manual/native-image/InspectTool.md +++ b/docs/reference-manual/native-image/InspectTool.md @@ -10,7 +10,7 @@ redirect_from: /reference-manual/native-image/inspect/ > **The Native Image Inspect Tool is deprecated and will be removed in a future release**. To extract embedded SBOMs, use: > ```bash -> $JAVA_HOME/bin/native-image-configure extract-sbom --image-path= +> $JAVA_HOME/bin/native-image-utils extract-sbom --image-path= > ``` The Native Image Inspect Tool extracts embedded Software Bill of Materials (SBOM) from native executables. The functionality for extracting class-level metadata is no longer supported. diff --git a/docs/reference-manual/native-image/PGO-Merging-Profiles.md b/docs/reference-manual/native-image/PGO-Merging-Profiles.md index d5c488acbbda..3cbb52b1ccd9 100644 --- a/docs/reference-manual/native-image/PGO-Merging-Profiles.md +++ b/docs/reference-manual/native-image/PGO-Merging-Profiles.md @@ -7,23 +7,23 @@ permalink: /reference-manual/native-image/optimizations-and-performance/PGO/merg # Merging Profiles from Multiple Sources -The PGO infrastructure enables you to combine multiple profiles into a single one using the [Native Image Configure Tool](AutomaticMetadataCollection.md#native-image-configure-tool). +The PGO infrastructure enables you to combine multiple profiles into a single one using the [Native Image Utils Tool](AutomaticMetadataCollection.md#native-image-utils-tool). Merging profiles implies that the resulting profile will contain the union of all types, methods, and profile entries from the provided profiles. ## Usage To merge two profiles, _profile_1.iprof_ and _profile_2.iprof_, into a single file named _output_profile.iprof_, use the following command: ```bash -native-image-configure merge-pgo-profiles --input-file=profile_1.iprof --input-file=profile_2.iprof --output-file=output_profile.iprof +native-image-utils merge-pgo-profiles --input-file=profile_1.iprof --input-file=profile_2.iprof --output-file=output_profile.iprof ``` There is also a way to specify a directory as a source of profiles using the `--input-dir=` option. Then it only searches for profiles in the given directory, excluding subdirectories. ```bash -native-image-configure merge-pgo-profiles --input-dir=my_profiles/ --output-file=output_profile.iprof +native-image-utils merge-pgo-profiles --input-dir=my_profiles/ --output-file=output_profile.iprof ``` ### Further Reading * [Basic Usage of Profile-Guided Optimization](PGO-Basic-Usage.md) -* [Native Image Configure Tool](AutomaticMetadataCollection.md#native-image-configure-tool) \ No newline at end of file +* [Native Image Utils Tool](AutomaticMetadataCollection.md#native-image-utils-tool) \ No newline at end of file diff --git a/docs/reference-manual/native-image/guides/use-sbom-support.md b/docs/reference-manual/native-image/guides/use-sbom-support.md index 613712008098..02a34cc42d9d 100644 --- a/docs/reference-manual/native-image/guides/use-sbom-support.md +++ b/docs/reference-manual/native-image/guides/use-sbom-support.md @@ -54,7 +54,7 @@ For the demo application, you will use the `jwebserver` tool, and package it as There are two possible ways to extract the compressed SBOM contents into a human-readable format: - using [Syft](https://github.com/anchore/syft) -- using the [Native Image Configure Tool](#native-image-configure-tool) +- using the [Native Image Utils Tool](#native-image-utils-tool) ### Syft @@ -68,14 +68,14 @@ syft jwebserver ``` It lists all of the Java libraries included in it. -### Native Image Configure Tool +### Native Image Utils Tool -GraalVM Native Image provides the `native-image-configure` tool to retrieve an SBOM embedded in a native executable. -The Configure Tool is a viable alternative if you prefer not to install `syft`. +GraalVM Native Image provides the `native-image-utils` tool to retrieve an SBOM embedded in a native executable. +The Utils Tool is a viable alternative if you prefer not to install `syft`. -Run the following command to read the SBOM contents using the Configure Tool: +Run the following command to read the SBOM contents using the Utils Tool: ```bash -$JAVA_HOME/bin/native-image-configure extract-sbom --image-path= +$JAVA_HOME/bin/native-image-utils extract-sbom --image-path= ``` To take it further, you can submit the SBOM to any available vulnerability scanner, and check if the recorded libraries have known security vulnerabilities. diff --git a/docs/security/Obfuscation.md b/docs/security/Obfuscation.md index fb2a129f630d..0baabd42b9f0 100644 --- a/docs/security/Obfuscation.md +++ b/docs/security/Obfuscation.md @@ -108,10 +108,10 @@ Obfuscated names are non-deterministic and may vary between builds. ### Deobfuscating Stack Traces -To debug an obfuscated stack trace, save the stack trace to a file (for example, `obfuscated-stacktrace.log`) and use `native-image-configure` with the mapping file: +To debug an obfuscated stack trace, save the stack trace to a file (for example, `obfuscated-stacktrace.log`) and use `native-image-utils` with the mapping file: ```bash -native-image-configure deobfuscate --map-file=app.obfuscation-mapping.json --input-file=obfuscated-stacktrace.log +native-image-utils deobfuscate --map-file=app.obfuscation-mapping.json --input-file=obfuscated-stacktrace.log Exception in thread "main" java.lang.RuntimeException: Something bad happened! at com.obfuscation.SecretClass.secretAlgorithm(SecretClass.java:14) @@ -121,7 +121,7 @@ Exception in thread "main" java.lang.RuntimeException: Something bad happened! This restores the original names for debugging the issue, while keeping your distributed binary obfuscated. Log file lines not part of the stack trace remain unchanged. -You can locate the `native-image-configure` tool in the same `bin` directory as `native-image`. +You can locate the `native-image-utils` tool in the same `bin` directory as `native-image`. ## What Gets Obfuscated @@ -149,7 +149,7 @@ JUnit-related code is automatically preserved for testing compatibility. ## Understanding the Mapping File When you use `export-mapping`, Native Image generates a JSON file named _\.obfuscation-mapping.json_ in your build artifacts. -This file maps original symbol names to their obfuscated versions, allowing `native-image-configure deobfuscate` to reverse the process. +This file maps original symbol names to their obfuscated versions, allowing `native-image-utils deobfuscate` to reverse the process. Mappings can change per build, so associate mapping files with specific build versions or IDs for reliable deobfuscation. The mapping file lists the `[original, obfuscated]` name pairs of modules, packages, source files, types (classes, records, interfaces, enums), and methods. diff --git a/docs/security/SBOM.md b/docs/security/SBOM.md index 0d2780d9e430..0f173f03d37d 100644 --- a/docs/security/SBOM.md +++ b/docs/security/SBOM.md @@ -24,14 +24,14 @@ The SBOM feature can be disabled with `--enable-sbom=false`. ## Extracting SBOM Contents After embedding the compressed SBOM into the image, there are two possible ways to extract the SBOM contents: -- using the [Native Image Configure Tool](#native-image-configure-tool) +- using the [Native Image Utils Tool](#native-image-utils-tool) - using [Syft](https://github.com/anchore/syft){:target="_blank"} -### Native Image Configure Tool +### Native Image Utils Tool -The Native Image Configure Tool can extract the compressed SBOM using the `extract-sbom` command from executables and shared libraries. +The Native Image Utils Tool can extract the compressed SBOM using the `extract-sbom` command from executables and shared libraries. ```bash -$JAVA_HOME/bin/native-image-configure extract-sbom --image-path= +$JAVA_HOME/bin/native-image-utils extract-sbom --image-path= ``` It outputs the contents in the JSON format: @@ -137,9 +137,9 @@ It also integrates with GitHub Actions, GitLab, and Jenkins Pipelines. Another popular command-line scanner is `grype`, part of the [Anchore software supply chain management platform](https://anchore.com/){:target="_blank"}. With `grype`, you can check whether the libraries listed in your SBOMs have known vulnerabilities documented in Anchore's database. -The output of the `native-image-configure` tool can be fed directly into `grype` to scan for vulnerable libraries using the following command: +The output of the `native-image-utils` tool can be fed directly into `grype` to scan for vulnerable libraries using the following command: ```bash -native-image-configure extract-sbom --image-path= | grype +native-image-utils extract-sbom --image-path= | grype ``` It produces the following output: ```shell diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index 49c9aeafaaef..a3cac8d77ad2 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -1020,6 +1020,6 @@ def gen_gc_option_check(args): }) # CE with some skipped native images -ce_unchained_components = ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'lg', 'ni', 'nic', 'nil', 'nr_lib_jvmcicompiler', 'sdkc', 'sdkni', 'snative-image-agent', 'snative-image-diagnostics-agent', 'ssvmjdwp', 'svm', 'svmjdwp', 'svmsl', 'svmt', 'tflc', 'tflsm'] +ce_unchained_components = ['bnative-image', 'bnative-image-utils', 'cmp', 'gvm', 'lg', 'ni', 'nic', 'nil', 'nr_lib_jvmcicompiler', 'sdkc', 'sdkni', 'snative-image-agent', 'snative-image-diagnostics-agent', 'ssvmjdwp', 'svm', 'svmjdwp', 'svmsl', 'svmt', 'tflc', 'tflsm'] mx_sdk_vm.register_vm_config('ce', ce_unchained_components, _suite, env_file='jvm-ce') mx_sdk_vm.register_vm_config('ce', ce_unchained_components, _suite, env_file='jvm-ce-llvm') diff --git a/sdk/mx.sdk/mx_sdk_benchmark.py b/sdk/mx.sdk/mx_sdk_benchmark.py index 3eefef8fa00e..927484ba53dc 100644 --- a/sdk/mx.sdk/mx_sdk_benchmark.py +++ b/sdk/mx.sdk/mx_sdk_benchmark.py @@ -1108,28 +1108,28 @@ def _configure_from_name(self, config_name): self.pgo_instrumentation = True def generate_profiling_package_prefixes(): - # run the native-image-configure tool to gather the jdk package prefixes + # run the native-image-utils tool to gather the jdk package prefixes graalvm_home_bin = os.path.join(mx_sdk_vm.graalvm_home(), 'bin') - native_image_configure_command = mx.cmd_suffix( - os.path.join(graalvm_home_bin, 'native-image-configure')) - if not exists(native_image_configure_command): - mx.abort('Failed to find the native-image-configure command at {}. \nContent {}: \n\t{}'.format( - native_image_configure_command, graalvm_home_bin, + native_image_utils_command = mx.cmd_suffix( + os.path.join(graalvm_home_bin, 'native-image-utils')) + if not exists(native_image_utils_command): + mx.abort('Failed to find the native-image-utils command at {}. \nContent {}: \n\t{}'.format( + native_image_utils_command, graalvm_home_bin, '\n\t'.join(os.listdir(graalvm_home_bin)))) tmp = tempfile.NamedTemporaryFile() - ret = mx.run([native_image_configure_command, 'generate-filters', + ret = mx.run([native_image_utils_command, 'generate-filters', '--include-packages-from-modules=java.base', '--exclude-classes=org.graalvm.**', '--exclude-classes=com.oracle.**', # remove internal packages f'--output-file={tmp.name}'], nonZeroIsFatal=True) if ret != 0: - mx.abort('Native image configure command failed.') + mx.abort('Native image utils command failed.') # format the profiling package prefixes with open(tmp.name, 'r') as f: prefixes = json.loads(f.read()) if 'rules' not in prefixes: - mx.abort('Native image configure command failed. Can not generate rules.') + mx.abort('Native image utils command failed. Can not generate rules.') rules = prefixes['rules'] rules = map(lambda r: r['includeClasses'][:-2], filter(lambda r: 'includeClasses' in r, rules)) return ','.join(rules) @@ -1695,7 +1695,7 @@ def _collect_perf_results_into_iprof(self): else: mx.abort(f"Perf script failed with exit code: {exit_code}") mx.log(f"Started generating iprof at {self.get_stage_runner().get_timestamp()}") - nic_command = [os.path.join(self.home(), 'bin', 'native-image-configure'), 'generate-iprof-from-perf', f'--perf={self.config.perf_script_path}', f'--source-mappings={self.config.source_mappings_path}', f'--output-file={self.config.profile_path}'] + nic_command = [os.path.join(self.home(), 'bin', 'native-image-utils'), 'generate-iprof-from-perf', f'--perf={self.config.perf_script_path}', f'--source-mappings={self.config.source_mappings_path}', f'--output-file={self.config.profile_path}'] if self.pgo_perf_invoke_profile_collection_strategy == PerfInvokeProfileCollectionStrategy.ALL: nic_command += ["--enable-experimental-option=SampledVirtualInvokeProfilesAll"] elif self.pgo_perf_invoke_profile_collection_strategy == PerfInvokeProfileCollectionStrategy.MULTIPLE_CALLEES: diff --git a/substratevm/CHANGELOG.md b/substratevm/CHANGELOG.md index c86763a8d0de..e5e20c3f71a1 100644 --- a/substratevm/CHANGELOG.md +++ b/substratevm/CHANGELOG.md @@ -7,7 +7,8 @@ This changelog summarizes major changes to GraalVM Native Image. * (GR-43070) Add a new API flag `-Werror` to treat warnings as errors. * (GR-69280) Allow use of the `graal.` prefix for options without issuing a warning. * (GR-2092) Add jitdump support for recording run-time compilation metadata for perf (see PerfProfiling.md). Can be enabled with `-g -H:+RuntimeDebugInfo -H:RuntimeDebugInfoFormat=jitdump`. -* (GR-69572) Deprecates the `native-image-inspect` tool. To extract embedded SBOMs, use `native-image-configure extract-sbom --image-path=`. +* (GR-69116) Rename `native-image-configure` tool to `native-image-utils`. +* (GR-69572) Deprecates the `native-image-inspect` tool. To extract embedded SBOMs, use `native-image-utils extract-sbom --image-path=`. * (GR-70136) Add a new tool `--tool:llvm` for the LLVM backend of Native Image. * (GR-68984) Ship the `reachability-metadata-schema.json` together with GraalVM at `/lib/svm/schemas/reachability-metadata-schema.json`. * (GR-68984) Improve the schema to capture detailed constraints about each element in the `reachability-metadata-schema.json`. diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index ec7b80b04345..920618990968 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -598,7 +598,7 @@ def conditional_config_task(native_image): def run_nic_conditional_config_test(agent_path, conditional_config_filter_path): """ Invoke ConfigurationGenerator test methods across multiple runs to produce multiple partial traces, - use native-image-configure to compute the conditional configuration, then compare against the expected + use native-image-utils to compute the conditional configuration, then compare against the expected configuration. """ test_cases = [ @@ -624,7 +624,7 @@ def run_nic_conditional_config_test(agent_path, conditional_config_filter_path): '--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED', 'com.oracle.svm.configure.test.conditionalconfig.PartialConfigurationGenerator#' + test_case]) config_output_dir = join(nic_test_dir, 'config-output') - nic_exe = mx.cmd_suffix(join(mx.JDKConfig(home=mx_sdk_vm_impl.graalvm_output()).home, 'bin', 'native-image-configure')) + nic_exe = mx.cmd_suffix(join(mx.JDKConfig(home=mx_sdk_vm_impl.graalvm_output()).home, 'bin', 'native-image-utils')) nic_command = [nic_exe, 'generate-conditional', '--user-code-filter=' + conditional_config_filter_path, '--class-name-filter=' + conditional_config_filter_path, @@ -1803,7 +1803,7 @@ def prevent_build_path_in_libgraal(): mx_sdk_vm.register_graalvm_component(libsvmjdwp) -def _native_image_configure_extra_jvm_args(): +def _native_image_utils_extra_jvm_args(): packages = ['jdk.graal.compiler/jdk.graal.compiler.phases.common', 'jdk.internal.vm.ci/jdk.vm.ci.meta', 'jdk.internal.vm.ci/jdk.vm.ci.services', 'jdk.graal.compiler/jdk.graal.compiler.core.common.util'] args = ['--add-exports=' + packageName + '=ALL-UNNAMED' for packageName in packages] if not mx_sdk_vm.jdk_enables_jvmci_by_default(get_jdk()): @@ -1823,14 +1823,15 @@ def _native_image_configure_extra_jvm_args(): mx_sdk_vm.LauncherConfig( use_modules='image', main_module='org.graalvm.nativeimage.configure', - destination='bin/', + destination='bin/', + links=['bin/'], # retain the previous name as a symlink jar_distributions=['substratevm:SVM_CONFIGURE'], main_class='com.oracle.svm.configure.ConfigurationTool', build_args=svm_experimental_options([ '-H:-ParseRuntimeOptions', '-H:+TreatAllTypeReachableConditionsAsTypeReached', ]), - extra_jvm_args=_native_image_configure_extra_jvm_args(), + extra_jvm_args=_native_image_utils_extra_jvm_args(), home_finder=False, ) ], @@ -2532,9 +2533,9 @@ def native_image_on_jvm(args, **kwargs): passedArgs += jacoco_args mx.run([executable] + _debug_args() + passedArgs, **kwargs) -@mx.command(suite.name, 'native-image-configure') -def native_image_configure_on_jvm(args, **kwargs): - executable = vm_executable_path('native-image-configure') +@mx.command(suite.name, 'native-image-utils') +def native_image_utils_on_jvm(args, **kwargs): + executable = vm_executable_path('native-image-utils') if not exists(executable): mx.abort("Can not find " + executable + "\nDid you forget to build? Try `mx build`") mx.run([executable] + _debug_args() + args, **kwargs) diff --git a/substratevm/src/com.oracle.svm.agent/src/com/oracle/svm/agent/NativeImageAgent.java b/substratevm/src/com.oracle.svm.agent/src/com/oracle/svm/agent/NativeImageAgent.java index e00e342e6e12..82dfcf1b5e09 100644 --- a/substratevm/src/com.oracle.svm.agent/src/com/oracle/svm/agent/NativeImageAgent.java +++ b/substratevm/src/com.oracle.svm.agent/src/com/oracle/svm/agent/NativeImageAgent.java @@ -317,7 +317,7 @@ protected int onLoadCallback(JNIJavaVM vm, JvmtiEnv jvmti, JvmtiEventCallbacks c "Only one agent instance can safely write to a specific target directory at the same time. " + "Unless file '" + ConfigurationFile.LOCK_FILE_NAME + "' is a leftover from an earlier process that terminated abruptly, it is unsafe to delete it. " + "For running multiple processes with agents at the same time to create a single configuration, read AutomaticMetadataCollection.md " + - "or https://www.graalvm.org/dev/reference-manual/native-image/metadata/AutomaticMetadataCollection/ on how to use the native-image-configure tool."); + "or https://www.graalvm.org/dev/reference-manual/native-image/metadata/AutomaticMetadataCollection/ on how to use the native-image-utils tool."); } if (experimentalOmitClasspathConfig) { ignoreConfigFromClasspath(jvmti, omittedConfigs); @@ -632,7 +632,7 @@ private void writeConfigurationFiles() { "All output files remain in the temporary directory '" + configOutputDirPath.resolve("..").relativize(tempDirectory) + "'. " + "Ensure that only one agent instance and no other processes are writing to the output directory '" + configOutputDirPath + "' at the same time. " + "For running multiple processes with agents at the same time to create a single configuration, read AutomaticMetadataCollection.md " + - "or https://www.graalvm.org/dev/reference-manual/native-image/metadata/AutomaticMetadataCollection/ on how to use the native-image-configure tool."); + "or https://www.graalvm.org/dev/reference-manual/native-image/metadata/AutomaticMetadataCollection/ on how to use the native-image-utils tool."); } } diff --git a/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/PartialConfigurationGenerator.java b/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/PartialConfigurationGenerator.java index d77b09673ede..1890d39db565 100644 --- a/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/PartialConfigurationGenerator.java +++ b/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/PartialConfigurationGenerator.java @@ -31,8 +31,8 @@ /** * Like {@link ConfigurationGenerator}, but performs the work across multiple test methods. The * agent is run separately for each and configured to emit "partial" configurations, and then the - * results are combined using the {@code native-image-configure generate-conditional} command. This - * test is invoked manually from mx. + * results are combined using the {@code native-image-utils generate-conditional} command. This test + * is invoked manually from mx. */ public class PartialConfigurationGenerator { diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationTool.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationTool.java index 43e3bf854ba1..09ae64362336 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationTool.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationTool.java @@ -38,7 +38,12 @@ import com.oracle.svm.configure.command.ConfigurationHelpCommand; import com.oracle.svm.configure.command.ConfigurationProcessTraceCommand; import com.oracle.svm.configure.command.ConfigurationUnknownCommand; +import com.oracle.svm.util.LogUtils; +/** + * A standalone tool for native-image. It is shipped as `native-image-utils` (previously + * `native-image-configure`). + */ public class ConfigurationTool { private static final int USAGE_ERROR_CODE = 2; private static final int INTERNAL_ERROR_CODE = 1; @@ -67,6 +72,10 @@ public static Collection getCommands() { } public static void main(String[] arguments) { + String launcherName = System.getProperty("org.graalvm.launcher.executablename", "default"); + if (launcherName.contains("native-image-configure")) { + LogUtils.warning("You are using the deprecated native-image-configure tool. Please switch to native-image-utils."); + } try { if (arguments.length == 0) { throw new ConfigurationUsageException("No arguments provided."); @@ -84,7 +93,7 @@ public static void main(String[] arguments) { commands.getOrDefault(command, unknownCommand).apply(argumentsIterator); } catch (ConfigurationUsageException e) { System.err.println(e.getMessage() + System.lineSeparator() + - "Use 'native-image-configure help' for usage."); + "Use 'native-image-utils help' for usage."); System.exit(USAGE_ERROR_CODE); } catch (Throwable e) { e.printStackTrace(); diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommand.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommand.java index 956f7b047c56..228e1baf87ef 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommand.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommand.java @@ -35,6 +35,10 @@ import com.oracle.svm.configure.ConfigurationUsageException; +/** + * A standalone tool for native-image. It is shipped as `native-image-utils` (previously + * `native-image-configure`). + */ public abstract class ConfigurationCommand { protected static final int VALUE_INDEX = 1; protected static final int OPTION_INDEX = 0; @@ -49,7 +53,7 @@ public abstract class ConfigurationCommand { public abstract void apply(Iterator argumentsIterator) throws IOException; public String getUsage() { - return "native-image-configure " + getName() + " [options]"; + return "native-image-utils " + getName() + " [options]"; } public final String getDescription() { diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommandFileCommand.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommandFileCommand.java index d7ec3fabe6cb..1704a739ad62 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommandFileCommand.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationCommandFileCommand.java @@ -66,7 +66,7 @@ public static Iterator handleCommandFile(Iterator argumentsItera @Override public String getUsage() { - return "native-image-configure command-file "; + return "native-image-utils command-file "; } @Override diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationHelpCommand.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationHelpCommand.java index 67dfb6f33ee2..0cc2a97cd7a3 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationHelpCommand.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/command/ConfigurationHelpCommand.java @@ -52,7 +52,7 @@ public void apply(Iterator argumentsIterator) { @Override public String getUsage() { - return "native-image-configure help"; + return "native-image-utils help"; } @Override @@ -61,7 +61,7 @@ protected String getDescription0() { } protected String getToolName() { - return "GraalVM native-image-configure tool"; + return "GraalVM native-image-utils tool"; } protected String getToolDescription() { diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/trace/AccessAdvisor.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/trace/AccessAdvisor.java index 5c5c232efaaf..7e55efd0b0ed 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/trace/AccessAdvisor.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/trace/AccessAdvisor.java @@ -150,7 +150,7 @@ public final class AccessAdvisor { /* * Exclude selection of packages distributed with GraalVM which are not unconditionally exported * by their module and should not be accessible from application code. Generate all with: - * native-image-configure generate-filters --exclude-unexported-packages-from-modules [--reduce] + * native-image-utils generate-filters --exclude-unexported-packages-from-modules [--reduce] */ private static void excludeInaccessiblePackages(HierarchyFilterNode rootNode) { rootNode.addOrGetChildren("com.oracle.graal.**", ConfigurationFilter.Inclusion.Exclude); diff --git a/vm/mx.vm/mx_vm.py b/vm/mx.vm/mx_vm.py index ad0b4f9b3120..f6cacadff332 100644 --- a/vm/mx.vm/mx_vm.py +++ b/vm/mx.vm/mx_vm.py @@ -83,12 +83,12 @@ def local_path_to_url(args): llvm_components = ['bgraalvm-native-binutil', 'bgraalvm-native-clang', 'bgraalvm-native-clang-cl', 'bgraalvm-native-clang++', 'bgraalvm-native-flang', 'bgraalvm-native-ld'] # pylint: disable=line-too-long -ce_unchained_components = ['bnative-image-configure', 'cmp', 'gvm', 'lg', 'ni', 'nic', 'nil', 'nr_lib_jvmcicompiler', 'sdkc', 'sdkni', 'ssvmjdwp', 'svm', 'svmjdwp', 'svmsl', 'svmt', 'tflc', 'tflsm'] +ce_unchained_components = ['bnative-image-utils', 'cmp', 'gvm', 'lg', 'ni', 'nic', 'nil', 'nr_lib_jvmcicompiler', 'sdkc', 'sdkni', 'ssvmjdwp', 'svm', 'svmjdwp', 'svmsl', 'svmt', 'tflc', 'tflsm'] ce_components_minimal = ['cmp', 'cov', 'dap', 'gvm', 'ins', 'insight', 'insightheap', 'lg', 'lsp', 'nfi-libffi', 'nfi', 'pro', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'tfl', 'tfla', 'tflc', 'tflm', 'truffle-json'] -ce_components = ce_components_minimal + ['nr_lib_jvmcicompiler', 'bnative-image-configure', 'ni', 'nic', 'nil', 'svm', 'svmt', 'svmnfi', 'svmsl'] +ce_components = ce_components_minimal + ['nr_lib_jvmcicompiler', 'bnative-image-utils', 'ni', 'nic', 'nil', 'svm', 'svmt', 'svmnfi', 'svmsl'] ce_python_components = ['antlr4', 'sllvmvm', 'cmp', 'cov', 'dap', 'dis', 'gvm', 'icu4j', 'xz', 'ins', 'insight', 'insightheap', 'lg', 'llp', 'llrc', 'llrl', 'llrlf', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'pro', 'pyn', 'pynl', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'tfl', 'tfla', 'tflc', 'tflm', 'truffle-json'] -ce_fastr_components = ce_components + llvm_components + ['antlr4', 'xz', 'sllvmvm', 'llp', 'bnative-image', 'snative-image-agent', 'R', 'sRvm', 'bnative-image-configure', 'llrc', 'snative-image-diagnostics-agent', 'llrn', 'llrl', 'llrlf'] +ce_fastr_components = ce_components + llvm_components + ['antlr4', 'xz', 'sllvmvm', 'llp', 'bnative-image', 'snative-image-agent', 'R', 'sRvm', 'bnative-image-utils', 'llrc', 'snative-image-diagnostics-agent', 'llrn', 'llrl', 'llrlf'] ce_no_native_components = ['cmp', 'cov', 'dap', 'gvm', 'ins', 'insight', 'insightheap', 'lsp', 'nfi-libffi', 'nfi', 'pro', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'tfl', 'tfla', 'tflc', 'tflm', 'truffle-json'] # Main GraalVMs @@ -106,9 +106,9 @@ def local_path_to_url(args): mx_sdk_vm.register_vm_config('libgraal-bash', llvm_components + ['cmp', 'gvm', 'lg', 'nfi-libffi', 'nfi', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False) if mx.get_os() == 'windows': - mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False) + mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-utils', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False) else: - mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'svml', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False) + mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-utils', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'svml', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False) # pylint: enable=line-too-long