Skip to content

Conversation

ste7en
Copy link
Contributor

@ste7en ste7en commented Dec 13, 2024

Summary:

When building a react native app from Xcode and ccache has been set to be used, the ccache-clang.sh and ccache-clang++.sh scripts cannot find ccache, because Xcode PATH does not include ccache binary.
What I've done is setting a CCACHE_BINARY user-defined Xcode setting containing the result of executing command -v ccache during pod install execution and directly calling it in ccache scripts, set by ReactNativePodsUtils when ccache is enabled.

Fixes #46126

Changelog:

[IOS] [FIXED] - fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts

Test Plan:

Correctly builds helloworld and RNTester apps using ccache by enabling it at pod install time: USE_CCACHE=1 pod install.

The `$CCACHE_BINARY` env is set at `pod install` time when the USE_CCACHE flag is 1. This fixes ccache not found facebook#46126 as the ccache path is directly used.
@facebook-github-bot
Copy link
Contributor

Hi @ste7en!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@ste7en ste7en mentioned this pull request Dec 13, 2024
@cipolleschi
Copy link
Contributor

@ste7en thanks for the fix! Could you sign the CLA, please? Otherwise I'm not allowed to import the PR in our repo!

@ste7en
Copy link
Contributor Author

ste7en commented Dec 16, 2024

Sure @cipolleschi, didn't know about the CLA. Just signed it, thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 16, 2024
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 16, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 16, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in d31ac83.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @ste7en in d31ac83

When will my fix make it into a release? | How to file a pick request?

@mefjuu
Copy link

mefjuu commented Jan 27, 2025

@ste7en Thanks for the fix. Works great. But I wonder is it okay to store local setup ccache path into project.pbxproj? Maybe it's worth to consider moving this variable to .xcode.env generating script (with-environment.sh)

@ste7en
Copy link
Contributor Author

ste7en commented Jan 28, 2025

Maybe it's worth to consider moving this variable to .xcode.env generating script (with-environment.sh)

Yes @mefjuu, I agree it would be a much cleaner solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ccache not found

5 participants