From b40b168b668160843a83a0181ba1353c31322cf2 Mon Sep 17 00:00:00 2001 From: Stefano Formicola Date: Fri, 13 Dec 2024 12:11:15 +0100 Subject: [PATCH 1/2] Add CCACHE_BINARY path to build settings in ReactNativePodsUtils.set_ccache_compiler_and_linker_build_settings --- packages/react-native/scripts/cocoapods/utils.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 9cf9eeac260f34..4a3dc7d3da68ae 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -105,6 +105,7 @@ def self.set_ccache_compiler_and_linker_build_settings(installer, react_native_p config.build_settings["LD"] = ccache_clang_sh config.build_settings["CXX"] = ccache_clangpp_sh config.build_settings["LDPLUSPLUS"] = ccache_clangpp_sh + config.build_settings["CCACHE_BINARY"] = ccache_path end project.save() From 4e6f8f34490d5876f03df13215a0d974f3ed169d Mon Sep 17 00:00:00 2001 From: Stefano Formicola Date: Fri, 13 Dec 2024 12:13:45 +0100 Subject: [PATCH 2/2] Use CCACHE_BINARY for ccache-clang and ccache-clang++ scripts The `$CCACHE_BINARY` env is set at `pod install` time when the USE_CCACHE flag is 1. This fixes ccache not found #46126 as the ccache path is directly used. --- packages/react-native/scripts/xcode/ccache-clang++.sh | 2 +- packages/react-native/scripts/xcode/ccache-clang.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/xcode/ccache-clang++.sh b/packages/react-native/scripts/xcode/ccache-clang++.sh index f699d9a2442bae..54ff8ba5816dd9 100755 --- a/packages/react-native/scripts/xcode/ccache-clang++.sh +++ b/packages/react-native/scripts/xcode/ccache-clang++.sh @@ -11,4 +11,4 @@ REACT_NATIVE_CCACHE_CONFIGPATH=$SCRIPT_DIR/ccache.conf # Provide our config file if none is already provided export CCACHE_CONFIGPATH="${CCACHE_CONFIGPATH:-$REACT_NATIVE_CCACHE_CONFIGPATH}" -exec ccache clang++ "$@" +exec $CCACHE_BINARY clang++ "$@" diff --git a/packages/react-native/scripts/xcode/ccache-clang.sh b/packages/react-native/scripts/xcode/ccache-clang.sh index 5ed8664498ddea..9b1a355c2ccef0 100755 --- a/packages/react-native/scripts/xcode/ccache-clang.sh +++ b/packages/react-native/scripts/xcode/ccache-clang.sh @@ -11,4 +11,4 @@ REACT_NATIVE_CCACHE_CONFIGPATH=$SCRIPT_DIR/ccache.conf # Provide our config file if none is already provided export CCACHE_CONFIGPATH="${CCACHE_CONFIGPATH:-$REACT_NATIVE_CCACHE_CONFIGPATH}" -exec ccache clang "$@" +exec $CCACHE_BINARY clang "$@"