Repository navigation
ci(ios): make ccache actually cache the iOS build - #754
Merged
Merged
Conversation
RN's ccache-clang.sh runs `$CCACHE_BINARY clang`. Pod install sets CCACHE_BINARY as a build setting, but Xcode doesn't pass build settings to compiler processes, so the wrapper ran plain clang and ccache never saw a call. Exporting CCACHE_BINARY in the job environment fixes it (checked locally: the wrapper got an empty value before, the path after). Also: line-buffered xcodebuild output (log timestamps were block-flushed, showing a misleading 25-45 min pause), a build timing summary, and no index store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the temporary branch exception used to measure the warm build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gre
marked this pull request as ready for review
October 29, 2026 09:43
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.
The iOS build takes ~40–70 min on the free macOS runners, and ccache (tried in #752) recorded nothing even though every compile went through RN's wrapper.
Why: RN's
scripts/xcode/ccache-clang.shruns$CCACHE_BINARY clang.pod install(withUSE_CCACHE=1) setsCCACHE_BINARYas a build setting, but Xcode doesn't pass build settings to compiler processes, so the wrapper ran plainclang. Checked locally with a probe compiler: the build setting arrives empty, while a variable exported in the shell reaches the wrapper.Changes (ios job):
brew install ccacheand exportCCACHE_BINARYviaGITHUB_ENV;USE_CCACHE=1onpod install.$RUNNER_TEMP/ccache: restored everywhere, saved from master only (keyed on the example lockfile + Podfile, trimmed to 2 GB), like Gradle/NuGet.NSUnbufferedIO=YES: xcodebuild output was block-buffered, so log timestamps showed a misleading 25–45 min "pause" in the Skia compile.-showBuildTimingSummaryto see where the build time actually goes, andCOMPILER_INDEX_STORE_ENABLE=NO.Results (measured on this PR, a branch-only cache save was added then reverted):
Build iOSstepThe build timing summary shows C/C++/ObjC compilation is ~99% of the build (505
CompileCtasks, 11 162 s cumulated vs ~190 s for everything else), which is exactly what ccache covers. The cache is 0.7 GiB on disk, 127 MB compressed.After merging, the first master run fills the cache (cold build); PRs then restore it read-only. The cache key changes with
example/package-lock.json/Podfile, andrestore-keysfalls back to the previous entry, so dependency bumps stay mostly warm.The two
DO NOT MERGEcommits (branch cache save + empty re-run) are undone by the last commit: squash-merge to keep them out of history.🤖 Generated with Claude Code