New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration#withDependencies
can run after the configuration has been resolved
#11199
Comments
Configuration#withDependencies
can run after the configuration has been observedConfiguration#withDependencies
can run after the configuration has been resolved
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request. |
I'm having similar flakiness, it seems there is an unlinked |
A bit more context that arrives at the same error. In the Nokee plugin, we need, before Gradle performs any kind of resolution, to perform last-minute changes to the |
Expected Behavior
Configuration#withDependencies
should always run before the configuration is no longer valid to mutate. See its javadoc.Current Behavior
In rare cases on our CI (less than 1% of build executions), we get an exception when a
withDependencies
closure mutates theDependencySet
it is passed.Unfortunately the build is closed-source and, as I can't even reproduce it outside of our CI environment, I have no reproducing example. Here is an outline of the failure.
In our plugin:
The relevant frames of the associated stacktrace from our CI logs:
This is the branch from which the exception is thrown:
gradle/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/configurations/DefaultConfiguration.java
Lines 1131 to 1138 in bd168bb
It seems like the affected configuration has already been set to an
observedState
that disallows mutation (it is the parent of other configurations that are being resolved, as indicated by the recursiverunDependencyActions
frames in the stacktrace above) before this dependency action has been executed.I am not familiar with the implementation details of Gradle's dependency resolution, but this sounds like it contradicts the Javadoc of
withDependencies
. Perhaps there are missing calls torunDependencyActions
somewhere?Your environment
This is on 5.6.3.
The text was updated successfully, but these errors were encountered: