Skip to content

Commit 9fa2f91

Browse files
[GR-65272] [GR-65273] [GR-65270] Fixes for some benchmark and coverage jobs after espresso unchained build migration.
PullRequest: graal/20886
2 parents 64d1fc8 + f96235d commit 9fa2f91

File tree

10 files changed

+499
-12
lines changed

10 files changed

+499
-12
lines changed

espresso-shared/mx.espresso-shared/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"read" : "https://github.com/oracle/graal.git",
4141
"write" : "[email protected]:oracle/graal.git",
4242
},
43+
"ignore_suite_commit_info": True,
4344

4445
# ------------- licenses
4546

espresso/.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@
4646
*.idb
4747
*.pdb
4848

49-
# Kernel Module Compile Results
50-
*.mod*
51-
*.cmd
52-
.tmp_versions/
53-
modules.order
54-
Module.symvers
55-
Mkfile.old
56-
dkms.conf
57-
5849
### Eclipse ###
5950

6051
.metadata

espresso/docs/hacking.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ You can find out where the espresso standalones are by running `mx path --output
4949
$ mx path --output ESPRESSO_NATIVE_STANDALONE
5050
$ mx path --output ESPRESSO_JVM_STANDALONE
5151
```
52+
> Note: If you used options like `--env ...` or `--dynamicimports ...` while building, you should also use them with `mx path`: e.g., `mx --env native-ce path ...`.
5253
5354
`mx espresso` runs Espresso from a standalone (jvm or native). It mimics the `java` command.
5455

@@ -68,7 +69,7 @@ The `mx espresso` launcher adds some overhead, to execute Espresso native image
6869

