fix(react-native): disable fmt consteval for Xcode 26.4 builds#275
Open
Kristopher Johnson (kristopherjohnson) wants to merge 1 commit intomainfrom
Open
fix(react-native): disable fmt consteval for Xcode 26.4 builds#275Kristopher Johnson (kristopherjohnson) wants to merge 1 commit intomainfrom
Kristopher Johnson (kristopherjohnson) wants to merge 1 commit intomainfrom
Conversation
Compile the fmt pod as C++17 in a post_install hook so __cpp_consteval is not defined, which forces fmt to skip the consteval FMT_STRING code path entirely and fall back to runtime format-string validation. Scoped to the fmt target only — RCT-Folly, React-Core, and the rest of RN keep their C++20 settings. Without this, `react-native run-ios` (Debug or Release) fails on Xcode 26.4 with errors like: call to consteval function 'fmt::basic_format_string<...>' is not a constant expression This mirrors the fix landed in the SDK monorepo's example app (getditto/ditto#22248, backported to releases/stable/sdk-4.14 in #22327). Remove when React Native upgrades to a build that bundles fmt >= 11.1. See SDKS-3242.
Copilot started reviewing on behalf of
Kristopher Johnson (kristopherjohnson)
April 29, 2026 20:06
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the React Native iOS quickstart’s CocoaPods configuration to work around an Xcode 26.4 clang + fmt 11.0.2 consteval compilation failure, while keeping the rest of React Native on C++20.
Changes:
- Adds a
post_installoverride to force thefmtpod target to compile as C++17. - Documents the rationale, upstream reference, and removal condition (when RN bundles fmt ≥ 11.1).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply the fmt-consteval Xcode 26.4 fix to the React Native quickstart's
Podfile.Without this,
react-native run-ios(Debug or Release) on Xcode 26.4 fails to compile the bundledfmt11.0.2 Pod with:The post_install hook compiles only the
fmttarget as C++17 so__cpp_constevalisn't defined, which causes fmt to skip its constevalFMT_STRINGpath and fall back to runtime format-string validation. RCT-Folly, React-Core, and the rest of RN keep their C++20 settings.This mirrors the fix the SDK team landed in the monorepo's example app:
releases/stable/sdk-4.14)Confirmed locally on Xcode 26.4: with the snippet in place,
react-native run-ios --device 'KJ iPhone XR' --mode Releasebuilds, installs, and launches successfully. Without it, the same command fails on the consteval errors above.Remove this hook once React Native bundles
fmt >= 11.1(which has the upstream consteval fix).Linear
Closes SDKS-3595
Test plan
cd react-native/ios && pod installsucceedscd react-native && npx react-native run-ios --simulator 'iPhone 16'builds clean (no consteval errors)