Skip to content

Commit bbc7266

Browse files
committed
[GR-66120] Remove the polyglot launcher and libpolyglot
PullRequest: graal/21127
2 parents f5f839e + 1a42ca5 commit bbc7266

File tree

18 files changed

+30
-328
lines changed

18 files changed

+30
-328
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ jobs:
152152
PRIMARY: "vm"
153153
DYNAMIC_IMPORTS: "/sulong,/substratevm"
154154
NATIVE_IMAGES: "graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,lib:llvmvm"
155-
DISABLE_POLYGLOT: true
156-
DISABLE_LIBPOLYGLOT: true
157155
- env:
158156
JDK_VERSION: "latest"
159157
GATE_TAGS: "build"

docs/reference-manual/llvm/Interoperability.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ cpart.freeNativePoint(point);
8989
cpart.freeNativePoint(pointArray);
9090
```
9191

92-
Finally, run this JavaScript file:
92+
Finally, run this JavaScript file on a [GraalJS JVM standalone](https://github.com/oracle/graaljs/releases):
9393
```shell
94+
js-polyglot-get llvm
9495
js --polyglot jspart.js
9596
Point<5.000000,7.000000>
9697
Point<3.000000,6.000000>

espresso-compiler-stub/mx.espresso-compiler-stub/espresso-ni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
DYNAMIC_IMPORTS=/vm,/substratevm
33
COMPONENTS=Java on Truffle,Espresso Standalone jvm.cfg,SubstrateVM,tflm,ni,sdkni,svmt,svmsl,tflc,tflsm,ecs
44
NATIVE_IMAGES=lib:javavm
5-
DISABLE_LIBPOLYGLOT=true

espresso-compiler-stub/mx.espresso-compiler-stub/espresso-ni-jvm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
DYNAMIC_IMPORTS=/vm,/substratevm
33
COMPONENTS=Espresso Launcher,LibGraal,Java on Truffle,SubstrateVM,Java on Truffle LLVM Java libraries,tflm,ni,sdkni,svmt,svmsl,tflc,tflsm,ecs
44
NATIVE_IMAGES=lib:jvmcicompiler
5-
DISABLE_LIBPOLYGLOT=true

espresso/mx.espresso/mx_espresso.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,6 @@ def contents(self):
429429
truffle_jars=['espresso:ESPRESSO', 'espresso-shared:ESPRESSO_SHARED'],
430430
support_distributions=['espresso:ESPRESSO_GRAALVM_SUPPORT'],
431431
library_configs=[espresso_library_config],
432-
polyglot_lib_jar_dependencies=['espresso:LIB_JAVAVM'],
433-
has_polyglot_lib_entrypoints=True,
434432
priority=1,
435433
stability=_espresso_stability,
436434
))

