As the "dirty"-state is calculated, each and every file in the project should be a CC input.
Of course this is not really helpful and should probably be done via ValueSource.
But the point is, that CC does not consider all relevant files as inputs and thus produces wrong results.
Current Behavior
CC entry is reused while it shouldn't.
Context (optional)
This issue is very similar to the issue #25572 I reported in so far that input files are not considered properly.
But I assume another root cause, so decided to report it as separate issue, as in that issue it seems to have to do with reading the file in a provider when the input property values are calculated and here I directly read the files at normal configuration time of the task.
Make sure that you do not have any Shell extensions that display Git status or similar, as that could falsify the test case by changing the index file and thus invalidating the CC entry
Go to foo directory
Follow this procedure:
$ ./gradlew foo
Task :foo
it is clean
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
$ echo a >foo
$ ./gradlew foo
Task :foo
it is dirty
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
$ git restore foo
$ ./gradlew foo --configuration-cache
Calculating task graph as no configuration cache is available for tasks: foo
Task :foo
it is clean
0 problems were found storing the configuration cache.
See the complete report at file:///.../configuration-cache-report.html
Expected Behavior
As the "dirty"-state is calculated, each and every file in the project should be a CC input. Of course this is not really helpful and should probably be done via
ValueSource
. But the point is, that CC does not consider all relevant files as inputs and thus produces wrong results.Current Behavior
CC entry is reused while it shouldn't.
Context (optional)
This issue is very similar to the issue #25572 I reported in so far that input files are not considered properly. But I assume another root cause, so decided to report it as separate issue, as in that issue it seems to have to do with reading the file in a provider when the input property values are calculated and here I directly read the files at normal configuration time of the task.
Steps to Reproduce
index
file and thus invalidating the CC entryfoo
directoryBUILD SUCCESSFUL in 5s 1 actionable task: 1 executed $ echo a >foo $ ./gradlew foo
BUILD SUCCESSFUL in 5s 1 actionable task: 1 executed $ git restore foo $ ./gradlew foo --configuration-cache Calculating task graph as no configuration cache is available for tasks: foo
0 problems were found storing the configuration cache.
See the complete report at file:///.../configuration-cache-report.html
BUILD SUCCESSFUL in 5s 1 actionable task: 1 executed Configuration cache entry stored. $ echo a >foo $ ./gradlew foo --configuration-cache Reusing configuration cache.
BUILD SUCCESSFUL in 5s 1 actionable task: 1 executed Configuration cache entry reused.
Gradle version
8.2