You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our project is using Gradle's precompiled script plugins and it looks like cache keys for restore & save build steps differ.
The restore step's checksum is e1387f while save step's is 7e9d0b. Upon analysis, it looks like there is one additional file included in calculation of save step's checksum: buildlogic/build/kotlin-dsl/plugins-blocks/extracted/***.gradle.kts - this file is not present in VCS, probably is generated during compilation and should otherwise not be taken into account for checksum calculation.
However, it seems that including the original file buildlogic/src/main/kotlin/***.gradle.kts is correct, since that file's configuration could change the state of the cache.
The key template in use is the default one: {{ .OS }}-{{ .Arch }}-gradle-cache-{{ checksum "**/*.gradle*" "**/gradle-wrapper.properties" "gradle.properties" "gradle/libs.versions.toml" }}.
What we've ended up using is the following template in regular https://github.com/bitrise-steplib/bitrise-step-save-cache step: {{ .OS }}-{{ .Arch }}-gradle-cache-{{ checksum "**/build.gradle*" "buildlogic/src/main/**" "**/settings.gradle*" "**/gradle-wrapper.properties" "**/gradle.properties" "**/libs.versions.toml" }}
**/build.gradle* - include all build.gradle files
buildlogic/src/main/** - include everything from buildlogic catalog, but disregard tests catalog. Including only buidlogic/src/main also avoids including buildlogic/build/... as reported in the bug above. In that catalog, we have a bunch of kt & kts files which can all affect the build cache - so it makes sense to include everything for checksum
**/settings.gradle* - include settings.gradle which was previously included by **/*.gradle*
Troubleshooting
Useful information
Issue description
Our project is using Gradle's precompiled script plugins and it looks like cache keys for restore & save build steps differ.
The restore step's checksum is
e1387f
while save step's is7e9d0b
. Upon analysis, it looks like there is one additional file included in calculation of save step's checksum:buildlogic/build/kotlin-dsl/plugins-blocks/extracted/***.gradle.kts
- this file is not present in VCS, probably is generated during compilation and should otherwise not be taken into account for checksum calculation.However, it seems that including the original file
buildlogic/src/main/kotlin/***.gradle.kts
is correct, since that file's configuration could change the state of the cache.The key template in use is the default one:
{{ .OS }}-{{ .Arch }}-gradle-cache-{{ checksum "**/*.gradle*" "**/gradle-wrapper.properties" "gradle.properties" "gradle/libs.versions.toml" }}
.Bitrise info
The text was updated successfully, but these errors were encountered: