Skip to content

[0.87] fix(iOS): dedupe SPM package module maps by building spm_dependency pods into the shared products dir #1350

Description

@cipolleschi

Target Branch

0.87

Link to commit or PR to be picked

react/react-native#57602
(commit on main: react/react-native@4a66207)

Description

This is a hotfix for a breaking iOS build failure. On Xcode 26.3 (the current CI runner version), pods that declare an spm_dependency on a Swift package containing a C-family target fail to build with error: redefinition of module '<Module>FFI'. Xcode emits the package's generated include/module.modulemap twice (into the shared products dir and into the pod's own CONFIGURATION_BUILD_DIR), and clang hard-errors on the duplicate on Xcode 26.3.

The already-shipped SWIFT_ENABLE_EXPLICIT_MODULES=NO opt-out is confirmed insufficient. This fix builds static-library spm_dependency pod targets straight into the shared products dir so both module-map references resolve to the same file (clang dedupes same-path module maps). USE_FRAMEWORKS=dynamic behavior is unchanged, and the change is inert for projects without any spm_dependency pod.

This supersedes the incomplete workaround in react/react-native#57589 and unblocks the nightly-tests CI job. The commit is already merged into main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type Pick RequestPick requests to include commits inside a React Native release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions