Repository navigation
Pin that the compiler config generator stays off the runtime classpath - #16325
Conversation
…asspath The task-based wiring that 9a529d1 replaced with a doFirst declared runtimeClasspath as an input of the generator task, so any task whose output reached the runtime classpath became a transitive dependency of compileGroovy. A post-compile step that feeds the runtime classpath, such as asset-pipeline output or the exploded plugin directory, then closed a cycle. That is the concern raised on #16114. The generator introduced there takes its script from grails { } state and declares no classpath input, so that edge no longer exists. This test recreates the scenario: a task that runs after classes and puts its output on the runtime classpath via runtimeOnly files(task). It asserts the generator does not depend on that task, and that compileGroovy and the producer schedule together without a cycle.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.0.x #16325 +/- ##
==================================================
- Coverage 54.7242% 54.7232% -0.0010%
Complexity 20531 20531
==================================================
Files 2104 2104
Lines 101149 101149
Branches 17966 17966
==================================================
- Hits 55353 55352 -1
- Misses 37775 37776 +1
Partials 8021 8021 🚀 New features to boost your workflow:
|
✅ All tests passed ✅Test SummaryGroovy Snapshot Canary Build / Build Grails (shard 2) > :grails-test-examples-scaffolding:integrationTest
🏷️ Commit: 9cde802 Test FailuresUserControllerSpec > User list (:grails-test-examples-scaffolding:integrationTest in Groovy Snapshot Canary Build / Build Grails (shard 2) | Attempt 1/2)Learn more about TestLens at testlens.app/docs. |
|
Thanks @matrei I see now why it can't reoccur. From discussing with AI, I thought it would be helpful to paste it's output here. It seems the only regression is if a configuration script was being provided manually (see the end of the AI output). @codeconsole or @matrei would you mind addressing this with an entry in the upgrade guide? PR #16325 / compileGroovy config-generator regression checkBottom line: the regression does not exist on 8.0.x, PR #16325's test really does guard it, and asset-pipeline was not the trigger. One related shape does still behave differently from the old What the old regression actually wasThe pre-September-2025 wiring registered per-script tasks that declared
Why it cannot recur with the merged designThe generator from #16114 takes a string input and, optionally, the build's own config script file. It declares no classpath input, and its only task dependency is the producer of that user script. Confirmed on real builds: in PR #16325 verification
Asset-pipeline was not the causeFrom the 5.2.0-M3 sources, A fixture with the real plugin plus The remaining gapA Grails 7-style build that writes its own compiler config script in a task and wires it the old way: tasks.named('compileGroovy') {
dependsOn generateUserConfigScript
groovyOptions.configurationScript = file('build/user-config.groovy')
}fails on 8.0.x head ( Provider wiring works, and the combined script carries both the Grails and user imports: groovyOptions.configurationScriptFile.fileProvider(generateUserConfigScript.map { it.outputs.files.singleFile })The #16114 author acknowledged this in that thread and promised a follow-up regression test plus upgrade-guide text. Neither is on 8.0.x yet: the upgrade guide's section 53 covers only
|
jdaugherty
left a comment
There was a problem hiding this comment.
Approving, but I'd like to see us update the upgrade guide.
codeconsole
left a comment
There was a problem hiding this comment.
Thanks, @matrei. This test captures the original failure mode: a task contributes output to the runtime classpath while depending on classes, which would create a cycle if the compiler-config generator consumed that classpath.
Checking task-graph construction is appropriate here because the cycle would fail before execution.
The separate compatibility case—assigning a generated user script as a plain file and adding its producer only to compileGroovy.dependsOn—is covered by #16327, including execution-level tests and the upgrade-guide entry James requested.
These changes complement each other. Approving.
The task-based wiring that 9a529d1 replaced with a doFirst declared runtimeClasspath as an input of the generator task, so any task whose output reached the runtime classpath became a transitive dependency of compileGroovy. A post-compile step that feeds the runtime classpath, such as asset-pipeline output or the exploded plugin directory, then closed a cycle. That is the concern raised on #16114.
The generator introduced there takes its script from grails { } state and declares no classpath input, so that edge no longer exists. This test recreates the scenario: a task that runs after classes and puts its output on the runtime classpath via runtimeOnly files(task). It asserts the generator does not depend on that task, and that compileGroovy and the producer schedule together without a cycle.