Repository navigation
Keep the build cache between CI runs - #781
Merged
Merged
Conversation
The local build cache lives in each checkout, to keep concurrent builds of several checkouts apart. CI builds one new checkout per job, so a run never reused anything an earlier run built: every run compiled and tested the whole XDK, about 6.5 of the 9 minutes of its main Gradle build. On CI the cache now stays in the Gradle user home, where setup-gradle saves it after master's runs and restores it for later runs, pull requests included, which only read it. Locally nothing changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI never reuses what an earlier run built. The local build cache lives in each checkout (
.gradle/build-cache), to keep concurrent local builds of several checkouts apart, and every CI job starts with a new checkout. So every run compiles and tests the whole XDK: about 6.5 of the 9 minutes of the main Gradle build on the last green master run.On CI (
CIis set) the cache now stays in the Gradle user home (caches/build-cache-1).setup-gradlealready saves that after master's runs, and restores it for later runs; pull requests only read it. Locally nothing changes. The root build and the three build-logic builds change the same way.Merge order
lib_ecstasysources without declaring them, so a kept cache could hand a pull request an old green result.Why it should be safe now
javatools.jaropen in the daemon while the build rewrote the jar, and Harden plugin launcher runtime isolation and external consumer execution #433 removed it.ModuleInfoTest's sibling sources, thexdktests' installed modules).GRADLE_USER_HOME:clean, then a build took 92 tasks from the cache, with 0 compiles and 0 tests. All 69 outputs were byte for byte what the build had made: every module, the javatools jar, the distribution zip and the installed XDK.CI, every build uses<checkout>/.gradle/build-cache. WithCI=true, every build uses<GRADLE_USER_HOME>/caches/build-cache-1.Things to know
FROM-CACHEfor the tasks whose inputs it didn't change.setup-gradlecleans up after master's runs, removing entries a run didn't use, so the saved cache holds master's latest outputs only.