Skip to content

Commit 495b307

Browse files
chrfalchreact-native-bot
authored andcommitted
Use correct version of jsi.cpp (#53266)
Summary: When building the xcframeworks on iOS we're including the file `jsi/jsi.cpp` in the Swift Package. This file is also included in Hermes and React Native should use the hermes version of these symbols. This is even described (but overlooked) in the React-jsi podspec file. This causes the error seen in the bug addressed by this commit. The fix is to exclude the `jsi/jsi.cpp` file from the jsi target in our swift package. Fixes #53257 ## Changelog: [IOS] [FIXED] - Fixed wrong jsi symbols in use when using React.xcframework Pull Request resolved: #53266 Test Plan: Tested using a precompiled xcframework in the reproduction repository. Reviewed By: rshest Differential Revision: D80252131 Pulled By: cipolleschi fbshipit-source-id: 915e94a1d80c2f45575e58d8054239484e861285
1 parent cfd06d8 commit 495b307

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-native/Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ let reactDebug = RNTarget(
8484
let jsi = RNTarget(
8585
name: .jsi,
8686
path: "ReactCommon/jsi",
87-
excludedPaths: ["jsi/test", "CMakeLists.txt", "jsi/CMakeLists.txt"],
87+
// JSI is a part of hermes-engine. Including them also in react-native will violate the One Definition Rule.
88+
// Precompiled binaries are only supported with hermes - so we can safely exclude the jsi.cpp file.
89+
// https://github.com/facebook/react-native/issues/53257
90+
excludedPaths: ["jsi/test", "jsi/jsi.cpp", "CMakeLists.txt", "jsi/CMakeLists.txt"],
8891
dependencies: [.reactNativeDependencies]
8992
)
9093

0 commit comments

Comments
 (0)