Skip to content

Fix Gradle configuration cache incompatibility in conformanceTests task - #38

Merged
wmdietl merged 1 commit into
main-eisopfrom
copilot/fix-gradle-cache-issue
May 1, 2026
Merged

Fix Gradle configuration cache incompatibility in conformanceTests task#38
wmdietl merged 1 commit into
main-eisopfrom
copilot/fix-gradle-cache-issue

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown

conformanceTests fails when Gradle's configuration cache is enabled (org.gradle.configuration-cache=true) because fileTree() — a delegate to the Project object — is called inside a doFirst block (execution time), which Gradle cannot serialize.

Task :conformanceTests FAILED
Invocation of 'fileTree' references a Gradle script object from a Groovy closure
at execution time, which is unsupported with the configuration cache.

Change

Replace fileTree("${conformanceTests}/deps").join(":") in the doFirst block with a plain File.eachFileRecurse traversal — no Gradle project-object reference, same result (all files collected recursively, sorted alphabetically to match fileTree's default ordering):

// Before
doFirst {
    def deps = fileTree("${conformanceTests}/deps").join(":")
    systemProperties(["JSpecifyConformanceTest.deps": deps, ...])
}

// After
doFirst {
    def depsDir = new File("${conformanceTests}/deps")
    def depsList = []
    if (depsDir.exists()) {
        depsDir.eachFileRecurse { f -> if (f.isFile()) depsList << f.absolutePath }
        depsList.sort()
    }
    systemProperties(["JSpecifyConformanceTest.deps": depsList.join(":"), ...])
}

@wmdietl
wmdietl marked this pull request as ready for review May 1, 2026 19:18
Copilot AI review requested due to automatic review settings May 1, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wmdietl

wmdietl commented May 1, 2026

Copy link
Copy Markdown
Member

Build and demo tests work without issue again.

@wmdietl
wmdietl merged commit f8d8e79 into main-eisop May 1, 2026
2 of 5 checks passed
@wmdietl
wmdietl deleted the copilot/fix-gradle-cache-issue branch May 1, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants