Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test maint: modernize graal native-image opts #117

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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