Closed xenoterracide closed 11 months ago
Can you be more specific about the problems you're observing? What things are not "safe" in your opinion?
Did you consider excluding these using the mechanism described here?
I've had bugs that I've reported to gradle where its caching was overly aggressive. Tests weren't being run when they should have been because gradle wasn't (isn't? I don't recall that issue has ever been closed) invalidating its cache properly. That's the one I remember...
The problem with excluding that way is that it implies that I know what's in each of those directories.
I'm just using --no-build-cache --no-configuration-cache
and hoping that's good enough for my use case to make a slower but more comprehensive check. I still have other jobs that use faster caching.
This action merely saves and restores the Gradle User Home directory between invocations. So any issues you see with "overly aggressive" caching should also manifest when running the build locally (and not purging the Gradle User Home).
While there are occasional bugs in Gradle that can result in corrupted cache entries, the vast majority of issues with caching (particularly false positives) are due to a cacheable task that doesn't have all of the task inputs and outputs properly declared.
If you have incorrect cache configuration leading to false positive cache hits, then the brute force mechanism of --no-build-cache
should work. But if you have an actual use case where this happens, it's usually better to fix it at the source.
It's a known bug in gradle's Java plug in test stuff. Which has simply led to me having trust issues.
It's a known bug in gradle's Java plug in test stuff. Which has simply led to me having trust issues.
Interesting. I'm not aware of any such bugs, and I've worked with a lot of customers to improve their cache hit ratio.
I don't think there's a clear improvement to be made to the action at this stage.
--no-build-cache
provides a way to disable it completely.It's a known bug in gradle's Java plug in test stuff. Which has simply led to me having trust issues.
Interesting. I'm not aware of any such bugs, and I've worked with a lot of customers to improve their cache hit ratio.
I can dig it up for you tomorrow if you want, It's one I reported. Something to do with cache invalidation not detected when you change the j unit configuration or something like that.
I changed the configuration the build continued to pass because the tests weren't being run. But the chain should have triggered an invalidation of the build cache and it didn't. Now I always keep at least one build that runs that doesn't cache things. Where the most frequent build does.
I can dig it up for you tomorrow if you want, It's one I reported. Something to do with cache invalidation not detected when you change the j unit configuration or something like that.
I'd appreciate that, thanks.
Sorry, tomorrow was a little later, here you go https://github.com/gradle/gradle/issues/18176#issuecomment-924045104
I've occasionally had problems with Gradle being overly aggressive in its caching and giving me a false positive success. I want an option only to cache downloaded artifacts. Those are safe, but sometimes other things aren't.