fix(iOS): replace racy RaTeXFFI modulemap-strip script with an explicit-modules opt-out#546
Merged
hryhoriiK97 merged 2 commits intoJul 17, 2026
Conversation
…modules opt-out
Xcode materializes the RaTeX binary target's module.modulemap into both
the platform-wide products dir and the pod's own build dir. Xcode 26's
default explicit-modules dependency scanner hard-errors on the duplicate
("redefinition of module 'RaTeXFFI'"), and the before_compile script that
sed-stripped one copy races the scanner: it loses on Xcode 26.3 (the
nightly-tests failure against react-native 0.88.0-nightly-20260717) and
only happens to win on 26.6.
Opt the pod target out of explicit modules via pod_target_xcconfig
instead - implicit modules tolerate the duplicate definition, no build
products need patching mid-build, and the fix is declarative and works
on every React Native version. Drop the now-redundant strip script; the
signature-dedup phase stays.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hryhoriiK97
self-requested a review
July 17, 2026 10:35
hryhoriiK97
approved these changes
Jul 17, 2026
hryhoriiK97
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! @chrfalch thank you for the fix!
The explicit-modules fix in the podspec requires Xcode 26.6 where the Clang dependency scanner correctly respects SWIFT_ENABLE_EXPLICIT_MODULES. On 26.3 the scanner still hard-errors on the duplicate RaTeXFFI modulemap. Co-authored-by: Cursor <cursoragent@cursor.com>
hryhoriiK97
reviewed
Jul 17, 2026
hryhoriiK97
left a comment
Collaborator
There was a problem hiding this comment.
@chrfalch CI (rn-build-ios) was failing on Xcode 26.3 - the fix needs 26.6. I've pushed a commit bumping CI Xcode to 26.6.
Closed
2 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.
fix(iOS): replace racy RaTeXFFI modulemap-strip script with an explicit-modules opt-out
Summary
The
[ios] react-native-enriched-markdownjob in react-native-community/nightly-tests went red againstreact-native@0.88.0-nightly-20260717(run):What's going on
Xcode materializes the RaTeX binary target's xcframework into both the platform-wide products dir and the pod's own build dir — two identical
module.modulemaps definingRaTeXFFI, both on the pod target's search paths. That duplication has always existed; the existingFix RaTeXFFI Module Redefinitionscript phase sed-strips the platform-wide copybefore_compile.Two things changed:
0.88.0-nightly-20260717) removed the-ivfsoverlayflag that had been disqualifying this pod target from Xcode 26's default explicit modules mode. The target now builds with-explicit-module-build, whose dependency scanner loads every reachable module map eagerly and hard-errors on the duplicate — where classic implicit modules tolerate it (verified: an implicit-modules compile against both duplicate maps prints the diagnostic but exits 0).The fix
Set
SWIFT_ENABLE_EXPLICIT_MODULES = NOin the pod'spod_target_xcconfigwhen math is enabled, and drop the now-redundant strip script (the signature-dedup phase stays). Under implicit modules the duplicate definition is benign — no build products need patching at all.This is declarative (no mid-build mutation, no race), works on every RN version, and takes effect at
pod installtime.Related: react-native side ships the same opt-out for every
spm_dependencyconsumer in react/react-native#57589 — but this library shouldn't need to wait for an RN release, and dropping the racy script is worthwhile regardless.Test plan
Fresh RN app on
react-native@0.88.0-nightly-20260717-b33de750b+react-native-enriched-markdown@0.8.0-nightly-20260716with the prebuilt-core flags CI uses (RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1), Xcode 26.6, stock React Nativespm.rb(i.e. without the RN-side fix), this podspec swapped intonode_modules:pod install:SWIFT_ENABLE_EXPLICIT_MODULES = NOlands on both configurations of the pod target; the strip phase is gone from the generated project.SwiftDriverinvocation no longer contains-explicit-module-build; BUILD SUCCEEDED with both duplicatemodule.modulemapcopies deliberately present.