Skip to content

Commit

Permalink
test maint: modernize graal native-image opts (#117)
Browse files Browse the repository at this point in the history
Can use `-o` now instead of `-H:Path=` and `-H:Name=`.

Also fixed clean of any existing generated exe file.
  • Loading branch information
lread committed Apr 28, 2024
1 parent 687b7c0 commit 1a76c85
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions script/test_native.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
:target-path :target-exe :classpath :native-image-xmx
:entry-class]}]
(status/line :head "Graal native-image compile AOT")
(let [full-target-exe (fs/which target-exe)]
(when (fs/exists? full-target-exe)
(fs/delete full-target-exe)))
(let [native-image-cmd [graal-native-image
(str "-H:Path=" target-path)
(str "-H:Name=" target-exe)
"--features=clj_easy.graal_build_time.InitClojureClasses"
"-O1" ;; basic optimization for faster build
(str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test
"-H:+ReportExceptionStackTraces"
"--verbose"
"--no-fallback"
"-cp" classpath
(str "-J-Xmx" native-image-xmx)
entry-class]]
(t/shell native-image-cmd)))
(let [full-path-target-exe (str (fs/file target-path target-exe))]
(when-let [exe (fs/which full-path-target-exe)]
(status/line :detail "Deleting existing %s" exe)
(fs/delete exe))
(let [native-image-cmd [graal-native-image
"-o" full-path-target-exe
"--features=clj_easy.graal_build_time.InitClojureClasses"
"-O1" ;; basic optimization for faster build
(str "-H:ReflectionConfigurationFiles=" reflection-config) ;; to support unsafe yaml test
"-H:+ReportExceptionStackTraces"
"--verbose"
"--no-fallback"
"-cp" classpath
(str "-J-Xmx" native-image-xmx)
entry-class]]
(t/shell native-image-cmd))))

(defn humanize-bytes [bytes]
(let [units ["bytes" "KB" "MB" "GB"]
Expand Down

0 comments on commit 1a76c85

Please sign in to comment.