I am trying to debug the caching of a custom task of mine. I am running it on my local machine (MacBook Pro M2) and on GitHub Actions (ubuntu-20.04). Both machines build the same code, both use Gradle 8.4. The cache keys turn out to be different between the builds but build cache debugging gives no indication as to why.
On both machines I get the following output (anonymized/censored/edited for clarity). Some inputs come from JavaExec which my task extends.
> Task :build_allScripts_generate
Appending implementation to build cache key: tech.cariad.arche.gradle.mps.Generate_Decorated@a9ca08850953546d718f33a58c077314
Appending additional implementation to build cache key: tech.cariad.arche.gradle.mps.Generate_Decorated@7097f5a36864d5383a8b451cf97435b0
Appending input value fingerprint for 'antBaseDirectoryPath' to build cache key: f1d3ff8443297732862df21dc4e57262
Appending input value fingerprint for 'args' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'argumentProviders.$0' to build cache key: 83aedcbef62b4d7c1699cbf161a5dd57
Appending input value fingerprint for 'argumentProviders.$1' to build cache key: b2ce347d106e9e0a1c11b69b40fb7e27
Appending input value fingerprint for 'debug' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'debugOptions' to build cache key: c41e3dbf942eb35af6239130d1289771
Appending input value fingerprint for 'debugOptions.enabled' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'debugOptions.host' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'debugOptions.port' to build cache key: d83d6605a42e65ae05e59d11497bd8b1
Appending input value fingerprint for 'debugOptions.server' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'debugOptions.suspend' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'defaultCharacterEncoding' to build cache key: d746f44d09fb58d2971f341d24d74c35
Appending input value fingerprint for 'enableAssertions' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'executable' to build cache key: d5e06ec828a75a8aef18d5119f504179
Appending input value fingerprint for 'extraArguments' to build cache key: 2cdd18a7c97ccc8e00e1eb6b45e79e25
Appending input value fingerprint for 'ignoreExitValue' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'javaLauncher' to build cache key: 9d8a00d37b423fcad5e418c1dec6fe54
Appending input value fingerprint for 'javaLauncher.metadata' to build cache key: 4d9f6dc93f56de4eba48ce2bd89e5381
Appending input value fingerprint for 'javaLauncher.metadata.languageVersion' to build cache key: 7574f94dd848ecac8e5cbac87d9642b2
Appending input value fingerprint for 'javaLauncher.metadata.taskInputs' to build cache key: 070b052e96f9602ad16e418fdf05dea0
Appending input value fingerprint for 'javaLauncher.metadata.taskInputs.implementation' to build cache key: e01131ec5ccd19bb20846b659179efcf
Appending input value fingerprint for 'javaLauncher.metadata.taskInputs.languageVersion' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'javaLauncher.metadata.taskInputs.vendor' to build cache key: 45e52b0ec9101d1df8c75deb7d6de60c
Appending input value fingerprint for 'javaVersion' to build cache key: a40a171a9de3ed0d81e29d9af4cc27ef
Appending input value fingerprint for 'jvmArgs' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'mainClass' to build cache key: ae95d56ac87e842ae7cba525c487bfc3
Appending input value fingerprint for 'mainModule' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'maxHeapSize' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'minHeapSize' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'modularity' to build cache key: f569ef831c75172879d032d6ce1a02bc
Appending input value fingerprint for 'modularity.inferModulePath' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'systemProperties' to build cache key: cfcc5f871f42c7c797557fd17748dc17
Appending input value fingerprint for 'variables' to build cache key: cfcc5f871f42c7c797557fd17748dc17
Appending input file fingerprints for 'additionalInputFiles' to build cache key: 9063e382172043012331079b48c1a3a8 ...
Appending input file fingerprints for 'bootstrapClasspath' to build cache key: 5fd1e7396e8de4cb5c23dc6aadd7787a - CLASSPATH{EMPTY}
Appending input file fingerprints for 'classpath' to build cache key: 405371c85690f141b7817ffe0dc3a71a - ...
Appending input file fingerprints for 'dependencies' to build cache key: 349681b1580340400fb4ab12a197e733 - ...
Appending input file fingerprints for 'script' to build cache key: 79278c9f21451061954ad9b039267939 - ...
Appending input file fingerprints for 'sourceInputs' to build cache key: 0d4c832b882ee2db4cdbc637d8ed8367 - ...
Appending output property name to build cache key: additionalOutputFiles$1
Appending output property name to build cache key: additionalOutputFiles$10
Appending output property name to build cache key: additionalOutputFiles$11
Appending output property name to build cache key: additionalOutputFiles$12
Appending output property name to build cache key: additionalOutputFiles$13
Appending output property name to build cache key: additionalOutputFiles$14
Appending output property name to build cache key: additionalOutputFiles$15
Appending output property name to build cache key: additionalOutputFiles$16
Appending output property name to build cache key: additionalOutputFiles$2
Appending output property name to build cache key: additionalOutputFiles$3
Appending output property name to build cache key: additionalOutputFiles$4
Appending output property name to build cache key: additionalOutputFiles$5
Appending output property name to build cache key: additionalOutputFiles$6
Appending output property name to build cache key: additionalOutputFiles$7
Appending output property name to build cache key: additionalOutputFiles$8
Appending output property name to build cache key: additionalOutputFiles$9
Appending output property name to build cache key: outputDirectories.some/dir
Appending output property name to build cache key: outputDirectories.another/dir
...
So far perfectly identical on both machines. But the next line is different:
MBP:
Build cache key for task ':build_allScripts_generate' is c3b0fdb1f1931a111174048ed8b916f8
GHA:
Build cache key for task ':build_allScripts_generate' is 0dc4c62b9dd5578b8493d576e2dc0b52
Why? Looks like something is being factored into the key but not logged. What could it be? I’ve double-checked the output property names, they are the same on both machines.