fix: Bring back ccache support on new Xcode versions#54645
Conversation
|
Hi @mateuuszzzzz! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
| config.build_settings["CXX"] = ccache_clangpp_sh | ||
| config.build_settings["LDPLUSPLUS"] = ccache_clangpp_sh | ||
| config.build_settings["CCACHE_BINARY"] = ccache_path | ||
| config.build_settings["C_COMPILER_LAUNCHER"] = c_compiler_launcher |
There was a problem hiding this comment.
For context:
Without this change we would see lots of repeated warnings during build:
Explicit modules is enabled but the compiler was not recognized; disable explicit modules with
CLANG_ENABLE_EXPLICIT_MODULES=NO, or use
C_COMPILER_LAUNCHER with CLANG_ENABLE_EXPLICIT_MODULES_WITH_COMPILER_LAUNCHER=YES if using a compatible launcher
|
This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
Summary:
This Pull Request updates the build configuration to maintain compatibility with custom compiler launchers (
ccache) in Xcode versions 16 and newer.On newer Xcode versions, the method for using a custom compiler launcher has changed:
CC,LD,CXX, andLDPLUSPLUS, we must now use the build settingC_COMPILER_LAUNCHER. This setting points to a universal C/C++ launcher.CLANG_ENABLE_EXPLICIT_MODULES_WITH_COMPILER_LAUNCHER, must be explicitly set toYESto enable correct compilation of explicit modules when a launcher is present.Changelog:
[IOS][FIXED]
ccachefunctionality is restored for Xcode/xcodebuild versions >=16.[IOS][BREAKING] This change removes ccache support for older Xcode versions that do not recognise the new compiler launcher settings. (Not sure if this is needed for backward compatibility, but it shouldn’t be difficult to add)
Test Plan:
USE_CCACHE=1 bundle exec pod install.RNTesterapp for iOS. Check if cache is populated withccache -s(the first run should show cache misses).RNtesteragain.ccache -sshould show cache hits, confirming the launcher integration works correctly.