This message was deleted.
# caching
s
This message was deleted.
v
Easiest might be to use a build
--scan
. If you cannot, maybe
-Dorg.gradle.caching.debug=true
might help iirc.
e
I did scan and I'm checking the report now
👌 1
Not sure where to go from this UI
v
Hm, might be that it only works with an own Develocity instance where you can compare two builds.
With just one build scan, there is nothing to compare besides the hash value I guess. 😕
e
Aha, clear!
Let me see in my history there were some scripts from gradle published for cachebility checking/tracing
v
I guess this is the guide you meant you were using already: https://docs.gradle.org/current/userguide/build_cache_debugging.html#helpful_data_for_diagnosing_a_cache_miss? So
-Dorg.gradle.caching.debug=true
did not help?
e
Cool missed it!
Let me try
v
Nice
e
The Build Validation Scripts would be the way to do this, but they require Develocity.
v
Oh, didn't I see in the readme it works without too?
And does it only use with full Develocity, or also with scans.gradle.org?
I fear the necessary API is not enabled in the latter. 😕
e
Former.
It is not in the top-level README, but in the build tool specific READMEs. https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Gradle.md#compatibility
v
That's the readme I meant
It is not strictly necessary that you have permission to call these APIs to execute a script successfully, but the summary provided once the script has finished running its experiment will be more comprehensive if the build scan data is accessible.
e
Sorry I meant former. It requires a full Develocity. 🙂
v
But I guess exactly that analysis can then not be done
e
At a minimum the scripts require build scan publishing to a full Develocity server (i.e. not
<http://scans.gradle.com|scans.gradle.com>
). The reason is for the experiment to really be useful you need the comparison feature, which as you pointed out earlier, is only available in the full version. Additionally, if you have API access to said Develocity server, the experiment summary will contain some data on the experiment outcome (e.g. # of executed cacheable tasks in the second build). This API access is not strictly required as you can always view the published build scans.
v
Ah, I see. Thanks for the clarification
🫡 1
e
Aha, thanks because I thought that at least first scripts will work without Develocity
Unfortunate
e
Perhaps there is room for improvement here in the docs. Thanks all. That being said, I agree with Vampire that
-Dorg.gradle.caching.debug=true
would be the way to go if you do not have access to Develocity.
e
I tried and we have 180 modules. It is ages to wait till the finish and after trying to find things.
v
Is there also a way to compare two artifacts under
~/.gradle/caches/build-cache-1
? It seems the generated files use
application/gzip
MIME type Wondering if this can help in debugging cache misses with respect to Remote build cache. (since I don't have Develocity)
It seems these files are double compressed - they're gzipped tar files. So
gunzip
and then
tar -xvf
is the way to go
v
tar does not compress files, they just pack multiple files into one file. Hence tar files are often compressed using gzip or bzip2 or others. The
tar
tool can even do that for example with
-z
for gzip or
-j
for bzip2. But I don't think you gain much in comparing those files, afair they contain a little bit metadata like when and where it was built and other than that the outputs that are cached in that entry. To compare cache misses without Develocity, it is much more useful to run both builds with
-Dorg.gradle.caching.debug=true
and compare the fingerprint contributors to find the differences, as mentioned above already.