Skip to content

Commit 1a76c85

Browse files
authored
test maint: modernize graal native-image opts (#117)
Can use `-o` now instead of `-H:Path=` and `-H:Name=`. Also fixed clean of any existing generated exe file.
1 parent 687b7c0 commit 1a76c85

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

script/test_native.clj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,22 @@
4949
:target-path :target-exe :classpath :native-image-xmx
5050
:entry-class]}]
5151
(status/line :head "Graal native-image compile AOT")
52-
(let [full-target-exe (fs/which target-exe)]
53-
(when (fs/exists? full-target-exe)
54-
(fs/delete full-target-exe)))
55-
(let [native-image-cmd [graal-native-image
56-
(str "-H:Path=" target-path)
57-
(str "-H:Name=" target-exe)
58-
"--features=clj_easy.graal_build_time.InitClojureClasses"
59-
"-O1" ;; basic optimization for faster build
60-
(str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test
61-
"-H:+ReportExceptionStackTraces"
62-
"--verbose"
63-
"--no-fallback"
64-
"-cp" classpath
65-
(str "-J-Xmx" native-image-xmx)
66-
entry-class]]
67-
(t/shell native-image-cmd)))
52+
(let [full-path-target-exe (str (fs/file target-path target-exe))]
53+
(when-let [exe (fs/which full-path-target-exe)]
54+
(status/line :detail "Deleting existing %s" exe)
55+
(fs/delete exe))
56+
(let [native-image-cmd [graal-native-image
57+
"-o" full-path-target-exe
58+
"--features=clj_easy.graal_build_time.InitClojureClasses"
59+
"-O1" ;; basic optimization for faster build
60+
(str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test
61+
"-H:+ReportExceptionStackTraces"
62+
"--verbose"
63+
"--no-fallback"
64+
"-cp" classpath
65+
(str "-J-Xmx" native-image-xmx)
66+
entry-class]]
67+
(t/shell native-image-cmd))))
6868

6969
(defn humanize-bytes [bytes]
7070
(let [units ["bytes" "KB" "MB" "GB"]

0 commit comments

Comments
 (0)