Sebastian Schuberth
05/16/2025, 2:14 PMSebastian Schuberth
05/16/2025, 2:17 PM@DisableCachingByDefault
... I was just confuse that it stimm emits the "1 problem was found storing the configuration cache" message.Philip W
05/16/2025, 2:29 PMPhilip W
05/16/2025, 2:31 PMSebastian Schuberth
05/16/2025, 2:42 PMnotCompatibleWithConfigurationCache()
, but that still prints the above message. So I wanted to know about an annotation that behaves as if --no-configuration-cache
was passed on the CLI and suppresses the message.Vampire
05/16/2025, 2:58 PMnotCompatibleWithConfigurationCache()
is just meant as temporary measure during migration to CC-compatibility.
Having a task with that option in the task graph will still log the problem as warning but not immediately fail the build due to the found problem.
But still the build could fail or behave strangely depending on the actual found problem, because iirc since some 8.x version even the initial run of a task with CC does not use the currently freshly created task state, but instead create the CC state, deserialize the CC state and use that deserilized CC state to run the build, as otherwise there could be strange behavior changes between the run that creates the CC state and the run that reuses the CC state.
So iirc the technical details even with that option the build could - and in most cases will - behave strange or bad,
and the option just prevents the CC state to be stored for reuse at the end of the build.Vampire
05/16/2025, 3:00 PMVampire
05/16/2025, 3:07 PMVampire
05/16/2025, 3:10 PMval bar = "asdf"
val foo by tasks.registering {
//notCompatibleWithConfigurationCache("foo")
doLast {
println("foo: $bar")
}
}
with --configuration-cache-problems=warn
fails due to Cannot invoke "Build_gradle.getBar()" because "this.this$0" is null
, as the CC state is reused, but without --configuration-cache-problems=warn
and commenting notCompatibleWithConfigurationCache("foo")
it properly prints, so it seems the original state is used as it should be, but still the warnings are displayed and I don't think you can suppress that.