Investigate build cache miss


(Nikita Skvortsov) #1

How can I investigate a task being executed instead of being downloaded from http cache node ( https://hub.docker.com/r/gradle/build-cache-node )?


(Sterling Greene) #2

Locally, you can use --info to look at why a particular task is consider out-of-date and the inputs that went into building the cache key.

We started with a script like this to capture more information: https://github.com/gradle/gradle/blob/master/gradle/taskCacheBuildScanUserData.gradle

This uses build-scans with custom values to collect extra information about tasks.

We mostly use the information collected automatically by the build scan plugin now. You can see some of the features in this update: https://gradle.com/enterprise/releases/2017.4#highlights

With build comparisons, you can see that particular properties of a task changed between executions.


(Nikita Skvortsov) #3

Thanks, will take a look.


(Luke Daley) #4

Gradle Enterprise 2017.5 will include more information on build cache operations. You can get a preview of some of them from a presentation we gave at this year’s Gradle Summit on Gradle Enterprise.


(Nikita Skvortsov) #5

@luke_daley thank you for the link, I will definetly watch it.


(Stefan Wolf) #6

There is also the build cache guide which goes into details on how to diagnose cache misses: https://guides.gradle.org/using-build-cache/#debugging_and_diagnosing_cache_misses