Skip to content

Commit a3bb302

Browse files
Replace JAVA_OPTS variable with JAVA_TOOL_OPTIONS (#13256)
1 parent 15fcf14 commit a3bb302

File tree

23 files changed

+54
-57
lines changed

23 files changed

+54
-57
lines changed

.github/workflows/enso4igv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
# Why do we subtract a number? Read versioning policy!
138138
# https://github.com/enso-org/enso/pull/7861#discussion_r1333133490
139139
echo "POM_VERSION=`mvn -q -DforceStdout help:evaluate -Dexpression=project.version | cut -f1 -d -`" >> "$GITHUB_ENV"
140-
echo "MICRO_VERSION=`expr $GITHUB_RUN_NUMBER - 6930`" >> "$GITHUB_ENV"
140+
echo "MICRO_VERSION=`expr $GITHUB_RUN_NUMBER - 8460`" >> "$GITHUB_ENV"
141141
142142
- name: Update project version
143143
working-directory: tools/enso4igv

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@
6868
[JavaScript](https://www.graalvm.org/javascript/) and
6969
[Python](https://www.graalvm.org/python/)) to version `24.2.0`.
7070
- [Upgrade GraalVM from JDK 21 to JDK 24][12855]
71+
- [Use JAVA_TOOL_OPTIONS env variable to alter JVM arguments][13256]
7172

7273
[12500]: https://github.com/enso-org/enso/pull/12500
7374
[12976]: https://github.com/enso-org/enso/pull/12976
7475
[12855]: https://github.com/enso-org/enso/pull/12855
7576
[12905]: https://github.com/enso-org/enso/pull/12905
7677
[13225]: https://github.com/enso-org/enso/pull/13225
78+
[13256]: https://github.com/enso-org/enso/pull/13256
7779

7880
# Enso 2025.1
7981

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4322,7 +4322,8 @@ lazy val `os-environment` =
43224322
val exeFile =
43234323
(Test / target).value / ("test-os-env" + exeSuffix)
43244324
val binPath = exeFile.getAbsolutePath
4325-
val res = Process(Seq(binPath), None, "JAVA_OPTS" -> "") ! logger
4325+
val res =
4326+
Process(Seq(binPath), None, "JAVA_TOOL_OPTIONS" -> "") ! logger
43264327
if (res != 0) {
43274328
logger.error("Some test in os-environment failed")
43284329
throw new TestsFailedException()

build_tools/build/src/enso.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl From<bool> for Boolean {
3737
}
3838

3939
ide_ci::define_env_var! {
40-
JAVA_OPTS, String;
40+
JAVA_TOOL_OPTIONS, String;
4141
ENSO_BENCHMARK_TEST_DRY_RUN, Boolean;
4242
}
4343

@@ -131,7 +131,10 @@ impl BuiltEnso {
131131
.arg(test_path.as_ref())
132132
// This flag enables assertions in the JVM. Some of our stdlib tests had in the past
133133
// failed on Graal/Truffle assertions, so we want to have them triggered.
134-
.set_env(JAVA_OPTS, &ide_ci::programs::java::Option::EnableAssertions.as_ref())?;
134+
.set_env(
135+
JAVA_TOOL_OPTIONS,
136+
&ide_ci::programs::java::Option::EnableAssertions.as_ref(),
137+
)?;
135138

136139
for (k, v) in environment_overrides {
137140
command.env(k, &v);

distribution/bin/enso

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
COMP_PATH=$(dirname "$0")/../component
2-
3-
JAVA_OPTS="--enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED $JAVA_OPTS"
2+
JAVA_OPTS="--enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED"
43
exec java --module-path $COMP_PATH $JAVA_OPTS -m org.enso.runner/org.enso.runner.Main "$@"
54
exit

distribution/bin/enso.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
22
set comp-dir=%~dp0\..\component
3-
set JAVA_OPTS=%JAVA_OPTS% --enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED
4-
java --module-path %comp-dir% -Dpolyglot.compiler.IterativePartialEscape=true %JAVA_OPTS% -m org.enso.runner/org.enso.runner.Main %*
3+
set java-opts=-Dpolyglot.compiler.IterativePartialEscape=true --enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED
4+
java --module-path %comp-dir% %java-opts% -m org.enso.runner/org.enso.runner.Main %*
55
exit /B %errorlevel%

docs/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ To run with a debugger first start the debugger listening on 5005, add a
493493
breakpoint in a test then run with
494494
495495
```bash
496-
JAVA_OPTS='-agentlib:jdwp=transport=dt_socket,server=n,address=5005' enso --run test/Base_Tests/src/Data/Time/Duration_Spec.enso
496+
JAVA_TOOL_OPTIONS='-agentlib:jdwp=transport=dt_socket,server=n,address=5005' enso --run test/Base_Tests/src/Data/Time/Duration_Spec.enso
497497
```
498498
499499
The Database tests will by default only test the SQLite backend, to test other
@@ -510,7 +510,7 @@ LANG=C enso --run test/Base_Tests
510510
```
511511
512512
Note that JVM assertions are not enabled by default, one has to pass `-ea` via
513-
`JAVA_OPTS` environment variable. There are also Enso-specific assertions
513+
`JAVA_TOOL_OPTIONS` environment variable. There are also Enso-specific assertions
514514
(method `Runtime.assert`) that can be enabled when `ENSO_ENABLE_ASSERTIONS`
515515
environment variable is set to "true". If JVM assertions are enable, Enso
516516
assertions are enabled as well.

docs/debugger/chrome-devtools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ the rest of the environment.
3636

3737
## Tips and tricks
3838

39-
- Use `env JAVA_OPTS=-Dpolyglot.inspect.Path=enso_debug` to set the chrome to
40-
use a fixed URL. In this case the URL is
39+
- Use `env JAVA_TOOL_OPTIONS=-Dpolyglot.inspect.Path=enso_debug` to set the
40+
chrome to use a fixed URL. In this case the URL is
4141
`devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9229/enso_debug`

docs/debugger/dap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ protocol for VSCode and as such, works only via VSCode. To start Enso with DAP
66
server waiting for a client to attach, launch enso via:
77

88
```
9-
env JAVA_OPTS='-Dpolyglot.dap' ./built-distribution/enso-engine-*/enso-*/bin/enso --run *.enso
9+
env JAVA_TOOL_OPTIONS='-Dpolyglot.dap' ./built-distribution/enso-engine-*/enso-*/bin/enso --run *.enso
1010
```
1111

1212
Once DAP server is started and ready for a client to be attached, the following

docs/debugger/runtime-debugging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ sbt:enso> runEngineDistribution --debug --run ./test/Base_Tests/src/Data/Numbers
3434
```
3535

3636
The second options gives one a complete control as it launches everything from a
37-
command line. By specifying `JAVA_OPTS` environment variable one influences the
38-
special JVM arguments when launching the `bin/enso` from the engine
39-
distribution:
37+
command line. By specifying `JAVA_TOOL_OPTIONS` environment variable one
38+
influences the special JVM arguments when launching the `bin/enso` from the
39+
engine distribution:
4040

4141
```bash
42-
enso$ JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=n,address=5005 ./built-distribution/enso-engine-*/enso-*/bin/enso --run ./test/Base_Tests/src/Data/Numbers_Spec.enso
42+
enso$ JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=n,address=5005 ./built-distribution/enso-engine-*/enso-*/bin/enso --run ./test/Base_Tests/src/Data/Numbers_Spec.enso
4343
```
4444

4545
Both of the approaches launch the JVM in a _debug mode_. Once the JVM is

0 commit comments

Comments
 (0)