Configuring caches
Declare caches underbuild.platforms.<key>.caches. Each cache has a key
and a list of project-relative paths stored under it:
.. segments are rejected.
How it works
Each cache key maps to a dedicated cache disk that Revyl stores between builds:- When a build starts, the disk for each configured key is fetched and attached to the build VM. A key that has never been saved gets a fresh, empty disk (20 GB).
- Before your commands run, each configured path is linked onto its cache disk. Whatever your build writes there, like
node_modules,Pods, or DerivedData, lands on the disk. - If the build succeeds, the disks are compressed and stored for the next build. Failed builds don’t update caches, so a broken run can’t poison them.
node_modules tree with
hundreds of thousands of files costs the same to attach as an empty one.
Scope and sharing
Cache keys are scoped to your organization. Any build in your org that names the same key gets the same cache across apps, platform streams, branches, and whoever (or whatever CI job) triggered the build. Use distinct keys when contents must not mix, e.g.ios-deps vs android-gradle.
Concurrency
Concurrent builds using the same key each get a private copy of the disk; they never see each other’s in-flight writes. On success, the last build to finish wins, the same semantics as GitHub Actions caches. There’s no locking, and there doesn’t need to be: a lost cache write only costs the next build some warm-up time.Skipping caches
--no-cache run
doesn’t reset anything. To actually discard a cache, change the key.
What to cache
Good candidates are directories that are expensive to recreate and safe to reuse:- JS dependencies:
node_modules - CocoaPods:
ios/Pods - Xcode DerivedData: the
-derivedDataPathdirectory (e.g.build), for incremental compiles - Gradle project state:
android/.gradle
- Only project-relative paths can be cached. Tool caches that default to the home directory (like Gradle’s
~/.gradledependency cache) need to be pointed into the project first. For example, useGRADLE_USER_HOME=$PWD/.gradle-home ./gradlew assembleReleasewith.gradle-homeinpaths. - If you cache the directory your artifact is built into (DerivedData), keep
outputspecific enough that a stale product from a previous build can’t match the glob.
Related
- Configuration: the full
build:reference - Toolchain Images: what’s preinstalled, so you don’t cache what’s already there