Skip to content

Commit

Permalink
Add diagnostics-mode for initialize-at-build-time
Browse files Browse the repository at this point in the history
GraalVM native-image generates a warning during the build:
  --initialize-at-build-time without arguments has been deprecated when
  not using --diagnostics-mode. With GraalVM 22.0.0
  --initialize-at-build-time will only work with --diagnostics-mode for
  debugging purposes.  The reason for deprecation is that
  --initalize-at-build-time does not compose, i.e., a single library can
  make assumptions that the whole classpath can be safely initialized at
  build time; that assumption is often incorrect.

Adding --diagnostics-mode addresses this. There seems to be a start-up
speed-up of ~1%, so the impact isn't very large, but consistent.

The deprecation of --initialize-at-build-time without arguments was done
in GraalVM 21.2.0, in particular commit
5013ca7c9d88bd12de2ebd24e3196a40d9044c9c.
It was mentioned in the release notes:
https://www.graalvm.org/release-notes/21_2/#native-image

And --diagnostics-mode was added in GraalVM 21.3.0, in particular commit
b036c6532bfd15cb536f37835dc79db5a9df7ba7, tho it wasn't mentioned in the
release notes.
  • Loading branch information
or committed May 10, 2022
1 parent cafa50c commit 87d21b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ pom.xml.asc
*.class
.lein-*
.nrepl-port
reports
1 change: 1 addition & 0 deletions cljfmt/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"-H:+ReportExceptionStackTraces"
"-H:ReflectionConfigurationFiles=reflection.json"
"--initialize-at-build-time"
"--diagnostics-mode"
"--report-unsupported-elements-at-runtime"
"-H:Log=registerResource:"
"--no-fallback"
Expand Down

0 comments on commit 87d21b6

Please sign in to comment.