From a8f32703c9e7c17fa5d20894bff55b193c5d60e1 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 13 Feb 2023 08:55:41 +0100 Subject: [PATCH 1/6] Include `native-image` in GraalVM JDK. --- substratevm/mx.substratevm/mx_substratevm.py | 12 ++++----- vm/ce-release-artifacts.json | 27 -------------------- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index f383b56718d4..85cbe2fabb59 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -917,7 +917,7 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'], stability="earlyadopter", jlink=False, - installable=True, + installable=False, )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( @@ -932,7 +932,7 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing truffle_jars=[], builder_jar_distributions=['substratevm:SVM_LIBFFI'], support_distributions=['substratevm:SVM_NFI_GRAALVM_SUPPORT'], - installable=True, + installable=False, )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJreComponent( @@ -944,7 +944,7 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing license_files=[], third_party_license_files=[], support_distributions=['substratevm:SVM_STATIC_LIBRARIES_SUPPORT'], - installable=True, + installable=False, )) def _native_image_launcher_main_class(): @@ -1023,7 +1023,7 @@ def _native_image_launcher_extra_jvm_args(): ), ], provided_executables=['bin/'], - installable=True, + installable=False, stability="earlyadopter", jlink=False, )) @@ -1038,7 +1038,7 @@ def _native_image_launcher_extra_jvm_args(): third_party_license_files=[], dependencies=[], support_distributions=['substratevm:NATIVE_IMAGE_LICENSE_GRAALVM_SUPPORT'], - installable=True, + installable=False, priority=1, stability="earlyadopter", jlink=False, @@ -1223,7 +1223,7 @@ def _native_image_configure_extra_jvm_args(): ], jlink=False, installable_id='native-image', - installable=True, + installable=False, priority=10, )) diff --git a/vm/ce-release-artifacts.json b/vm/ce-release-artifacts.json index 11ab80eda1c3..80248501e218 100644 --- a/vm/ce-release-artifacts.json +++ b/vm/ce-release-artifacts.json @@ -169,33 +169,6 @@ } ] }, - { - "name": "native-image-installable-svm-java19", - "core": false, - "jdk": "jdk_19", - "artifacts": [ - { - "os": "linux", - "arch": "amd64" - }, - { - "os": "linux", - "arch": "aarch64" - }, - { - "os": "darwin", - "arch": "amd64" - }, - { - "os": "darwin", - "arch": "aarch64" - }, - { - "os": "windows", - "arch": "amd64" - } - ] - }, { "name": "native-image-llvm-backend-installable-ce-java19", "core": false, From b5f09b8bccc6e4496a760bd01c98c2abe96faa59 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Tue, 14 Feb 2023 08:32:19 +0100 Subject: [PATCH 2/6] Update GraalVM CE configs. --- vm/mx.vm/ce | 4 ++-- vm/mx.vm/ce-aarch64 | 4 ++-- vm/mx.vm/ce-darwin | 4 ++-- vm/mx.vm/ce-darwin-aarch64 | 4 ++-- vm/mx.vm/ce-fastr | 2 +- vm/mx.vm/ce-win | 4 ++-- vm/mx.vm/mx_vm.py | 13 +++++++------ 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/vm/mx.vm/ce b/vm/mx.vm/ce index 2bd9b353e6e8..194ba574e91c 100644 --- a/vm/mx.vm/ce +++ b/vm/mx.vm/ce @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle -COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,poly,polynative,pro,rgx,sdk,tfl,tflm -NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler +COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,ni,nic,nil,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm +NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-aarch64 b/vm/mx.vm/ce-aarch64 index 2bd9b353e6e8..194ba574e91c 100644 --- a/vm/mx.vm/ce-aarch64 +++ b/vm/mx.vm/ce-aarch64 @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle -COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,poly,polynative,pro,rgx,sdk,tfl,tflm -NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler +COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,ni,nic,nil,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm +NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-darwin b/vm/mx.vm/ce-darwin index 2bd9b353e6e8..194ba574e91c 100644 --- a/vm/mx.vm/ce-darwin +++ b/vm/mx.vm/ce-darwin @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle -COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,poly,polynative,pro,rgx,sdk,tfl,tflm -NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler +COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,ni,nic,nil,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm +NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-darwin-aarch64 b/vm/mx.vm/ce-darwin-aarch64 index 2bd9b353e6e8..194ba574e91c 100644 --- a/vm/mx.vm/ce-darwin-aarch64 +++ b/vm/mx.vm/ce-darwin-aarch64 @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle -COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,poly,polynative,pro,rgx,sdk,tfl,tflm -NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler +COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,ni,nic,nil,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm +NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-fastr b/vm/mx.vm/ce-fastr index 40ae8ca13a2a..2b478399a732 100644 --- a/vm/mx.vm/ce-fastr +++ b/vm/mx.vm/ce-fastr @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,fastr -COMPONENTS=R,cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,ni,poly,polynative,pro,rgx,sdk,tfl,tflm +COMPONENTS=R,cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,ni,nic,poly,polynative,pro,rgx,sdk,tfl,tflm NATIVE_IMAGES=lib:jvmcicompiler DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-win b/vm/mx.vm/ce-win index 3f9aa17f1ff4..b7e37db0a12b 100644 --- a/vm/mx.vm/ce-win +++ b/vm/mx.vm/ce-win @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle -COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,poly,polynative,pro,rgx,sdk,tfl,tflm -NATIVE_IMAGES=lib:jvmcicompiler +COMPONENTS=cmp,cov,dap,gu,gvm,icu4j,ins,insight,insightheap,jss,lg,lsp,nfi-libffi,ni,nic,nil,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm +NATIVE_IMAGES=lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/mx_vm.py b/vm/mx.vm/mx_vm.py index 819e3db282ad..b8a9889a60a7 100644 --- a/vm/mx.vm/mx_vm.py +++ b/vm/mx.vm/mx_vm.py @@ -162,7 +162,8 @@ llvm_components = ['bgraalvm-native-binutil', 'bgraalvm-native-clang', 'bgraalvm-native-clang-cl', 'bgraalvm-native-clang++', 'bgraalvm-native-ld'] # pylint: disable=line-too-long -ce_components = ['bgu', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'] +ce_components_minimal = ['bgu', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'] +ce_components = ce_components_minimal + ['bnative-image', 'bnative-image-configure', 'ni', 'nic', 'nil', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmnfi', 'svmsl'] ce_win_complete_components = ['bgu', 'bnative-image-configure', 'bpolyglot', 'cmp', 'cov', 'dap', 'ejvm', 'gu', 'gvm', 'gwa', 'icu4j', 'ins', 'insight', 'insightheap', 'java', 'js', 'jss', 'lg', 'libpoly', 'llp', 'llrc', 'llrl', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'njs', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm', 'vvm'] ce_aarch64_complete_components = ce_win_complete_components + ['pyn', 'pynl', 'rby', 'rbyl', 'svml'] ce_complete_components = ce_aarch64_complete_components + ['ellvm', 'R', 'bRMain'] @@ -171,17 +172,17 @@ ce_darwin_aarch64_complete_components.remove('svml') # GR-34811 / GR-40147 ce_ruby_components = ['cmp', 'cov', 'dap', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'lg', 'llp', 'llrc', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'pro', 'rby', 'rbyl', 'rgx', 'sdk', 'tfl', 'tflm'] ce_python_components = llvm_components + ['bgu', 'sllvmvm', 'bpolybench', 'bpolyglot', 'cmp', 'cov', 'dap', 'dis', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lg', 'libpoly', 'llp', 'llrc', 'llrl', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'pbm', 'pmh', 'poly', 'polynative', 'pro', 'pyn', 'pynl', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'] -ce_fastr_components = ce_components + llvm_components + ['R', 'bRMain', 'llrn', 'llp', 'sllvmvm', 'llrc', 'ni', 'nil', 'svm', 'bgu', 'svmsl', 'svmnfi', 'snative-image-agent', 'bnative-image', 'snative-image-diagnostics-agent', 'llrl'] +ce_fastr_components = ce_components + llvm_components + ['R', 'bRMain', 'llrn', 'llp', 'sllvmvm', 'llrc', 'llrl'] ce_no_native_components = ['bgu', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lsp', 'nfi-libffi', 'nfi', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm', 'libpoly', 'poly'] -mx_sdk_vm.register_vm_config('ce', ['bgu', 'insight', 'insightheap', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'poly', 'bpolyglot', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'], _suite, env_file='ce-win') +mx_sdk_vm.register_vm_config('ce', ['bgu', 'bnative-image-configure', 'insight', 'insightheap', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'poly', 'bpolyglot', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm'], _suite, env_file='ce-win') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-aarch64') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-darwin') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-darwin-aarch64') mx_sdk_vm.register_vm_config('ce', ce_components, _suite) -mx_sdk_vm.register_vm_config('ce', ce_components + ['js'], _suite, dist_name='ce-js', env_file='ce-js') -mx_sdk_vm.register_vm_config('ce', ce_components + ['js', 'njs', 'sjsvm'], _suite, dist_name='ce', env_file='ce-nodejs') -mx_sdk_vm.register_vm_config('ce', ce_components + ['llrn', 'llp', 'llrc', 'llrl'], _suite, env_file='ce-llvm') +mx_sdk_vm.register_vm_config('ce', ce_components_minimal + ['js'], _suite, dist_name='ce-js', env_file='ce-js') +mx_sdk_vm.register_vm_config('ce', ce_components_minimal + ['js', 'njs', 'sjsvm'], _suite, dist_name='ce', env_file='ce-nodejs') +mx_sdk_vm.register_vm_config('ce', ce_components_minimal + ['llrn', 'llp', 'llrc', 'llrl'], _suite, env_file='ce-llvm') mx_sdk_vm.register_vm_config('ce', ce_ruby_components, _suite, dist_name='ce-ruby', env_file='ce-ruby') mx_sdk_vm.register_vm_config('ce', ce_win_complete_components, _suite, dist_name='ce-win-complete') mx_sdk_vm.register_vm_config('ce', ce_aarch64_complete_components, _suite, dist_name='ce-aarch64-complete') From f2518a66497d058e45ecd30c530c187a87ef90e9 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 13 Feb 2023 13:51:37 +0100 Subject: [PATCH 3/6] Add `CHANGELOG.md` entry. --- substratevm/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/substratevm/CHANGELOG.md b/substratevm/CHANGELOG.md index 7d76702cc7d0..b0bb6ef1b4a6 100644 --- a/substratevm/CHANGELOG.md +++ b/substratevm/CHANGELOG.md @@ -19,6 +19,7 @@ This changelog summarizes major changes to GraalVM Native Image. * (GR-43410) Added support for the JFR event `ExecutionSample`. * (GR-44058) Red Hat added support for the JFR event `ObjectAllocationInNewTLAB`. * (GR-42467) The search path for `System.loadLibrary()` by default includes the directory containing the native image. +* (GR-44216) Native Image is now shipped as part of the GraalVM JDK and thus no longer needs to be installed via `gu install native-image`. ## Version 22.3.0 * (GR-35721) Remove old build output style and the `-H:±BuildOutputUseNewStyle` option. From 012fd099aa418b3828521a274562d13bcb6c30a9 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 13 Feb 2023 08:56:44 +0100 Subject: [PATCH 4/6] Update docs after including `native-image`. --- docs/examples/java-kotlin-aot.md | 7 +------ docs/examples/native-image-examples.md | 7 +------ .../get-started-graalvm-community.md | 6 +----- .../get-started-graalvm-enterprise.md | 7 +------ docs/graalvm-as-a-platform/implement-language.md | 2 +- docs/reference-manual/graalvm-updater.md | 2 +- docs/reference-manual/native-image/README.md | 13 +------------ 7 files changed, 7 insertions(+), 37 deletions(-) diff --git a/docs/examples/java-kotlin-aot.md b/docs/examples/java-kotlin-aot.md index 363929088b48..71b63516fb31 100644 --- a/docs/examples/java-kotlin-aot.md +++ b/docs/examples/java-kotlin-aot.md @@ -33,12 +33,7 @@ This example demonstrates how to compile a Java and Kotlin application ahead-of- ``` Note that your paths are likely to be different depending on the download location. -3. [Install Native Image](../reference-manual/native-image/README.md/#install-native-image) by running. - ```bash - gu install native-image - ``` - -4. Then execute: +3. Then execute: ```shell ./build.sh ``` diff --git a/docs/examples/native-image-examples.md b/docs/examples/native-image-examples.md index a85254d1e6e9..75ebd6832936 100644 --- a/docs/examples/native-image-examples.md +++ b/docs/examples/native-image-examples.md @@ -41,12 +41,7 @@ Here you will also find a more sophisticated example displaying GraalVM's abilit ``` Note that your paths are likely to be different depending on the download location. -3. Install [Native Image](../reference-manual/native-image/README.md/#install-native-image) support by running: - ```bash - gu install native-image - ``` - -4. Then execute: +3. Then execute: ```shell ./build.sh ``` diff --git a/docs/getting-started/graalvm-community/get-started-graalvm-community.md b/docs/getting-started/graalvm-community/get-started-graalvm-community.md index 7ff498cb9092..2a459d2e5c09 100644 --- a/docs/getting-started/graalvm-community/get-started-graalvm-community.md +++ b/docs/getting-started/graalvm-community/get-started-graalvm-community.md @@ -286,11 +286,7 @@ For more information on running polyglot applications, see [Polyglot Programming ## Native Image -With GraalVM you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and smaller footprint for your application. -The [Native Image](../../reference-manual/native-image/README.md) functionality is not available by default, but can be easily installed with the [GraalVM Updater](../../reference-manual/graalvm-updater.md) tool: -```shell -gu install native-image -``` +With GraalVM [Native Image](../../reference-manual/native-image/README.md) you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and smaller footprint for your application. The `HelloWorld` example from above is used here to demonstrate how to generate a native executable: ```java diff --git a/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md b/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md index 2a111a5e1d19..444af109de2f 100644 --- a/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md +++ b/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md @@ -285,12 +285,7 @@ More details can be found in the [WebAssembly reference manual](../../reference- ## Native Image -With GraalVM Enterprise you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and a smaller footprint for your application. - -The [Native Image](../../reference-manual/native-image/README.md) functionality is not available by default, but can be easily installed with the [GraalVM Updater](../../reference-manual/graalvm-updater.md) tool: -```shell -gu install native-image -``` +With GraalVM [Native Image](../../reference-manual/native-image/README.md) Enterprise you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and a smaller footprint for your application. The `HelloWorld` example from above is used here to demonstrate how to generate a native executable: ```java diff --git a/docs/graalvm-as-a-platform/implement-language.md b/docs/graalvm-as-a-platform/implement-language.md index 3849896edb71..2c07cd3f9a90 100644 --- a/docs/graalvm-as-a-platform/implement-language.md +++ b/docs/graalvm-as-a-platform/implement-language.md @@ -29,7 +29,7 @@ For macOS, use: export JAVA_HOME=/path/to/graalvm/Contents/Home export PATH=/path/to/graalvm/Contents/Home/bin:$PATH ``` -4. Execute `mvn package` from the SimpleLanguage folder to build the language. The command also builds a `slnative` executable in the `simplelanguage/native` directory and a `sl-component.jar` language component which later can be installed into GraalVM using the [GraalVM Updater](../reference-manual/graalvm-updater.md) tool. Please verify ithat the `native-image` plugin is available in your GraalVM distribution to avoid build failure: +4. Execute `mvn package` from the SimpleLanguage folder to build the language. The command also builds a `slnative` executable in the `simplelanguage/native` directory and a `sl-component.jar` language component which later can be installed into GraalVM using the [GraalVM Updater](../reference-manual/graalvm-updater.md) tool. Please verify that the `native-image` plugin is available in your GraalVM distribution to avoid build failure: ```shell gu list gu install native-image diff --git a/docs/reference-manual/graalvm-updater.md b/docs/reference-manual/graalvm-updater.md index 646efcca537e..68d26e7e18c7 100644 --- a/docs/reference-manual/graalvm-updater.md +++ b/docs/reference-manual/graalvm-updater.md @@ -101,7 +101,7 @@ Follow these steps to install a component to GraalVM Enterprise, for example, Na 2. Install a component using the `ComponentId` value: ```shell - gu install native-image + gu install nodejs ``` You will see a message to provide your valid email address or input your download token and press `ENTER`. Supposedly, this is your first installation and you have not accepted the license yet. So press `ENTER`. diff --git a/docs/reference-manual/native-image/README.md b/docs/reference-manual/native-image/README.md index 059b1e5546ce..2f34251cfa40 100644 --- a/docs/reference-manual/native-image/README.md +++ b/docs/reference-manual/native-image/README.md @@ -29,25 +29,14 @@ To get used to Native Image terminology and get better understanding of the tech ### Table of Contents -* [Install Native Image](#install-native-image) * [Build a Native Executable](#build-a-native-executable) * [Configuring Native Image with Third-Party Libraries](#configuring-native-image-with-third-party-libraries) * [License](#license) * [Further Reading](#further-reading) -## Install Native Image - -Native Image can be added to GraalVM with the [GraalVM Updater](../graalvm-updater.md) tool. - -Run this command to install Native Image: -```shell -gu install native-image -``` -The `native-image` tool is installed in the `$JAVA_HOME/bin` directory. - ### Prerequisites -The `native-image` tool depends on the local toolchain (header files for the C library, `glibc-devel`, `zlib`, `gcc`, and/or `libstdc++-static`). +The `native-image` tool, available in the `bin` directory of your GraalVM installation, depends on the local toolchain (header files for the C library, `glibc-devel`, `zlib`, `gcc`, and/or `libstdc++-static`). These dependencies can be installed (if not yet installed) using a package manager on your machine. Choose your operating system to find instructions to meet the prerequisites. From ab192d433dbf26adb6543e862ea6ff8b3a3c00b0 Mon Sep 17 00:00:00 2001 From: Danilo Ansaloni Date: Tue, 14 Feb 2023 18:04:09 +0100 Subject: [PATCH 5/6] Fix GraalVM configs checks. --- vm/mx.vm/mx_vm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/mx.vm/mx_vm.py b/vm/mx.vm/mx_vm.py index b8a9889a60a7..e3ef67121f97 100644 --- a/vm/mx.vm/mx_vm.py +++ b/vm/mx.vm/mx_vm.py @@ -163,7 +163,7 @@ # pylint: disable=line-too-long ce_components_minimal = ['bgu', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'] -ce_components = ce_components_minimal + ['bnative-image', 'bnative-image-configure', 'ni', 'nic', 'nil', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmnfi', 'svmsl'] +ce_components = ce_components_minimal + ['bnative-image-configure', 'ni', 'nic', 'nil', 'svm', 'svmnfi', 'svmsl'] ce_win_complete_components = ['bgu', 'bnative-image-configure', 'bpolyglot', 'cmp', 'cov', 'dap', 'ejvm', 'gu', 'gvm', 'gwa', 'icu4j', 'ins', 'insight', 'insightheap', 'java', 'js', 'jss', 'lg', 'libpoly', 'llp', 'llrc', 'llrl', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'njs', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm', 'vvm'] ce_aarch64_complete_components = ce_win_complete_components + ['pyn', 'pynl', 'rby', 'rbyl', 'svml'] ce_complete_components = ce_aarch64_complete_components + ['ellvm', 'R', 'bRMain'] @@ -172,10 +172,10 @@ ce_darwin_aarch64_complete_components.remove('svml') # GR-34811 / GR-40147 ce_ruby_components = ['cmp', 'cov', 'dap', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'lg', 'llp', 'llrc', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'pro', 'rby', 'rbyl', 'rgx', 'sdk', 'tfl', 'tflm'] ce_python_components = llvm_components + ['bgu', 'sllvmvm', 'bpolybench', 'bpolyglot', 'cmp', 'cov', 'dap', 'dis', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lg', 'libpoly', 'llp', 'llrc', 'llrl', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'pbm', 'pmh', 'poly', 'polynative', 'pro', 'pyn', 'pynl', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm'] -ce_fastr_components = ce_components + llvm_components + ['R', 'bRMain', 'llrn', 'llp', 'sllvmvm', 'llrc', 'llrl'] +ce_fastr_components = ce_components + llvm_components + ['sllvmvm', 'llp', 'bnative-image', 'snative-image-agent', 'R', 'bRMain', 'bnative-image-configure', 'llrc', 'snative-image-diagnostics-agent', 'llrn', 'llrl'] ce_no_native_components = ['bgu', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'jss', 'lsp', 'nfi-libffi', 'nfi', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm', 'libpoly', 'poly'] -mx_sdk_vm.register_vm_config('ce', ['bgu', 'bnative-image-configure', 'insight', 'insightheap', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'jss', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'poly', 'bpolyglot', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm'], _suite, env_file='ce-win') +mx_sdk_vm.register_vm_config('ce', ce_components + llvm_components, _suite, env_file='ce-win') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-aarch64') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-darwin') mx_sdk_vm.register_vm_config('ce', ce_components, _suite, env_file='ce-darwin-aarch64') From 82331c1e230fd598ad186945631c6a52c66d8705 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 15 Feb 2023 16:21:04 +0100 Subject: [PATCH 6/6] Update more docs after including `native-image`. --- .../graalvm-community/get-started-graalvm-community.md | 2 +- docs/getting-started/graalvm-community/windows.md | 2 +- .../graalvm-enterprise/get-started-graalvm-enterprise.md | 2 +- docs/getting-started/graalvm-enterprise/installation-windows.md | 2 +- docs/reference-manual/java-on-truffle/Demos.md | 1 - .../guides/build-static-and-mostly-static-executable.md | 2 +- docs/reference-manual/native-image/guides/guides.md | 2 -- .../guides/use-reachability-metadata-repository-gradle.md | 2 -- 8 files changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/getting-started/graalvm-community/get-started-graalvm-community.md b/docs/getting-started/graalvm-community/get-started-graalvm-community.md index 2a459d2e5c09..ae29aceacc44 100644 --- a/docs/getting-started/graalvm-community/get-started-graalvm-community.md +++ b/docs/getting-started/graalvm-community/get-started-graalvm-community.md @@ -286,7 +286,7 @@ For more information on running polyglot applications, see [Polyglot Programming ## Native Image -With GraalVM [Native Image](../../reference-manual/native-image/README.md) you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and smaller footprint for your application. +With [Native Image](../../reference-manual/native-image/README.md) you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and smaller footprint for your application. The `HelloWorld` example from above is used here to demonstrate how to generate a native executable: ```java diff --git a/docs/getting-started/graalvm-community/windows.md b/docs/getting-started/graalvm-community/windows.md index bde754381ba3..92f4baf4c524 100644 --- a/docs/getting-started/graalvm-community/windows.md +++ b/docs/getting-started/graalvm-community/windows.md @@ -51,7 +51,7 @@ To run GraalVM Community Edition based on OpenJDK 8u292 on a Windows platform, t ## Supported Functionalities The GraalVM Community distribution for Windows platforms includes OpenJDK with the GraalVM compiler enabled, the [GraalVM Updater](../../reference-manual/graalvm-updater.md) tool to install additional functionalities and the developer tools (e.g., Chrome inspector based debugger, Profiler, etc.). -Currently, the GraalVM environment on Windows can be extended with [Native Image](../../reference-manual/native-image/README.md), [Java on Truffle](../../reference-manual/java-on-truffle/README.md), [LLVM runtime](../../reference-manual/llvm/README.md), WebAssembly, JavaScript and Node.js support. +Currently, the GraalVM environment on Windows can be extended with [Java on Truffle](../../reference-manual/java-on-truffle/README.md), [LLVM runtime](../../reference-manual/llvm/README.md), WebAssembly, JavaScript, and Node.js support. ## Prerequisites for Using Native Image on Windows On Windows, Native Image requires Visual Studio and Microsoft Visual C++(MSVC). diff --git a/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md b/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md index 444af109de2f..29ac8e56dfe2 100644 --- a/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md +++ b/docs/getting-started/graalvm-enterprise/get-started-graalvm-enterprise.md @@ -285,7 +285,7 @@ More details can be found in the [WebAssembly reference manual](../../reference- ## Native Image -With GraalVM [Native Image](../../reference-manual/native-image/README.md) Enterprise you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and a smaller footprint for your application. +With [Native Image](../../reference-manual/native-image/README.md) Enterprise you can compile Java bytecode into a platform-specific, self-contained, native executable to achieve faster startup and a smaller footprint for your application. The `HelloWorld` example from above is used here to demonstrate how to generate a native executable: ```java diff --git a/docs/getting-started/graalvm-enterprise/installation-windows.md b/docs/getting-started/graalvm-enterprise/installation-windows.md index 6bc3cb24fa9e..724dc4f7f800 100644 --- a/docs/getting-started/graalvm-enterprise/installation-windows.md +++ b/docs/getting-started/graalvm-enterprise/installation-windows.md @@ -46,7 +46,7 @@ Repeat the same for the `PATH` environment variable. ## Supported Functionalities The GraalVM Enterprise distribution for Windows platforms includes Oracle JDK with the GraalVM compiler enabled, the [GraalVM Updater](../../reference-manual/graalvm-updater.md) tool to install additional functionalities and the developer tools (e.g., Chrome inspector based debugger, Profiler, etc.). -Currently, the GraalVM environment on Windows can be extended with [Native Image](../../reference-manual/native-image/README.md), [Java on Truffle](../../reference-manual/java-on-truffle/README.md), [LLVM runtime](../../reference-manual/llvm/README.md), WebAssembly, JavaScript and Node.js support. +Currently, the GraalVM environment on Windows can be extended with [Java on Truffle](../../reference-manual/java-on-truffle/README.md), [LLVM runtime](../../reference-manual/llvm/README.md), WebAssembly, JavaScript, and Node.js support. ## Prerequisites for Using Native Image on Windows On Windows, Native Image requires Visual Studio and Microsoft Visual C++(MSVC). diff --git a/docs/reference-manual/java-on-truffle/Demos.md b/docs/reference-manual/java-on-truffle/Demos.md index 717dd407b8cc..c2cfda1c1ccf 100644 --- a/docs/reference-manual/java-on-truffle/Demos.md +++ b/docs/reference-manual/java-on-truffle/Demos.md @@ -35,7 +35,6 @@ This design naturally fits the point we are trying to illustrate. We can build a Prerequisites: * [Latest GraalVM](https://www.graalvm.org/downloads/) -* [Native Image](../native-image/README.md#install-native-image) * [Java on Truffle](README.md#install-java-on-truffle) 1. Clone the [project](https://github.com/graalvm/graalvm-demos) with the demo applications and navigate to the `espresso-jshell` directory: diff --git a/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md b/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md index 57aebfc929b2..7a9eb3e01af4 100644 --- a/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md +++ b/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md @@ -33,7 +33,7 @@ This guide shows how you can take advantage of Native Image linking options incl The following prerequisites should be met: - Linux AMD64 operating system -- GraalVM distribution for Java 11 of higher with [Native Image support](../README.md#install-native-image) +- GraalVM distribution for Java 17 of higher - A 64-bit `musl` toolchain, `make`, and `configure` - The latest `zlib` library diff --git a/docs/reference-manual/native-image/guides/guides.md b/docs/reference-manual/native-image/guides/guides.md index c33cdc6e4168..b55a1c40f6c8 100644 --- a/docs/reference-manual/native-image/guides/guides.md +++ b/docs/reference-manual/native-image/guides/guides.md @@ -38,5 +38,3 @@ Here you will learn how to: - Build a Native Executable from a Quarkus Application - Build a Native Executable from a Helidon MP Application - Build a Native Executable from a Helidon SP Application - -> Note: To follow these guides, a user is expected to have [GraalVM installed with Native Image support](../README.md#install-native-image). \ No newline at end of file diff --git a/docs/reference-manual/native-image/guides/use-reachability-metadata-repository-gradle.md b/docs/reference-manual/native-image/guides/use-reachability-metadata-repository-gradle.md index 49a609dc52a5..eb3a9813126d 100644 --- a/docs/reference-manual/native-image/guides/use-reachability-metadata-repository-gradle.md +++ b/docs/reference-manual/native-image/guides/use-reachability-metadata-repository-gradle.md @@ -25,8 +25,6 @@ The goal is to show users the difference, and prove how using shared metadata ca We recommend that you follow the instructions and create the application step-by-step. Alternatively, you can go right to the [completed example](https://github.com/graalvm/native-build-tools/tree/master/samples/metadata-repo-integration). -> You must have [GraalVM installed with Native Image support](../README.md#install-native-image). - ## Prepare a Demo Application 1. Create a new Java project with **Gradle** in your favorite IDE, called "H2Example", in the `org.graalvm.example` package.