Skip to content

Avoid Gradle configuration cache serializer limitations by adjusting lambda captures - #110

Merged
eigenraven merged 2 commits into
GTNewHorizons:masterfrom
embeddedt:conf-cache-fix
Sep 6, 2026
Merged

Avoid Gradle configuration cache serializer limitations by adjusting lambda captures#110
eigenraven merged 2 commits into
GTNewHorizons:masterfrom
embeddedt:conf-cache-fix

Conversation

@embeddedt

Copy link
Copy Markdown
Contributor

Summary

This PR fixes issues with RFG jar tasks when the configuration cache is enabled.

The RFG object graph has a cycle: MinecraftExtension.dependenciesForAccessTransformerScan (= compileClasspath) → resolved artifacts → DependencyDeobfuscationTransform$Parameters.fieldsCsv → provider chain from SharedMCPTasks → lambdas that capture mcExt → back to MinecraftExtension.

Gradle's configuration cache can normally serialize cycles, but appears to fail when the re-entry point is a Java-serialized lambda.

The fix is to hoist more properties into locals so the provider lambdas capture the Provider objects instead of mcExt/this. This is the same trick already used elsewhere in the code.

  • mcpExtractRoot — capture mcVersion/mcpMappingChannel/mcpMappingVersion providers, not mcExt
  • forgeSrgLocation — capture useForgeEmbeddedMappings and the two extract-root providers as locals
  • the generateForgeSrgMappings block — hoist userdevFile(...)/mcpFile(...) calls out of the flatMap lambdas (calling them inside captures thismcExt)

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@eigenraven
eigenraven merged commit f863692 into GTNewHorizons:master Sep 6, 2026
1 check passed
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