From b2053742e93075286536c995eed0a97778cdc82c Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Thu, 12 Sep 2024 16:15:05 +0200 Subject: [PATCH] enable -strict-image-heap if graalvm 21 --- ...o.micronaut.build.internal.data-native-example.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/buildSrc/src/main/groovy/io.micronaut.build.internal.data-native-example.gradle b/buildSrc/src/main/groovy/io.micronaut.build.internal.data-native-example.gradle index 509c96b0e0..edf3289d18 100644 --- a/buildSrc/src/main/groovy/io.micronaut.build.internal.data-native-example.gradle +++ b/buildSrc/src/main/groovy/io.micronaut.build.internal.data-native-example.gradle @@ -32,5 +32,14 @@ graalvmNative { metadataRepository { enabled = true } + binaries { + all { + logger.quiet("GRAALVM_HOME: {}", System.getenv("GRAALVM_HOME")) + if (System.getenv("GRAALVM_HOME")?.contains("graal") && System.getenv("GRAALVM_HOME")?.contains("21")) { + logger.quiet("Enabling strict image heap!") + buildArgs.add("--strict-image-heap") + } + } + } }