Commit e82c4be
authored
fix: Xcode 26 compatibility — strip .Swift submodule from RiveRuntime modulemaps (#174)
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
```diff
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`)1 parent 9831e19 commit e82c4be
1 file changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
33 | 55 | | |
34 | 56 | | |
35 | 57 | | |
| |||
0 commit comments