Skip to content

Commit 47db827

Browse files
committed
[GR-69116] Rename native-image-configure tool to native-image-utils.
PullRequest: graal/22426
2 parents a132583 + fe71719 commit 47db827

File tree

20 files changed

+82
-68
lines changed

20 files changed

+82
-68
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To learn how to compute dynamic feature calls in code, see [Reachability Metadat
2020
* [Tracing Agent](#tracing-agent)
2121
* [Conditional Metadata Collection](#conditional-metadata-collection)
2222
* [Agent Advanced Usage](#agent-advanced-usage)
23-
* [Native Image Configure Tool](#native-image-configure-tool)
23+
* [Native Image Utils Tool](#native-image-utils-tool)
2424

2525
## Tracing Agent
2626

@@ -160,10 +160,10 @@ However, for a better understanding of the execution, the agent can also write a
160160
$JAVA_HOME/bin/java -agentlib:native-image-agent=trace-output=/path/to/trace-file.json ...
161161
```
162162

163-
The `native-image-configure` tool can transform trace files to configuration files.
163+
The `native-image-utils` tool can transform trace files to configuration files.
164164
The following command reads and processes `trace-file.json` and generates a set of configuration files in the directory `/path/to/config-dir/`:
165165
```shell
166-
native-image-configure generate --trace-input=/path/to/trace-file.json --output-dir=/path/to/config-dir/
166+
native-image-utils generate --trace-input=/path/to/trace-file.json --output-dir=/path/to/config-dir/
167167
```
168168

169169
### Interoperability
@@ -179,16 +179,16 @@ In this case, it is necessary to provide the absolute path of the agent:
179179
The agent has options which are currently experimental and might be enabled in future releases, but can also be changed or removed entirely.
180180
See the [ExperimentalAgentOptions.md](ExperimentalAgentOptions.md) guide.
181181

182-
## Native Image Configure Tool
182+
## Native Image Utils Tool
183183

184184
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.
185-
The `native-image-configure` tool can be used to merge these configuration files:
185+
The `native-image-utils` tool can be used to merge these configuration files:
186186
```shell
187-
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/
187+
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/
188188
```
189189

190190
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/`.
191-
An arbitrary number of `--input-dir` arguments with sets of configuration files can be specified. See `native-image-configure help` for all options.
191+
An arbitrary number of `--input-dir` arguments with sets of configuration files can be specified. See `native-image-utils help` for all options.
192192

193193
### Further Reading
194194

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ Advanced obfuscation is applied to your application code and third-party depende
343343
* Names of annotations, lambdas, and proxies
344344

345345
To export a mapping from original to obfuscated names, use `-H:AdvancedObfuscation=export-mapping`.
346-
Use the mapping file and the `native-image-configure deobfuscate` command to deobfuscate stack traces.
346+
Use the mapping file and the `native-image-utils deobfuscate` command to deobfuscate stack traces.
347347
See the [build report](BuildReport.md) for summary statistics, such as the percentage of class and method names that were obfuscated.
348348

349349
For more information, see [Advanced Obfuscation in Native Image](../../security/Obfuscation.md).

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ To further filter the generated configuration, you can use `conditional-config-c
6363
### Generating Conditional Configuration From Multiple Agent Runs
6464

6565
Conditional configuration can be generated from multiple agent runs that reach different code paths in the application.
66-
Each agent run produces configuration with metadata. `native-image-configure` is then used to merge the collected data and produce a conditional configuration.
67-
To run the agent in this mode, add `experimental-conditional-config-part` to the agent's command line.
68-
Once all the agent runs have finished, you can generate a conditional configuration by invoking:
66+
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.
67+
To generate a conditional configuration, invoke:
6968
```shell
70-
native-image-configure generate-conditional --user-code-filter=<path-to-filter-file> --class-name-filter=<path-to-filter-file> --input-dir=<path-to-agent-run-output-1> --input-dir=<path-to-agent-run-ouput-2> ... --output-dir=<path-to-resulting-conditional-config>
69+
native-image-utils generate-conditional --user-code-filter=<path-to-filter-file> --class-name-filter=<path-to-filter-file> --input-dir=<path-to-agent-run-output-1> --input-dir=<path-to-agent-run-output-2> ... --output-dir=<path-to-resulting-conditional-config>
7170
```
7271
where:
7372
- `--user-code-filter=<path-to-filter-file>`: path to an agent filter file that specifies user classes

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ redirect_from: /reference-manual/native-image/inspect/
1010

1111
> **The Native Image Inspect Tool is deprecated and will be removed in a future release**. To extract embedded SBOMs, use:
1212
> ```bash
13-
> $JAVA_HOME/bin/native-image-configure extract-sbom --image-path=<path_to_binary>
13+
> $JAVA_HOME/bin/native-image-utils extract-sbom --image-path=<path_to_binary>
1414
> ```
1515
1616
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.

docs/reference-manual/native-image/PGO-Merging-Profiles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ permalink: /reference-manual/native-image/optimizations-and-performance/PGO/merg
77

88
# Merging Profiles from Multiple Sources
99

10-
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).
10+
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).
1111
Merging profiles implies that the resulting profile will contain the union of all types, methods, and profile entries from the provided profiles.
1212

1313
## Usage
1414

1515
To merge two profiles, _profile_1.iprof_ and _profile_2.iprof_, into a single file named _output_profile.iprof_, use the following command:
1616
```bash
17-
native-image-configure merge-pgo-profiles --input-file=profile_1.iprof --input-file=profile_2.iprof --output-file=output_profile.iprof
17+
native-image-utils merge-pgo-profiles --input-file=profile_1.iprof --input-file=profile_2.iprof --output-file=output_profile.iprof
1818
```
1919

2020
There is also a way to specify a directory as a source of profiles using the `--input-dir=<path>` option.
2121
Then it only searches for profiles in the given directory, excluding subdirectories.
2222
```bash
23-
native-image-configure merge-pgo-profiles --input-dir=my_profiles/ --output-file=output_profile.iprof
23+
native-image-utils merge-pgo-profiles --input-dir=my_profiles/ --output-file=output_profile.iprof
2424
```
2525

2626
### Further Reading
2727

2828
* [Basic Usage of Profile-Guided Optimization](PGO-Basic-Usage.md)
29-
* [Native Image Configure Tool](AutomaticMetadataCollection.md#native-image-configure-tool)
29+
* [Native Image Utils Tool](AutomaticMetadataCollection.md#native-image-utils-tool)

docs/reference-manual/native-image/guides/use-sbom-support.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ For the demo application, you will use the `jwebserver` tool, and package it as
5454

5555
There are two possible ways to extract the compressed SBOM contents into a human-readable format:
5656
- using [Syft](https://github.com/anchore/syft)
57-
- using the [Native Image Configure Tool](#native-image-configure-tool)
57+
- using the [Native Image Utils Tool](#native-image-utils-tool)
5858

5959
### Syft
6060

@@ -68,14 +68,14 @@ syft jwebserver
6868
```
6969
It lists all of the Java libraries included in it.
7070

71-
### Native Image Configure Tool
71+
### Native Image Utils Tool
7272

73-
GraalVM Native Image provides the `native-image-configure` tool to retrieve an SBOM embedded in a native executable.
74-
The Configure Tool is a viable alternative if you prefer not to install `syft`.
73+
GraalVM Native Image provides the `native-image-utils` tool to retrieve an SBOM embedded in a native executable.
74+
The Utils Tool is a viable alternative if you prefer not to install `syft`.
7575

76-
Run the following command to read the SBOM contents using the Configure Tool:
76+
Run the following command to read the SBOM contents using the Utils Tool:
7777
```bash
78-
$JAVA_HOME/bin/native-image-configure extract-sbom --image-path=<path_to_binary>
78+
$JAVA_HOME/bin/native-image-utils extract-sbom --image-path=<path_to_binary>
7979
```
8080

8181
To take it further, you can submit the SBOM to any available vulnerability scanner, and check if the recorded libraries have known security vulnerabilities.

docs/security/Obfuscation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ Obfuscated names are non-deterministic and may vary between builds.
108108

109109
### Deobfuscating Stack Traces
110110

111-
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:
111+
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:
112112

113113
```bash
114-
native-image-configure deobfuscate --map-file=app.obfuscation-mapping.json --input-file=obfuscated-stacktrace.log
114+
native-image-utils deobfuscate --map-file=app.obfuscation-mapping.json --input-file=obfuscated-stacktrace.log
115115

116116
Exception in thread "main" java.lang.RuntimeException: Something bad happened!
117117
at com.obfuscation.SecretClass.secretAlgorithm(SecretClass.java:14)
@@ -121,7 +121,7 @@ Exception in thread "main" java.lang.RuntimeException: Something bad happened!
121121
This restores the original names for debugging the issue, while keeping your distributed binary obfuscated.
122122
Log file lines not part of the stack trace remain unchanged.
123123

124-
You can locate the `native-image-configure` tool in the same `bin` directory as `native-image`.
124+
You can locate the `native-image-utils` tool in the same `bin` directory as `native-image`.
125125

126126
## What Gets Obfuscated
127127

@@ -149,7 +149,7 @@ JUnit-related code is automatically preserved for testing compatibility.
149149
## Understanding the Mapping File
150150

151151
When you use `export-mapping`, Native Image generates a JSON file named _\<image-name\>.obfuscation-mapping.json_ in your build artifacts.
152-
This file maps original symbol names to their obfuscated versions, allowing `native-image-configure deobfuscate` to reverse the process.
152+
This file maps original symbol names to their obfuscated versions, allowing `native-image-utils deobfuscate` to reverse the process.
153153
Mappings can change per build, so associate mapping files with specific build versions or IDs for reliable deobfuscation.
154154

155155
The mapping file lists the `[original, obfuscated]` name pairs of modules, packages, source files, types (classes, records, interfaces, enums), and methods.

docs/security/SBOM.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The SBOM feature can be disabled with `--enable-sbom=false`.
2424
## Extracting SBOM Contents
2525

2626
After embedding the compressed SBOM into the image, there are two possible ways to extract the SBOM contents:
27-
- using the [Native Image Configure Tool](#native-image-configure-tool)
27+
- using the [Native Image Utils Tool](#native-image-utils-tool)
2828
- using [Syft](https://github.com/anchore/syft){:target="_blank"}
2929

30-
### Native Image Configure Tool
30+
### Native Image Utils Tool
3131

32-
The Native Image Configure Tool can extract the compressed SBOM using the `extract-sbom` command from executables and shared libraries.
32+
The Native Image Utils Tool can extract the compressed SBOM using the `extract-sbom` command from executables and shared libraries.
3333
```bash
34-
$JAVA_HOME/bin/native-image-configure extract-sbom --image-path=<path_to_binary>
34+
$JAVA_HOME/bin/native-image-utils extract-sbom --image-path=<path_to_binary>
3535
```
3636

3737
It outputs the contents in the JSON format:
@@ -137,9 +137,9 @@ It also integrates with GitHub Actions, GitLab, and Jenkins Pipelines.
137137

138138
Another popular command-line scanner is `grype`, part of the [Anchore software supply chain management platform](https://anchore.com/){:target="_blank"}.
139139
With `grype`, you can check whether the libraries listed in your SBOMs have known vulnerabilities documented in Anchore's database.
140-
The output of the `native-image-configure` tool can be fed directly into `grype` to scan for vulnerable libraries using the following command:
140+
The output of the `native-image-utils` tool can be fed directly into `grype` to scan for vulnerable libraries using the following command:
141141
```bash
142-
native-image-configure extract-sbom --image-path=<path_to_binary> | grype
142+
native-image-utils extract-sbom --image-path=<path_to_binary> | grype
143143
```
144144
It produces the following output:
145145
```shell

espresso/mx.espresso/mx_espresso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,6 @@ def gen_gc_option_check(args):
10201020
})
10211021

10221022
# CE with some skipped native images
1023-
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']
1023+
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']
10241024
mx_sdk_vm.register_vm_config('ce', ce_unchained_components, _suite, env_file='jvm-ce')
10251025
mx_sdk_vm.register_vm_config('ce', ce_unchained_components, _suite, env_file='jvm-ce-llvm')

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,28 +1108,28 @@ def _configure_from_name(self, config_name):
11081108
self.pgo_instrumentation = True
11091109

11101110
def generate_profiling_package_prefixes():
1111-
# run the native-image-configure tool to gather the jdk package prefixes
1111+
# run the native-image-utils tool to gather the jdk package prefixes
11121112
graalvm_home_bin = os.path.join(mx_sdk_vm.graalvm_home(), 'bin')
1113-
native_image_configure_command = mx.cmd_suffix(
1114-
os.path.join(graalvm_home_bin, 'native-image-configure'))
1115-
if not exists(native_image_configure_command):
1116-
mx.abort('Failed to find the native-image-configure command at {}. \nContent {}: \n\t{}'.format(
1117-
native_image_configure_command, graalvm_home_bin,
1113+
native_image_utils_command = mx.cmd_suffix(
1114+
os.path.join(graalvm_home_bin, 'native-image-utils'))
1115+
if not exists(native_image_utils_command):
1116+
mx.abort('Failed to find the native-image-utils command at {}. \nContent {}: \n\t{}'.format(
1117+
native_image_utils_command, graalvm_home_bin,
11181118
'\n\t'.join(os.listdir(graalvm_home_bin))))
11191119
tmp = tempfile.NamedTemporaryFile()
1120-
ret = mx.run([native_image_configure_command, 'generate-filters',
1120+
ret = mx.run([native_image_utils_command, 'generate-filters',
11211121
'--include-packages-from-modules=java.base',
11221122
'--exclude-classes=org.graalvm.**', '--exclude-classes=com.oracle.**',
11231123
# remove internal packages
11241124
f'--output-file={tmp.name}'], nonZeroIsFatal=True)
11251125
if ret != 0:
1126-
mx.abort('Native image configure command failed.')
1126+
mx.abort('Native image utils command failed.')
11271127

11281128
# format the profiling package prefixes
11291129
with open(tmp.name, 'r') as f:
11301130
prefixes = json.loads(f.read())
11311131
if 'rules' not in prefixes:
1132-
mx.abort('Native image configure command failed. Can not generate rules.')
1132+
mx.abort('Native image utils command failed. Can not generate rules.')
11331133
rules = prefixes['rules']
11341134
rules = map(lambda r: r['includeClasses'][:-2], filter(lambda r: 'includeClasses' in r, rules))
11351135
return ','.join(rules)
@@ -1695,7 +1695,7 @@ def _collect_perf_results_into_iprof(self):
16951695
else:
16961696
mx.abort(f"Perf script failed with exit code: {exit_code}")
16971697
mx.log(f"Started generating iprof at {self.get_stage_runner().get_timestamp()}")
1698-
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}']
1698+
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}']
16991699
if self.pgo_perf_invoke_profile_collection_strategy == PerfInvokeProfileCollectionStrategy.ALL:
17001700
nic_command += ["--enable-experimental-option=SampledVirtualInvokeProfilesAll"]
17011701
elif self.pgo_perf_invoke_profile_collection_strategy == PerfInvokeProfileCollectionStrategy.MULTIPLE_CALLEES:

0 commit comments

Comments
 (0)