Skip to content

Commit 142276e

Browse files
committed
native tests: migrate to using clj-easy/graal-build-time
GraalVM has deprecated --initialize-at-build-time option for native-image and the upcoming v22 is slated to remove it. Adopt clj-easy/graal-build-time to provide an easy peasy solution to this new state of affairs.
1 parent 145a6b4 commit 142276e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

deps.edn

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,17 @@
8181
;; Running tests under Graal
8282
;;
8383
;; We have two main Graal scenarios:
84-
;; sci-test - interpret tests via sci over natively compiled rewrite-clj
85-
;; native-test - natively compile src and tests and run
84+
;; graal:sci-test - interpret tests via sci over natively compiled rewrite-clj
85+
;; graal:native-test - natively compile src and tests and run
8686

87-
:sci-test {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}
88-
:extra-paths ["target/generated/sci-test/src"]
87+
:graal {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}
88+
:extra-deps {com.github.clj-easy/graal-build-time {:mvn/version "0.1.0"}}}
89+
90+
:sci-test {:extra-paths ["target/generated/sci-test/src"]
8991
:extra-deps {lread/sci-test {:git/url "https://github.com/lread/sci-test.git"
9092
:sha "9fbac1d8d7ef73a35b03446fdf3844c0872d178e"}}}
9193

92-
:native-test {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}
93-
:extra-paths ["target/generated/graal"]}
94+
:native-test {:extra-paths ["target/generated/graal"]}
9495

9596
;; usage -M:sci-test:gen-reflection
9697
:gen-reflection {:main-opts ["-m" "sci-test.generate-reflection-file"]}

script/helper/graal.clj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"-J-Dclojure.compiler.direct-linking=true"
8585
(when graal-reflection-fname
8686
(str "-H:ReflectionConfigurationFiles=" graal-reflection-fname))
87-
"--initialize-at-build-time"
8887
"-H:Log=registerResource:"
8988
"-H:EnableURLProtocols=http,https,jar"
9089
"--verbose"

script/test_native.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
test-runner-dir "target/generated/graal"]
2929
(graal/clean)
3030
(generate-test-runner test-runner-dir)
31-
(let [classpath (graal/compute-classpath "test-common:native-test")]
31+
(let [classpath (graal/compute-classpath "test-common:graal:native-test")]
3232
(graal/aot-compile-sources classpath "clj-graal.test-runner")
3333
(graal/run-native-image {:graal-native-image graal-native-image
3434
:target-exe target-exe

script/test_native_sci.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(let [graal-native-image (graal/find-graal-native-image)]
4040
(graal/clean)
4141
(expose-api-to-sci)
42-
(let [classpath (graal/compute-classpath "sci-test")]
42+
(let [classpath (graal/compute-classpath "graal:sci-test")]
4343
(graal/aot-compile-sources classpath "sci-test.main")
4444
(generate-reflection-file graal-reflection-fname)
4545
(graal/run-native-image {:graal-native-image graal-native-image

0 commit comments

Comments
 (0)