Skip to content

fix(react-native): disable fmt consteval for Xcode 26.4 builds#275

Open
Kristopher Johnson (kristopherjohnson) wants to merge 1 commit intomainfrom
kj/rn-podfile-fmt-consteval-fix
Open

fix(react-native): disable fmt consteval for Xcode 26.4 builds#275
Kristopher Johnson (kristopherjohnson) wants to merge 1 commit intomainfrom
kj/rn-podfile-fmt-consteval-fix

Conversation

@kristopherjohnson
Copy link
Copy Markdown
Collaborator

@kristopherjohnson Kristopher Johnson (kristopherjohnson) commented Apr 29, 2026

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 bundled fmt 11.0.2 Pod with:

error: call to consteval function 'fmt::basic_format_string<...>' is not a constant expression

The post_install hook compiles only the fmt target as C++17 so __cpp_consteval isn't defined, which causes fmt to skip its consteval FMT_STRING path 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:

  • getditto/ditto#22248 (main, v5)
  • getditto/ditto#22327 (cherry-pick to 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 Release builds, 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 install succeeds
  • cd react-native && npx react-native run-ios --simulator 'iPhone 16' builds clean (no consteval errors)
  • CI passes for the React Native iOS build

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 AI review requested due to automatic review settings April 29, 2026 20:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_install override to force the fmt pod 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants