Open TheGoesen opened 1 week ago
The issue is in the backlog of the relevant team and is prioritized by them.
First step should be to check if the vintage (non-CC) build actually picks up refreshed dependencies. If it doesn't, it should be fixed too.
Current Behavior
given a gradle build using snapshot dependencies (changing dependencies) and configuration cache enabled. Executing multiple gradle targets will populate the gradle configuration cache. for example
gradlew app:dependencyInsight --configuration runtimeClasspath --dependency myDependency
later on someone want to update the dependencies and executesgradlew build --refresh-dependencies
This does correctly update the dependencies. However all other gradle builds that have prior configuration-cache hits will still use the old version of the artifacts. So executingdependencyInsight
again for example will result in a cache hit, showing the old version of 'myDependency'In practice this gets very confusing as gradle will sometimes pick one version for some builds and another version for different targets... for example
gradlew classes
might pick the old version because it has a configuration cache hit, but thengradlew jar
will pick the new version because its a configuration cache miss...Expected Behavior
This behavior should be documented or --refresh-dependencies should also purge the configuration cache. (or at least drop all entries that are affected by the updated-dependencies)
Context (optional)
Was discussed here: https://discuss.gradle.org/t/configuration-cache-combined-with-refresh-dependencies/49786
Self-contained Reproducer Project
any good public examples for changing artifacts?
Gradle version
8.10.2
Build scan URL (optional)
No response
Your Environment (optional)
No response