Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prebuild-config): add support for experiments.ccacheIos to enable new ccache flag #28398

Closed
wants to merge 5 commits into from

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Apr 23, 2024

Why

Sets the ccache property in the Podfile.properties.json file to enable caching of subsequent iOS builds.
Requires additional setup and doesn't always work https://reactnative.dev/docs/build-speed#xcode-specific-setup
I was able to get it working with brew install ccache.
After experiments.ccacheIos is enabled, prebuild and pod install must be run again.
Running cache -s prints the cache statistics. Run this after a successful iOS build to see the progress.
The ccache can be cleared with ccache --clear for sanity.
Ref PR (first available react-native@0.74.0): facebook/react-native@e85d51c

How

Unlike all other config plugins which follow the original migration strategy, this plugin is much simpler. I simply added it to the prebuild-config package and added some tests which run the mods. This enabled me to reduce the layers of indirection which we used to have in order to test behavior.

Test Plan

Leveraged new test runner (overkill here) to ensure the value is set E2E with minimal code.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 23, 2024
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 23, 2024
@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions and removed bot: passed checks ExpoBot has nothing to complain about labels Apr 23, 2024
@Kudo
Copy link
Contributor

Kudo commented Apr 23, 2024

this looks like something that we can add inside expo-build-properties, since it's CNG project only and not working for expo-go or bare project.

@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 465cc82

@brentvatne
Copy link
Member

it'd be great to try this with our eas build cache, to see if we can cache the ccache cache dir and speed up builds

@byCedric byCedric self-assigned this May 2, 2024
byCedric added a commit that referenced this pull request May 6, 2024
…ble c++ compiler cache (#28638)

# Why

Closes #28398

This is a re-implementation of #28398, but implemented through
`expo-build-properties`.

# How

- [x] Added `ios.ccacheEnabled` to `expo-build-properties`, to add the
`apple.ccacheEnabled` podfile property.
- [x] Updated the template to enable `:ccache_enabled` once podfile
property is true.
- [x] Update the docs to document this new property.

# Test Plan

See added test

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Co-authored-by: Kudo Chien <kudo@expo.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants