Skip to content

fix: Xcode 26 compatibility — strip .Swift submodule from RiveRuntime modulemaps#174

Merged
mfazekas merged 2 commits intomainfrom
fix/xcode-26-compat
Mar 13, 2026
Merged

fix: Xcode 26 compatibility — strip .Swift submodule from RiveRuntime modulemaps#174
mfazekas merged 2 commits intomainfrom
fix/xcode-26-compat

Conversation

@mfazekas
Copy link
Collaborator

@mfazekas mfazekas commented Mar 6, 2026

Fixes #173

RiveRuntime's prebuilt XCFramework was built with Swift 6.1. Xcode 26 uses Swift 6.2. Both generate .Swift Clang submodules with different C++ interop type definitions (swift::Optional, swift::String, etc), causing hard ODR errors that can't be suppressed. This is CocoaPods-specific — SPM is unaffected because it uses .swiftmodule files directly.

The fix hooks into CocoaPods' pre_install via Module#prepend in the podspec to strip the .Swift submodule from RiveRuntime's prebuilt modulemaps. This is transparent to users — no Podfile changes needed.

Modulemap patch

 framework module RiveRuntime {
   umbrella header "RiveRuntime.h"
   export *

   module * { export * }
 }
-
-module RiveRuntime.Swift {
-  header "RiveRuntime-Swift.h"
-  requires objc
-}

Build error without fix (Xcode 26.2)

RiveRuntime-Swift.h:3603:62: error: '(lambda ...)' has different definitions in different modules;
  first difference is definition in module 'RiveRuntime.Swift' found method 'operator()' with body
RiveRuntime-Swift.h:3596:78: error: 'swift::Optional::init' has different definitions in different modules;
  definition in module 'RiveRuntime.Swift' first difference is 1st parameter with name 'some_'
LocalCxxPod-Swift.h:2177:29: error: 'swift::UTF8View' has different definitions in different modules
LocalCxxPod-Swift.h:1984:37: error: 'swift::String' has different definitions in different modules
LocalCxxPod-Swift.h:1722:52: error: 'swift::Optional' has different definitions in different modules;
  first difference is definition in module 'LocalCxxPod.Swift' found method 'init' with 1st parameter named 'value'

After fix

BUILD SUCCEEDED (Xcode 26.2, clean DerivedData, pod install + xcodebuild)

… modulemaps

RiveRuntime's prebuilt XCFramework (Swift 6.1) and locally-compiled pods
(Swift 6.2) generate conflicting C++ interop type definitions, causing
hard ODR errors on Xcode 26. This hooks into CocoaPods pre_install to
strip the .Swift Clang submodule from RiveRuntime's modulemaps.

Fixes #173
Copy link
Contributor

@HayesGordon HayesGordon left a comment

Choose a reason for hiding this comment

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

LGTM

@mfazekas mfazekas merged commit e82c4be into main Mar 13, 2026
9 checks passed
@mfazekas mfazekas deleted the fix/xcode-26-compat branch March 13, 2026 08:58
mfazekas pushed a commit that referenced this pull request Mar 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.2.8](v0.2.7...v0.2.8)
(2026-03-13)


### Bug Fixes

* Xcode 26 compatibility — strip .Swift submodule from RiveRuntime
modulemaps
([#174](#174))
([e82c4be](e82c4be))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

@rive-app/rive-nitro-react-native 0.2.6 does not work with Xcode 26+

2 participants