Fix gradle-debug failing on configuration resolution#11755
Conversation
Inspect tasks at taskGraph.whenReady instead of force-realizing every task in projectsEvaluated, which resolved configurations without an exclusive lock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bric3
left a comment
There was a problem hiding this comment.
That seems like the good approach indeed.
I wonder if the original issue with the projectEvaluated can be removed though. As they are usually bad in almost all usae cases (unless it's to verify things)
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
5243e52
into
master
What Does This Do
Fixes
./gradlew <task> -PddGradleDebugfailing with:The
gradle-debugplugin now inspects tasks fromgradle.taskGraph.whenReady(after the execution graph is built and scheduled tasks are fully configured) instead of force-realizing every task in every project fromprojectsEvaluated.Motivation
The old code iterated
project.tasksinside aprojectsEvaluatedBuildListener. Iterating the task container realizes every lazily-registered task, running its configuration action. Some tasks (e.g. mule'sextractMuleServices, aSynctask) resolve a configuration in that action viaresolvedConfiguration.resolvedArtifacts.projectsEvaluatedruns without the project's exclusive lock, and current Gradle forbids resolving a configuration there — so the whole build aborted, even for unrelated commands likehelp.Moving to
taskGraph.whenReadyfixes the root cause: at that point the scheduled tasks are already configured under the proper lock, so reading them is safe. It also avoids needlessly realizing every task in the ~200-module tree.Additional Notes
build,:module:test);helpreports almost nothing."jdk":"unknown").🤖 Generated with Claude Code