Skip to content

Commit

Permalink
Merge pull request #31337 from zakkak/2023-02-22-statistics-fix
Browse files Browse the repository at this point in the history
Pass -H:ImageBuildStatisticsFile only when using GraalVM 22.3
  • Loading branch information
gsmet authored Feb 23, 2023
2 parents 021d16d + 635a848 commit 9a33e67
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,12 @@ public NativeImageInvokerInfo build() {

// only available in GraalVM 22.3.0 and better.
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_22_3_0) >= 0) {
// For build time information
nativeImageArgs.add("-H:+CollectImageBuildStatistics");
nativeImageArgs.add("-H:ImageBuildStatisticsFile=" + nativeImageName + "-timing-stats.json");
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_23_0_0) < 0) {
// Used to retrieve build time information in 22.3. Starting with 23.0 this info is included in
// the build output json file so there is no need to generate extra files.
nativeImageArgs.add("-H:+CollectImageBuildStatistics");
nativeImageArgs.add("-H:ImageBuildStatisticsFile=" + nativeImageName + "-timing-stats.json");
}
// For getting the build output stats as a JSON file
nativeImageArgs.add("-H:BuildOutputJSONFile=" + nativeImageName + "-build-output-stats.json");
}
Expand Down

0 comments on commit 9a33e67

Please sign in to comment.