This message was deleted.
# configuration-cache
s
This message was deleted.
👀 1
v
I might remember wrongly, but I mean to remember that this is not a new issue but expected behavior, even if unintuitive.
s
Is there anyway to override
org.gradle.unsafe.configuration-cache-problems
in the project if the
~/.gradle/gradle.properties
has it set? setting it to empty doesn't have an effect, and it still fails.
v
Yeah, I remembered correctly. This is the thread I had in mind: https://gradle-community.slack.com/archives/C013WEPGQF9/p1642504611003200 And here the original issue to your duplicate: https://github.com/gradle/gradle/issues/19622 In both Gradle guys say this is by design, because the property says that all problems are treated as warning everywhere and it should just continue.
And no, I think if you set it in
~/.gradle/gradle.properties
you can only detect it and fail the build. You can only override it via command-line in that case iirc.
t
if that's expected behavior, I think it's the wrong expectation hmm but I kinda get why it would be so 🤔 Gradle should probably improve the error message to make this more clear
v
Don't tell me, I also thought it is a bug until several Gradle guys said this is by design and expected
🤮 1
👍 1
t
basically the combination of
notCompatible...
+ that warning is clearly incompatible. That itself ought to be considered a kind of error
☝️ 1
v
They at least wanted to improve the described implications of the flag in the docs, not sure whether they did already.
s
Thanks for your quick replies @Vampire. That helps provide context. Hopefully we can get someone from their team to link to an issue/documentation/something calling this behavior out.
v
yw
s
Here is the issue they have open to address it: https://github.com/gradle/gradle/issues/20673
v
And here the documentation with the explicit description: https://docs.gradle.org/7.4.2/javadoc/org/gradle/api/Task.html#notCompatibleWithConfigurationCache-java.lang.String-
The presence of incompatible tasks in the task graph will cause the configuration state to be discarded at the end of the build unless the global
configuration-cache-problems
option is set to
warn
, in which case the configuration state would still be cached in a best-effort manner as usual for the option.
And if you want to interpret the other docs in the Gradle way, the
notCompatibleWithConfigurationCache()
descriptions says
Configuration cache problems found in tasks marked incompatible will no longer cause the build to fail.
And the description of
org.gradle.unsafe.configuration-cache-problems=warn
says
turn problems into warnings
So with the flag, there are no problems anymore and thus the method has no effect anymore.