fix(ios): build fmt pod as C++17 to fix Xcode 26.4+ consteval error#306
Open
mfazekas wants to merge 1 commit into
Open
fix(ios): build fmt pod as C++17 to fix Xcode 26.4+ consteval error#306mfazekas wants to merge 1 commit into
mfazekas wants to merge 1 commit into
Conversation
b525a27 to
b030dfd
Compare
b030dfd to
8a3215d
Compare
822413e to
cb2063a
Compare
mfazekas
added a commit
that referenced
this pull request
Jul 3, 2026
…314) Cherry-picks the `fmt`-as-C++17 Podfile workaround onto the experimental backend line so its iOS build survives the Xcode 26.4+ (Apple clang 21) `consteval` error in `fmt` (via RCT-Folly on RN 0.80.3). Same change as #306 (which targets `main`); applies cleanly here and the branch had no prior fmt workaround. Remove once we bump to RN 0.83+ (fix is upstream there).
Xcode 26.4+ (Apple clang 21) rejects fmt's compile-time FMT_STRING (consteval) as non-constant. Compiling only the fmt pod as C++17 makes fmt's base.h disable consteval (FMT_CPLUSPLUS < 201709 -> FMT_USE_CONSTEVAL 0). A -DFMT_USE_CONSTEVAL=0 define does NOT work: base.h re-#defines the macro unconditionally and overrides it. Verified building on Xcode 26.6. Fixed upstream in RN 0.83+.
cb2063a to
20f0882
Compare
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.
Problem
Apple clang 21 (Xcode 26.4+) rejects fmt's compile-time
FMT_STRING/constevalas a non-constant-expression, so the iOS build fails compiling fmt'sformat.cc:React Native vendors fmt (
RCT-Folly→fmt 11.0.2on our RN 0.80.3). CI doesn't hit it (Xcode 26.3); local builds on 26.4+/26.5 do. Tracked in facebook/react-native#55601 and fmtlib/fmt#4740.Fix
Compile only the
fmtpod as C++17 via aPodfilepost_installbuild setting. Under C++17 fmt'sconstevalpath is disabled (__cpp_constevalabsent), which sidesteps the error. Scoped totarget.name == 'fmt'so the rest of the graph keeps C++20. No vendored-header edits and robust across fmt versions.How others handle it
fmt/base.h(FMT_USE_CONSTEVAL → 0), per expo/expo#44229.fmt-as-C++17 build setting used here.All interim options disable fmt's consteval path; this is the bare-RN one.
Longevity
This is only needed because we're on RN 0.80.3. Remove this block once we bump to RN 0.83+, which carries the upstream fix (also noted in the Podfile comment).
Verify
pod install, then build the iOS example on Xcode 26.4+ — thefmttarget compiles clean.