sdk/mx.sdk/mx_sdk_vm.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ def __init__(self,
320320
self.third_party_license_files = third_party_license_files
321321
self.dependency_names = dependencies or []
322322
self.provided_executables = provided_executables or []
323-
self.polyglot_lib_build_args = polyglot_lib_build_args or []
324-
self.polyglot_lib_jar_dependencies = polyglot_lib_jar_dependencies or []
325-
self.polyglot_lib_build_dependencies = polyglot_lib_build_dependencies or []
326-
self.has_polyglot_lib_entrypoints = has_polyglot_lib_entrypoints
323+
self.polyglot_lib_build_args = []
324+
self.polyglot_lib_jar_dependencies = []
325+
self.polyglot_lib_build_dependencies = []
326+
self.has_polyglot_lib_entrypoints = False
327327
self.boot_jars = boot_jars or []
328328
self.jvmci_parent_jars = jvmci_parent_jars or []
329329
self.jar_distributions = jar_distributions or []
@@ -372,16 +372,11 @@ def __init__(self,
372372
assert isinstance(self.license_files, list)
373373
assert isinstance(self.third_party_license_files, list)
374374
assert isinstance(self.provided_executables, list)
375-
assert isinstance(self.polyglot_lib_build_args, list)
376-
assert isinstance(self.polyglot_lib_jar_dependencies, list)
377-
assert isinstance(self.polyglot_lib_build_dependencies, list)
378375
assert isinstance(self.boot_jars, list)
379376
assert isinstance(self.jvmci_parent_jars, list)
380377
assert isinstance(self.launcher_configs, list)
381378
assert isinstance(self.library_configs, list)
382379

383-
assert not any(cp_arg in self.polyglot_lib_build_args for cp_arg in ('-cp', '-classpath')), "the '{}' component passes a classpath argument to libpolylgot: '{}'. Use `polyglot_lib_jar_dependencies` instead".format(self.name, ' '.join(self.polyglot_lib_build_args))
384-
385380
def __str__(self):
386381
return "{} ({})".format(self.name, self.dir_name)
387382

@@ -1174,7 +1169,7 @@ def verify_graalvm_configs(suites=None, start_from=None, check_all=False):
11741169
"""
11751170
import mx_sdk_vm_impl
11761171
child_env = os.environ.copy()
1177-
for env_var in ['DYNAMIC_IMPORTS', 'DEFAULT_DYNAMIC_IMPORTS', 'COMPONENTS', 'EXCLUDE_COMPONENTS', 'SKIP_LIBRARIES', 'NATIVE_IMAGES', 'FORCE_BASH_LAUNCHERS', 'DISABLE_POLYGLOT', 'DISABLE_LIBPOLYGLOT']:
1172+
for env_var in ['DYNAMIC_IMPORTS', 'DEFAULT_DYNAMIC_IMPORTS', 'COMPONENTS', 'EXCLUDE_COMPONENTS', 'SKIP_LIBRARIES', 'NATIVE_IMAGES', 'FORCE_BASH_LAUNCHERS']:
11781173
if env_var in child_env:
11791174
del child_env[env_var]
11801175
started = start_from is None

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 6 additions & 262 deletions
Large diffs are not rendered by default.

vm/README.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ The base GraalVM CE image includes:
3333
- Sulong
3434
- Graal.nodejs
3535
- Graal.js (imported as a dependency of `graal-nodejs`)
36-
- the `polyglot` launcher
37-
- the `libpolyglot` shared library
3836

3937
In our CI, we build it using:
4038
- the latest JVMCI-enabled JDK8 ([pre-built archives](https://github.com/graalvm/openjdk8-jvmci-builder/releases); [build instructions](https://github.com/graalvm/openjdk8-jvmci-builder)). The `JAVA_HOME` environment variable must point to it.
@@ -54,21 +52,19 @@ Which uses the settings in the env file in `mx.vm/ce`. Note that you can add cus
5452

5553
2.
5654
```bash
57-
$ mx --dynamicimports /substratevm,/tools,/sulong,/graal-nodejs --exclude-components=nju,nic,ni,nil,llp --force-bash-launchers=polyglot build
55+
$ mx --dynamicimports /substratevm,/tools,/sulong,/graal-nodejs --exclude-components=nju,nic,ni,nil,llp build
5856
```
5957

6058
3.
6159
```bash
6260
$ export DEFAULT_DYNAMIC_IMPORTS=/substratevm,/tools,/sulong,/graal-nodejs
6361
$ export EXCLUDE_COMPONENTS=nju,nic,ni,nil,llp
64-
$ export FORCE_BASH_LAUNCHERS=polyglot
6562
$ mx build
6663
```
6764
or:
6865
```bash
6966
$ export DYNAMIC_IMPORTS=/substratevm,/tools,/sulong,/graal-nodejs
7067
$ export EXCLUDE_COMPONENTS=nju,nic,ni,nil,llp
71-
$ export FORCE_BASH_LAUNCHERS=polyglot
7268
$ mx build
7369
```
7470
Note that the suites listed in:
@@ -88,41 +84,26 @@ creates:
8884

8985

9086
## Native images
91-
When `substratevm` is imported, the build system creates native launchers for the supported languages and for `polyglot`, plus the shared polyglot library (`libpolyglot`).
92-
Otherwise, it creates bash launchers for the languages and for `polyglot`, and does not create the shared polyglot library.
87+
When `substratevm` is imported, the build system creates native launchers for the supported languages.
88+
Otherwise, it creates bash launchers for the languages.
9389

9490
To override the default behavior, the `vm` suite defines the following `mx` arguments:
9591
```
96-
--native-images=... Comma-separated list of launchers and libraries (syntax: lib:polyglot) to build with Native Image.
97-
--disable-libpolyglot Disable the 'polyglot' library project
98-
--disable-polyglot Disable the 'polyglot' launcher project
92+
--native-images=... Comma-separated list of launchers and libraries (syntax: lib:jsvm) to build with Native Image.
9993
--force-bash-launchers=... Force the use of bash launchers instead of native images.
10094
This can be a comma-separated list of disabled launchers or `true` to disable all native launchers.
10195
```
10296
And the following environment variables:
10397
```
10498
NATIVE_IMAGES Same as '--native-images'
105-
DISABLE_LIBPOLYGLOT Same as '--disable-libpolyglot'
106-
DISABLE_POLYGLOT Same as '--disable-polyglot'
10799
FORCE_BASH_LAUNCHERS Same as '--force-bash-launchers'
108100
```
109101

110-
Note that when the shared polyglot library is not built, Graal.nodejs can only work in JVM-mode (`node --jvm [args]`).
111-
112-
113-
### Example: avoid building the polyglot image and the polyglot shared library
114-
115-
```bash
116-
$ mx --disable-polyglot --disable-libpolyglot --dynamicimports /substratevm,/tools,/sulong,/graal-js build
117-
```
118-
builds the native SubstrateVM launchers for native-image, Graal.js, and Sulong, but no polyglot launcher and polyglot library.
119-
120-
121102
### Example: force bash launchers
122103
```bash
123104
$ mx --force-bash-launchers=true --dynamicimports /substratevm,/tools,/sulong,/graal-nodejs build
124105
```
125-
builds the native SubstrateVM launcher for native-image, and creates bash launchers for Sulong, Graal.js, and `polyglot`
106+
builds the native SubstrateVM launcher for native-image, and creates bash launchers for Sulong and Graal.js
126107

127108
### Example: build only TruffleRuby with bash launchers
128109
```bash

vm/ci/ci_common/common.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ local devkits = graal_common.devkits;
557557
local sulong_vm_tests = graal_common.deps.svm + graal_common.deps.sulong + vm.custom_vm + self.vm_base('linux', 'amd64', 'gate') + {
558558
run: [
559559
['export', 'SVM_SUITE=' + vm.svm_suite],
560-
['mx', '--dynamicimports', '$SVM_SUITE,/sulong', '--disable-polyglot', '--disable-libpolyglot', 'gate', '--no-warning-as-error', '--tags', 'build,sulong'],
560+
['mx', '--dynamicimports', '$SVM_SUITE,/sulong', 'gate', '--no-warning-as-error', '--tags', 'build,sulong'],
561561
],
562562
timelimit: '1:00:00',
563563
name: 'gate-vm-native-sulong-' + self.jdk_name + '-linux-amd64',

vm/mx.vm/ce-espresso

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mx --dy /espresso,/substratevm,/regex,/tools --components="Espresso libjvm,Espresso Standalone jvm.cfg,Java on Truffle,Truffle Macro,GraalVM license files,TRegex,suite:tools" --disable-libpolyglot --non-rebuildable-images=lib:javavm graalvm-show --print-env
1+
# mx --dy /espresso,/substratevm,/regex,/tools --components="Espresso libjvm,Espresso Standalone jvm.cfg,Java on Truffle,Truffle Macro,GraalVM license files,TRegex,suite:tools" --non-rebuildable-images=lib:javavm graalvm-show --print-env
22
DYNAMIC_IMPORTS=/espresso,/regex,/sdk,/substratevm,/tools,/truffle,/vm
33
COMPONENTS=cov,dap,ejc,ejvm,gvm,icu4j,ins,insight,insightheap,java,lsp,nfi,nfi-libffi,pro,rgx,sdk,sdkc,sdkl,sdkni,tfl,tfla,tflc,tflm,truffle-json
44
EXCLUDE_COMPONENTS=libpoly

vm/mx.vm/ce-llvm-espresso

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mx --dy /espresso,/substratevm,/sulong,/regex,/tools --components="Espresso libjvm,Espresso Standalone jvm.cfg,Java on Truffle LLVM Java libraries,Java on Truffle,LLVM Runtime Native,LLVM.org toolchain,Truffle Macro,GraalVM license files,TRegex,suite:tools" --disable-libpolyglot --non-rebuildable-images=lib:javavm graalvm-show --print-env
1+
# mx --dy /espresso,/substratevm,/sulong,/regex,/tools --components="Espresso libjvm,Espresso Standalone jvm.cfg,Java on Truffle LLVM Java libraries,Java on Truffle,LLVM Runtime Native,LLVM.org toolchain,Truffle Macro,GraalVM license files,TRegex,suite:tools" --non-rebuildable-images=lib:javavm graalvm-show --print-env
22
DYNAMIC_IMPORTS=/espresso,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/vm
33
COMPONENTS=antlr4,cov,dap,ejc,ejvm,ellvm,gvm,icu4j,ins,insight,insightheap,java,llp,llrc,llrlf,llrn,lsp,nfi,nfi-libffi,pro,rgx,sdk,sdkc,sdkl,sdkni,tfl,tfla,tflc,tflm,truffle-json
44
EXCLUDE_COMPONENTS=libpoly

vm/mx.vm/mx_vm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def local_path_to_url(args):
150150
mx_sdk_vm.register_vm_config('community', ce_unchained_components, _suite, env_file='ce')
151151
# Other GraalVMs
152152
mx_sdk_vm.register_vm_config('ce', ce_components + ['icu4j', 'xz', 'js', 'jsl', 'jss', 'rgx', 'bnative-image', 'snative-image-agent', 'snative-image-diagnostics-agent', 'tflsm'], _suite, dist_name='ce-js', env_file='ce-js')
153-
mx_sdk_vm.register_vm_config('ce', ce_components + ['gwal', 'gwa', 'icu4j', 'xz', 'js', 'jsl', 'jss', 'libpoly', 'njs', 'njsl', 'rgx', 'sjsvm', 'spolyglot', 'swasmvm'], _suite, dist_name='ce', env_file='ce-nodejs')
153+
mx_sdk_vm.register_vm_config('ce', ce_components + ['gwal', 'gwa', 'icu4j', 'xz', 'js', 'jsl', 'jss', 'njs', 'njsl', 'rgx', 'sjsvm', 'swasmvm'], _suite, dist_name='ce', env_file='ce-nodejs')
154154
mx_sdk_vm.register_vm_config('ce', ce_components_minimal + ['antlr4', 'llrn', 'llp', 'llrc', 'llrl', 'llrlf'], _suite, env_file='ce-llvm')
155155
mx_sdk_vm.register_vm_config('ce-python', ce_python_components, _suite)
156156
mx_sdk_vm.register_vm_config('ce-fastr', ce_fastr_components, _suite)

vm/tests/all/agentscript/agent-exception.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ good you are?
5959
.*at <js> log.log.js:1-6:.*
6060
.*at <js> areYouBad.log.js:26:.*
6161
.*at <js> :program.<eval_script>:1:0-10.
62-
>[1] js --polyglot --jvm --insight=agent-error2.rb log.js
62+
>[1] js --jvm --polyglot --insight=agent-error2.rb log.js
6363
insight: Unknown attribute misnamedAttribute
6464
>[1] js --jvm --insight=agent-error3.js log.js
6565
insight: Unknown event type 'enterOrLeave'.*

vm/tests/all/agentscript/agent-lli.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#
2424
>[0?] export TOOLCHAIN_PATH=`lli --print-toolchain-path`
2525
>[0?] ${TOOLCHAIN_PATH}/clang agent-sieve.c -g -O0 -lm -o ${TMP_DIR}/sieve
26-
>[1] lli --polyglot --insight=agent-limit.js --experimental-options ${TMP_DIR}/sieve
26+
>[1] lli --jvm --polyglot --insight=agent-limit.js --experimental-options ${TMP_DIR}/sieve
2727
found new prime number (<unavailable>|2)
2828
found new prime number (<unavailable>|3)
2929
found new prime number (<unavailable>|5)

vm/tests/all/agentscript/agent-python.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Python: Insight version 1.2 is launching
2828
Python: Hooks are ready!
2929
Python: observed loading of test.py
3030
Ahoj
31-
> js --polyglot --insight=agent-python.py --experimental-options agent-fib.js
31+
> js --jvm --polyglot --insight=agent-python.py --experimental-options agent-fib.js
3232
Python: Insight version 1.2 is launching
3333
Python: Hooks are ready!
3434
Python: observed loading of agent-fib.js

vm/tests/all/agentscript/agent-r.test

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,15 @@ Ahoj
5353
2 calls to cat
5454
2 calls to stdout
5555
===================
56-
> Rscript --polyglot --insight=agent-histogram.js ${TMP_DIR}/fib.R
57-
8
58-
==== Histogram ====
59-
15 calls to fib
60-
3 calls to <repl wrapper>
61-
2 calls to cat
62-
2 calls to stdout
63-
===================
6456
> cat > ${TMP_DIR}/test.js
6557
< print('hi js!')
66-
> polyglot --jvm --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.js
58+
> js --jvm --polyglot --agentscript=agent-r.R --experimental-options ${TMP_DIR}/test.js
6759
Warning.*agentscript.*deprecated.*insight.*
6860
R: Initializing GraalVM Insight script
6961
R: Hooks are ready!
7062
R: observed loading of.*test.js
7163
hi js!
72-
> polyglot --jvm --insight=agent-r.R ${TMP_DIR}/test.js
73-
R: Initializing GraalVM Insight script
74-
R: Hooks are ready!
75-
R: observed loading of.*test.js
76-
hi js!
77-
> polyglot --insight=agent-r.R ${TMP_DIR}/test.js
64+
> js --jvm --polyglot --insight=agent-r.R ${TMP_DIR}/test.js
7865
R: Initializing GraalVM Insight script
7966
R: Hooks are ready!
8067
R: observed loading of.*test.js

vm/tests/all/agentscript/agent-ruby-dump.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
>[0] javac -cp $CP HeapQuery.java
2626
#> export TMP_DIR=/tmp
2727
> rm -rf /tmp/ruby*hprof*
28-
> truffleruby --polyglot --heap.dump=$TMP_DIR/ruby.hprof --insight=agent-ruby-dump.js hello-world.rb
28+
> truffleruby --jvm --polyglot --heap.dump=$TMP_DIR/ruby.hprof --insight=agent-ruby-dump.js hello-world.rb
2929
dumping state of Ruby memory when executing Welcome#welcome
3030
Hello World!
3131
# check one frame was captured

vm/tests/all/agentscript/agent-ruby.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Ruby: Insight version 1.2 is launching
2828
Ruby: Hooks are ready!
2929
Ruby: observed loading of .*test.rb
3030
Ahoj
31-
> js --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js
31+
> js --jvm --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js
3232
Ruby: Insight version 1.2 is launching
3333
Ruby: Hooks are ready!
3434
Ruby: observed loading of agent-fib.js
@@ -37,4 +37,4 @@ minusOne 3
3737
minusOne 2
3838
minusOne 2
3939
Three is the result 3
40-
# >[0?] node --js.print --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js
40+
# >[0?] node --js.print --jvm --polyglot --insight=agent-ruby.rb --experimental-options agent-fib.js

0 commit comments

Comments
 (0)