This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch reproducible-builds
in repository https://gitbox.apache.org/repos/asf/grails-forge.git

commit 319b594055c937c0854b04811cd75f9c781e46ce
Author: James Fredley <[email protected]>
AuthorDate: Thu May 8 20:38:31 2025 -0400

    Add configuration to improve reproducibility of native binaries in build
---
 grails-cli/build.gradle | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/grails-cli/build.gradle b/grails-cli/build.gradle
index d7b49a6..8ba1fbe 100644
--- a/grails-cli/build.gradle
+++ b/grails-cli/build.gradle
@@ -74,13 +74,17 @@ graalvmNative {
             // Main options
             sharedLibrary = false
             imageName = "grails"
-            buildArgs(
-                
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED",
-                
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED",
-                
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jni=ALL-UNNAMED",
-                
"--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED",
-                "-H:+ReportExceptionStackTraces"
-            )
+            buildArgs.addAll([
+                    
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED",
+                    
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED",
+                    
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jni=ALL-UNNAMED",
+                    
"--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED",
+                    "-H:+ReportExceptionStackTraces",
+                    '--exact-reachability-metadata', // Ensures consistent 
metadata handling
+                    '--no-fallback', // Prevents fallback to JVM, ensuring 
native-only
+                    '-H:+ReportExceptionStackTraces', // Aids debugging
+                    '--no-server' // Avoids server mode for reproducible 
results
+            ])
             if (project.hasProperty("musl")) {
                 logger.lifecycle("Using musl libc")
                 buildArgs("--libc=musl", "--static")
@@ -88,6 +92,10 @@ graalvmNative {
             mainClass = "org.grails.forge.cli.Application"
         }
     }
+    agent {
+        enabled = true // Enable tracing agent for metadata generation
+        defaultMode = 'conditional'
+    }
 }
 
 application {

Reply via email to