Commit 38d06b1
authored
fix(ios): patch fmt consteval build error on Xcode 26.4+ (#28225)
## **Description**
Xcode 26.4 (Apple Clang 21) introduces stricter `consteval` enforcement
that breaks the `fmt` library (v11.0.2) bundled via `RCT-Folly`, causing
5 compilation errors in `format-inl.h`.
This patches `fmt/base.h` in the Podfile `post_install` block to disable
`consteval` for all Apple Clang versions, falling back to `constexpr`.
Same approach as the existing Folly coroutines patch. Safe for older
Xcode versions — `constexpr` is the default fallback `fmt` already uses
on many platforms. Survives `yarn setup` / `pod install` since the patch
is re-applied each time.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: N/A — build breakage on Xcode 26.4+
## **Manual testing steps**
```gherkin
Feature: iOS build with Xcode 26.4
Scenario: developer builds iOS app
Given Xcode 26.4 with Apple Clang 21 is installed
When developer runs yarn start:ios
Then the build completes without fmt consteval errors
```
## **Screenshots/Recordings**
<!-- Not applicable — build fix only -->
### **Before**
Build fails with 5 `consteval` errors in
`ios/Pods/fmt/include/fmt/format-inl.h`
### **After**
Build succeeds
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds a CocoaPods `post_install` patch that rewrites a vendored `fmt`
header, which could affect formatting code generation or conflict with
future `fmt` updates, but is limited in scope to a single preprocessor
toggle during install.
>
> **Overview**
> Prevents Xcode 26.4+ build failures by extending the `Podfile`
`post_install` step to patch `fmt/include/fmt/base.h`, forcing
`FMT_USE_CONSTEVAL` from `1` to `0` (with a regex tolerant of
whitespace/indentation) and handling file permissions similarly to the
existing Folly patch.
>
> Updates `Podfile.lock` with the new `PODFILE CHECKSUM` reflecting the
`Podfile` change.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2c4aba0. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 39ec94f commit 38d06b1
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
166 | 184 | | |
167 | 185 | | |
168 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4875 | 4875 | | |
4876 | 4876 | | |
4877 | 4877 | | |
4878 | | - | |
| 4878 | + | |
4879 | 4879 | | |
4880 | 4880 | | |
0 commit comments