ccache isn't used by iOS builds because CCACHE_BINARY is missing
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
Description
Even if ccache is enabled for iOS builds, it's never actually used. The issue seems to originate from this PR:
https://github.com/facebook/react-native/pull/48257
The CCACHE_BINARY user-defined setting was added to Xcode, which the shell scripts will try to use as an env var. However, none of the user-defined settings become an env var, therefore ccache is never invoked (as of Xcode 26.2).
You can test the env vars by adding the following line to ccache-clang.sh:
env > ~/ccache.log
Steps to reproduce
- Install ccache
brew install ccache - Zero the ccache stats
ccache -z - Check out the minimal repro project
- Set up iOS dependencies
cd ios && bundle install && bundle exec pod install - Build iOS using
npm run iosor by opening the Xcode project
Expected outcome:
ccache is used and ccache -s contains stats
Actual outcome:
ccache is never called
React Native Version
0.83.1"
Affected Platforms
Runtime - iOS, Build - MacOS
Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
OS: macOS 26.2
CPU: (14) arm64 Apple M4 Max
Memory: 632.27 MB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 25.5.0
path: /opt/homebrew/bin/node
Yarn: Not Found
npm:
version: 11.8.0
path: /opt/homebrew/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.2
- iOS 26.2
- macOS 26.2
- tvOS 26.2
- visionOS 26.2
- watchOS 26.2
Android SDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.26094.121.2513.14007798
Xcode:
version: 26.2/17C52
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.17
path: /usr/bin/javac
Ruby:
version: 4.0.1
path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.2.0
wanted: 19.2.0
react-native:
installed: 0.83.1
wanted: 0.83.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
The ccache stats don't show any information other than size because it has never been hit:
Local storage:
Cache size (GiB): 0.3 / 5.0 ( 5.80%)
Expected stats:
Cacheable calls: 0 / 1 ( 0.00%)
Hits: 0
Direct: 0
Preprocessed: 0
Misses: 0
Uncacheable calls: 1 / 1 (100.0%)
MANDATORY Reproducer
https://github.com/Nezz/react-native-repro/tree/repro/Ccache
Screenshots and Videos
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
packages/react-native/scripts/xcode/ccache-clang.sh から始め、iOS ビルド中に CCACHE_BINARY がどのように使用されるかを確認します。必須の reproducer を実行し、npm run ios または Xcode でビルドして、ccache -s を確認します。ビルドが ccache を呼び出し、統計にコンパイラー呼び出しが表示されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- ios, macos, react-native, shell
- 領域
- build-system, mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 68/100