6970
```bash
7071
$ mx --env native-ce build # Always build first
71-
$ export ESPRESSO=`mx path --output ESPRESSO_NATIVE_STANDALONE`/bin/java
72+
$ export ESPRESSO=`mx --quiet --no-warning --env native-ce path --output ESPRESSO_NATIVE_STANDALONE`/bin/java
7273
$ time $ESPRESSO -cp my.jar HelloWorld
7374
```
7475

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
::
2+
:: ----------------------------------------------------------------------------------------------------
3+
::
4+
:: Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
5+
:: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6+
::
7+
:: This code is free software; you can redistribute it and/or modify it
8+
:: under the terms of the GNU General Public License version 2 only, as
9+
:: published by the Free Software Foundation. Oracle designates this
10+
:: particular file as subject to the "Classpath" exception as provided
11+
:: by Oracle in the LICENSE file that accompanied this code.
12+
::
13+
:: This code is distributed in the hope that it will be useful, but WITHOUT
14+
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15+
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16+
:: version 2 for more details (a copy is included in the LICENSE file that
17+
:: accompanied this code).
18+
::
19+
:: You should have received a copy of the GNU General Public License version
20+
:: 2 along with this work; if not, write to the Free Software Foundation,
21+
:: Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22+
::
23+
:: Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
24+
:: or visit www.oracle.com if you need additional information or have any
25+
:: questions.
26+
::
27+
:: ----------------------------------------------------------------------------------------------------
28+
@echo off
29+
30+
setlocal enabledelayedexpansion
31+
32+
call :getScriptLocation location
33+
34+
35+
"%location%\espresso" %*
36+
37+
exit /b %errorlevel%
38+
:: Function are defined via labels, so have to be defined at the end of the file and skipped
39+
:: in order not to be executed.
40+
41+
:: If this script is in `%PATH%` and called quoted without a full path (e.g., `"java"`), `%~dp0` is expanded to `cwd`
42+
:: rather than the path to the script.
43+
:: This does not happen if `%~dp0` is accessed in a subroutine.
44+
:getScriptLocation variableName
45+
set "%~1=%~dp0"
46+
exit /b 0
47+
48+
endlocal
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# This code is free software; you can redistribute it and/or modify it
7+
# under the terms of the GNU General Public License version 2 only, as
8+
# published by the Free Software Foundation. Oracle designates this
9+
# particular file as subject to the "Classpath" exception as provided
10+
# by Oracle in the LICENSE file that accompanied this code.
11+
#
12+
# This code is distributed in the hope that it will be useful, but WITHOUT
13+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
# version 2 for more details (a copy is included in the LICENSE file that
16+
# accompanied this code).
17+
#
18+
# You should have received a copy of the GNU General Public License version
19+
# 2 along with this work; if not, write to the Free Software Foundation,
20+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
#
22+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23+
# or visit www.oracle.com if you need additional information or have any
24+
# questions.
25+
#
26+
source="${BASH_SOURCE[0]}"
27+
while [ -h "$source" ] ; do
28+
prev_source="$source"
29+
source="$(readlink "$source")";
30+
if [[ "$source" != /* ]]; then
31+
# if the link was relative, it was relative to where it came from
32+
dir="$( cd -P "$( dirname "$prev_source" )" && pwd )"
33+
source="$dir/$source"
34+
fi
35+
done
36+
location="$( cd -P "$( dirname "$source" )" && pwd )"
37+
exec "${location}/espresso" "${@}"
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
::
2+
:: ----------------------------------------------------------------------------------------------------
3+
::
4+
:: Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
5+
:: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6+
::
7+
:: This code is free software; you can redistribute it and/or modify it
8+
:: under the terms of the GNU General Public License version 2 only, as
9+
:: published by the Free Software Foundation. Oracle designates this
10+
:: particular file as subject to the "Classpath" exception as provided
11+
:: by Oracle in the LICENSE file that accompanied this code.
12+
::
13+
:: This code is distributed in the hope that it will be useful, but WITHOUT
14+
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15+
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16+
:: version 2 for more details (a copy is included in the LICENSE file that
17+
:: accompanied this code).
18+
::
19+
:: You should have received a copy of the GNU General Public License version
20+
:: 2 along with this work; if not, write to the Free Software Foundation,
21+
:: Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22+
::
23+
:: Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
24+
:: or visit www.oracle.com if you need additional information or have any
25+
:: questions.
26+
::
27+
:: ----------------------------------------------------------------------------------------------------
28+
@echo off
29+
30+
setlocal enabledelayedexpansion
31+
32+
call :getScriptLocation location
33+
34+
35+
:: The two white lines above this comment are significant.
36+
37+
set "jvm_args=--add-modules=ALL-DEFAULT"
38+
set "javac_args="
39+
40+
call :escape_args %*
41+
for %%a in (%args%) do (
42+
call :unescape_arg %%a
43+
call :process_arg !arg!
44+
if errorlevel 1 exit /b 1
45+
)
46+
47+
if "%VERBOSE_GRAALVM_LAUNCHERS%"=="true" echo on
48+
49+
"%location%\espresso" %jvm_args% -m jdk.compiler/com.sun.tools.javac.Main %javac_args%
50+
51+
exit /b %errorlevel%
52+
:: Function are defined via labels, so have to be defined at the end of the file and skipped
53+
:: in order not to be executed.
54+
55+
:escape_args
56+
set "args=%*"
57+
:: Without early exit on empty contents, substitutions fail.
58+
if "!args!"=="" exit /b 0
59+
set "args=%args:,=##GR_ESC_COMMA##%"
60+
set "args=%args:;=##GR_ESC_SEMI##%"
61+
:: Temporarily, so that args are split on '=' only.
62+
set "args=%args: =##GR_ESC_SPACE##%"
63+
:: Temporarily, otherwise we won't split on '=' inside quotes.
64+
set "args=%args:"=##GR_ESC_QUOTE##%"
65+
:: We can't replace equal using the variable substitution syntax.
66+
call :replace_equals %args%
67+
set "args=%args:##GR_ESC_SPACE##= %"
68+
set "args=%args:##GR_ESC_QUOTE##="%"
69+
exit /b 0
70+
71+
:replace_equals
72+
setlocal
73+
:: The argument passed to this function was split on =, because all other
74+
:: delimiters were replaced in escape_args.
75+
set "arg=%1"
76+
if "!arg!"=="" goto :end_replace_equals
77+
set "args=%1"
78+
shift
79+
:loop_replace_equals
80+
set "arg=%1"
81+
if "!arg!"=="" goto :end_replace_equals
82+
set "args=%args%##GR_ESC_EQUAL##%arg%"
83+
shift
84+
goto :loop_replace_equals
85+
:end_replace_equals
86+
endlocal & ( set "args=%args%" )
87+
exit /b 0
88+
89+
:unescape_arg
90+
set "arg=%*"
91+
set "arg=%arg:##GR_ESC_COMMA##=,%"
92+
set "arg=%arg:##GR_ESC_SEMI##=;%"
93+
set "arg=%arg:##GR_ESC_EQUAL##==%"
94+
exit /b 0
95+
96+
:is_quoted
97+
setlocal
98+
set "args=%*"
99+
set /a argslen=0
100+
for %%a in (%args%) do set /a argslen+=1
101+
if %argslen% gtr 1 (
102+
set "quoted=false"
103+
) else (
104+
if "!args:~0,1!!args:~-1!"=="""" ( set "quoted=true" ) else ( set "quoted=false" )
105+
)
106+
endlocal & ( set "quoted=%quoted%" )
107+
exit /b 0
108+
109+
:unquote_arg
110+
:: Sets %arg% to a version of the argument with outer quotes stripped, if present.
111+
call :is_quoted %*
112+
setlocal
113+
set "maybe_quoted=%*"
114+
if %quoted%==true ( set "arg=%~1" ) else ( set "arg=!maybe_quoted!" )
115+
endlocal & ( set "arg=%arg%" )
116+
exit /b 0
117+
118+
:process_vm_arg
119+
if %arg_quoted%==false (
120+
call :is_quoted %*
121+
set "arg_quoted=%quoted%"
122+
)
123+
call :unquote_arg %*
124+
set "vm_arg=%arg%"
125+
126+
if %arg_quoted%==true ( set "arg="%vm_arg%"" ) else ( set "arg=%vm_arg%" )
127+
set "jvm_args=%jvm_args% !arg!"
128+
exit /b 0
129+
130+
:process_arg
131+
set "original_arg=%*"
132+
call :unquote_arg !original_arg!
133+
set "arg_quoted=%quoted%"
134+
135+
if "!arg:~0,2!"=="-J" (
136+
set prefix=vm
137+
call :unquote_arg !arg:~2!
138+
call :process_vm_arg !arg!
139+
if errorlevel 1 exit /b 1
140+
) else (
141+
:: Use !original_arg! instead of !arg! to preserve surrounding quotes if present.
142+
set "launcher_args=%launcher_args% !original_arg!"
143+
)
144+
exit /b 0
145+
146+
:: If this script is in `%PATH%` and called quoted without a full path (e.g., `"java"`), `%~dp0` is expanded to `cwd`
147+
:: rather than the path to the script.
148+
:: This does not happen if `%~dp0` is accessed in a subroutine.
149+
:getScriptLocation variableName
150+
set "%~1=%~dp0"
151+
exit /b 0
152+
153+
endlocal
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# This code is free software; you can redistribute it and/or modify it
7+
# under the terms of the GNU General Public License version 2 only, as
8+
# published by the Free Software Foundation. Oracle designates this
9+
# particular file as subject to the "Classpath" exception as provided
10+
# by Oracle in the LICENSE file that accompanied this code.
11+
#
12+
# This code is distributed in the hope that it will be useful, but WITHOUT
13+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
# version 2 for more details (a copy is included in the LICENSE file that
16+
# accompanied this code).
17+
#
18+
# You should have received a copy of the GNU General Public License version
19+
# 2 along with this work; if not, write to the Free Software Foundation,
20+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
#
22+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23+
# or visit www.oracle.com if you need additional information or have any
24+
# questions.
25+
#
26+
source="${BASH_SOURCE[0]}"
27+
while [ -h "$source" ] ; do
28+
prev_source="$source"
29+
source="$(readlink "$source")";
30+
if [[ "$source" != /* ]]; then
31+
# if the link was relative, it was relative to where it came from
32+
dir="$( cd -P "$( dirname "$prev_source" )" && pwd )"
33+
source="$dir/$source"
34+
fi
35+
done
36+
location="$( cd -P "$( dirname "$source" )" && pwd )"
37+
38+
jvm_args=("--add-modules=ALL-DEFAULT")
39+
javac_args=()
40+
41+
process_arg() {
42+
if [[ "$1" == -J* ]]; then
43+
jvm_args+=("${1#-J}")
44+
else
45+
launcher_args+=("$1")
46+
fi
47+
}
48+
49+
for o in "$@"; do
50+
process_arg "$o"
51+
done
52+
53+
if [[ "${VERBOSE_GRAALVM_LAUNCHERS}" == "true" ]]; then
54+
set -x
55+
fi
56+
57+
exec "${location}/espresso" "${jvm_args[@]}" -m jdk.compiler/com.sun.tools.javac.Main "${javac_args[@]}"

espresso/mx.espresso/mx_espresso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _espresso_standalone_command(args, with_sulong=False, allow_jacoco=True, jdk
9595
+ jacoco_args
9696
# This is needed for Truffle since JEP 472: Prepare to Restrict the Use of JNI
9797
+ ['--enable-native-access=org.graalvm.truffle']
98-
+ [mx.distribution('ESPRESSO_LAUNCHER').mainClass] + args
98+
+ ["--module", "org.graalvm.espresso.launcher/" + mx.distribution('ESPRESSO_LAUNCHER').mainClass] + args
9999
)
100100

101101
def javavm_deps():

espresso/mx.espresso/suite.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,45 @@
575575
"maven": False,
576576
},
577577

578+
"ESPRESSO_JVM_STANDALONE_JAVA_LINKS": {
579+
"type": "dir",
580+
"platformDependent": True,
581+
"platforms": "local",
582+
"os": {
583+
"windows": {
584+
"layout": {
585+
"bin/java.cmd": "file:mx.espresso/launchers/java.cmd",
586+
"bin/javac.cmd": "file:mx.espresso/launchers/javac.cmd",
587+
},
588+
},
589+
"<others>": {
590+
"layout": {
591+
"bin/java": "file:mx.espresso/launchers/java.sh",
592+
"bin/javac": "file:mx.espresso/launchers/javac.sh",
593+
},
594+
},
595+
},
596+
"maven": False,
597+
},
598+
578599
"ESPRESSO_JVM_STANDALONE": {
579600
"type": "dir",
580601
"pruning_mode": "optional",
581602
"description": "Espresso JVM standalone distribution for testing",
582603
"platformDependent": True,
583604
"platforms": "local",
605+
"defaultDereference": "never",
584606
"layout": {
585-
"bin/": ["dependency:espresso:espresso"],
607+
"bin/": [
608+
"dependency:espresso:espresso",
609+
"dependency:ESPRESSO_JVM_STANDALONE_JAVA_LINKS/bin/*",
610+
],
586611
"./": [{
587612
"source_type": "dependency",
588613
"dependency": "espresso:JAVA_HOME",
589614
"path": "*",
590615
"exclude": [
616+
"bin", # those can't run without <jdk_lib_dir>/server
591617
"lib/jfr",
592618
"lib/static",
593619
"<jdk_lib_dir>/server",

0 commit comments

Comments
 (0)