Robert Elliot
10/20/2025, 4:06 PMTrevJonez
10/20/2025, 4:17 PMRobert Elliot
10/20/2025, 4:18 PMTrevJonez
10/20/2025, 4:20 PMRobert Elliot
10/20/2025, 4:26 PMRUN --mount=type=cache,target=$work_dir/.gradle/configuration-cache \
./gradlew build
but that means the directory is shared between concurrent builds. We saw some odd build failures, and given I was told not to share ~/.gradle/caches/build-cache-1 like that but use a remote build cache instead, I suspect that just using a cache mount for $work_dir/.gradle/configuration-cache is also bad practice?TrevJonez
10/20/2025, 4:30 PMVampire
10/20/2025, 5:20 PM.gradle it is a bad idea to do so. The Gradle User Home is simply not designed to be used by different processes that cannot talk to each other and I'm not aware of anything inside that is assumed to be used concurrently from builds that cannot communicate.
And also, sharing that directory is by far not enough to reuse CC entries.
Quite the opposite, you will reuse CC entries that are incomplete because they point to downloaded dependencies, artifact transform results, and so on, which then all are not present.
Besides that the CC entries probably not get reused at all without supplying the same encryption key to all builds. But if you would, then it would fail when it tries to reuse the CC entries.
If you want to reuse CC on different machines, you most probably need to replicate what the official GitHub action is doing, saving many things from the GRADLE_USER_HOME to some cache facility and restoring it before run, but not using the directories concurrently.Vampire
10/20/2025, 5:21 PMVampire
10/20/2025, 5:22 PMRobert Elliot
10/21/2025, 4:14 PMAllan C.
10/22/2025, 3:35 PM