Skip to content

Commit 07a88fb

Browse files
committed
native tests: upgrade to GraalVM v22
Native-image now reports time and RAM usage. This allowed me to drop using time command to get an idea these numbers. Now testing under both JDK11 and JDK17. Now using setup-graalvm GitHub Action from Graal team. This action should handle vcvars.bat setup on Windows.
1 parent 70a56e7 commit 07a88fb

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed

.github/workflows/native-image-test.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ windows-latest, ubuntu-latest, macos-latest ]
11-
graal-java: [ java11 ]
11+
graal-java: [ 11, 17 ]
1212
test: [ test-native, test-native-sci ]
1313
clojure-version: [ '1.10', '1.11' ]
1414

@@ -29,23 +29,16 @@ jobs:
2929
key: $${ runner.os }}-cljdeps-${{ hashFiles('deps.edn') }}
3030
restore-keys: $${ runner.os }}-cljdeps-
3131

32-
#
33-
# Time command
34-
#
35-
- name: Install time command (linux)
36-
run: |
37-
sudo apt-get update
38-
sudo apt-get install -y time
39-
if: matrix.os == 'ubuntu-latest'
40-
4132
#
4233
# Install GraalVM
4334
#
4435
- name: Install GraalVM
45-
uses: DeLaGuardo/setup-graalvm@5.0
36+
uses: graalvm/setup-graalvm@v1
4637
with:
47-
graalvm: '21.3.0'
48-
java: ${{ matrix.graal-java }}
38+
version: '22.0.0.2'
39+
java-version: ${{ matrix.graal-java }}
40+
components: 'native-image'
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
4942

5043
#
5144
# Install Babashka
@@ -104,15 +97,7 @@ jobs:
10497
run: clojure -Spath
10598

10699
#
107-
# SCI native image tests
100+
# native image tests
108101
#
109-
- name: Execute ${{ matrix.test }} native test (windows)
110-
run: |
111-
# it is overly awkward to get vcvars64.bat loaded into powershell, so we use cmd shell instead
112-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
113-
bb ${{ matrix.test }}
114-
shell: cmd
115-
if: matrix.os == 'windows-latest'
116-
- name: Execute ${{ matrix.test }} native test (macos, linux)
102+
- name: Execute ${{ matrix.test }} native test
117103
run: bb ${{ matrix.test }} --clojure-version ${{ matrix.clojure-version }}
118-
if: matrix.os != 'windows-latest'

doc/02-developer-guide.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ We make use of planck for cljs bootstrap (aka cljs self-hosted) testing.
1313
Planck is currently not available for Windows.
1414

1515
We test that rewrite-clj operates as expected when natively compile via GraalVM.
16-
Automated testing is setup using GraalVM v21 JDK11.
16+
Automated testing is setup using GraalVM v22 JDK11 and JDK17.
1717

1818
== Prerequisites
1919
* Java JDK 1.8 or above
2020
* NodeJs v12 or above
2121
* Clojure v1.10.1.697 or above for `clojure` command
2222
** Note that rewrite-clj v1 itself supports Clojure v1.8 and above
2323
* Babashka v0.3.7 or above
24-
* GraalVM v21.2.0 JDK 11 (if you want to run GraalVM native image tests)
24+
* GraalVM v22.0.0.2 JDK 11/17 (if you want to run GraalVM native image tests)
2525

2626
=== Windows Notes
2727

script/helper/graal.clj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,5 @@
102102
"-cp" (str classpath java.io.File/pathSeparator "classes")
103103
(str "-J-Xmx" native-image-xmx)
104104
entry-class]
105-
(remove nil?))
106-
time-cmd (let [os (env/get-os)]
107-
(case os
108-
:mac ["/usr/bin/time" "-l"]
109-
:unix ["/usr/bin/time" "-v"]
110-
(status/line :warn (str "I don't know how to get run stats (user/real/sys CPU, RAM use, etc) for a command on " os))))]
111-
112-
(apply shell/command (concat time-cmd native-image-cmd))))
105+
(remove nil?))]
106+
(apply shell/command native-image-cmd)))

0 commit comments

Comments
 (0)