Skip to content

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

Open
mfazekas wants to merge 1 commit intomainfrom
fix/xcode-26-compat
Open

fix: Xcode 26 compatibility — strip .Swift submodule from RiveRuntime modulemaps#174
mfazekas wants to merge 1 commit 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
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+

1 participant