Skip to content

Conversation

jdaugherty
Copy link
Contributor

@jdaugherty jdaugherty commented Sep 5, 2025

  1. reproducibility issues

@matrei noticed that he was having reproducibility issues for grails-redis when run under docker desktop. These issues did not exist for me under orbstack or when running locally.

Debugging this, the source jars were different because the file listings inside of the source jars were different. Specifically, the listing across source sets - sometimes grails-app/init would be first and sometimes it would be later.

Digging into this, we do define the source / resource directories based on file system order instead of a deterministic order. This PR sorts those to help these issues in the future (we may need to open an upstream gradle bug when using reproducibleFileOrder=true if this continues). From what I can tell, the gradle source uses lists / linkedHashSets so as long as it's added in the same order, it's processed in the order.

  1. reproducible script issues

@matrei noted the reproducible script was failing because after a manual diff of all files, no differences were found. The script did not exit properly or ensure a diff file existed. @paulk-asert has previously mentioned these issues in prior releases but I couldn't reproduce. Going forward this should resolve this.

  1. KEYS file verification

As part of 7.0.0-RC2 we started verifying both the grails github action files & the svn files to make sure they are identical. We now will verify the KEYS files are identical so they're always kept in sync with grails-core.

@@ -512,6 +512,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
for (String f in grailsAppResourceDirs) {
grailsResourceDirs.add(project.file("grails-app/${f}"))
}
// force a defined order for build reproducibility
grailsResourceDirs.sort { File a, File b -> a.name <=> b.name }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.sort returns the list, so the return on the next line is redundant.

Possible simplification of method:

@CompileStatic
protected List<File> resolveGrailsResourceDirs1(Project project) {
    ['src/main/resources']
        .addAll(grailsAppResourceDirs.collect { 'grails-app/' + it })
        .collect { project.file(it) }
        .sort { it.name } // sort for build reproducibility
}

Comment on lines 531 to 534
grailsSourceDirs.add(project.file('src/main/groovy'))
// force a defined order for build reproducibility
grailsSourceDirs.sort { File a, File b -> a.name <=> b.name }
grailsSourceDirs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here that .sort already returns the list.

Possible simplification:

grailsSourceDirs
    .tap { add(project.file('src/main/groovy')) }
    .sort { it.name } // sort for build reproducibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants