Repository navigation
Commit 52efed6
Disable folly coroutines for library pods in install_modules_dependencies (#58845)
Summary:
The iOS `react-native-clipboard/clipboard` job in the [nightly tests](https://github.com/react-native-community/nightly-tests/actions/runs/37195709435/job/111417053963) has failed since the `20261003` nightly:
```
Pods/Headers/Public/ReactNativeDependencies/folly/Expected.h:1587:10:
fatal error: 'folly/coro/Coroutine.h' file not found
```
Since #58711, `TurboModule.h` includes the `React/Bridging.h` umbrella, which includes `Dynamic.h` and therefore `folly/dynamic.h`. So every library that includes `RCTTurboModule.h` (for example through its codegen spec header) now compiles folly headers.
Some libraries set their own folly flags. Clipboard, for example, passes `-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1`. With `FOLLY_NO_CONFIG`, `folly-config.h` is skipped and `FOLLY_CFG_NO_COROUTINES` is never defined. Under C++20, folly then turns on coroutines and includes `folly/coro/Coroutine.h`, which the prebuilt `ReactNativeDependencies` doesn't ship.
This change makes `install_modules_dependencies` always append `-DFOLLY_CFG_NO_COROUTINES=1` to the library's compiler flags. React Native's own pods already use this flag (see `Helpers::Constants.folly_config`).
## Changelog:
[IOS] [FIXED] - Fix `'folly/coro/Coroutine.h' file not found` in libraries that set their own folly compiler flags
Pull Request resolved: #58845
Test Plan:
- Updated `new_architecture-test.rb` to assert that `spec.compiler_flags` contains `-DFOLLY_CFG_NO_COROUTINES=1`, both when new arch is enabled and when it is disabled.
- Ran the CocoaPods Ruby tests locally, excluding `spm-test.rb` because the `cocoapods` gem isn't available outside bundler in my environment: `ruby -Itest all_tests.rb -n /installModulesDependencies/`. The new `compiler_flags` assertions pass. In my local Ruby 3.4 environment the same 28 tests fail on both `main` and this branch, including a `HEADER_SEARCH_PATHS` assertion right after the new ones. That's an environment issue, not this change; relying on CI for the full suite.
- I didn't run the nightly-tests clipboard job against this change. It should pass once a nightly includes this fix.
Reviewed By: vzaidman
Differential Revision: D123393629
Pulled By: cipolleschi
fbshipit-source-id: b0ce442e9ded7842e1137b8379efb021f36d99191 parent 2a2ccaa commit 52efed6
2 files changed
Lines changed: 6 additions & 2 deletions
File tree
- packages/react-native/scripts/cocoapods
- __tests__
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
0 commit comments