Skip to content

fix(🐛): rename leftover rnwgpu namespace to RNJsi to fix ODR clash - #3991

Merged
wcandillon merged 2 commits into
mainfrom
fix/jsi-namespace-collision
Aug 5, 2026
Merged

fix(🐛): rename leftover rnwgpu namespace to RNJsi to fix ODR clash #3991
wcandillon merged 2 commits into
mainfrom
fix/jsi-namespace-collision

Conversation

@wcandillon

Copy link
Copy Markdown
Contributor

The typed-JSI-bindings migration copied the NativeObject/JSIConverter files from react-native-webgpu but left eight files in the rnwgpu namespace. When both libraries are linked into one app, the template instantiations (e.g. rnwgpu::StaticRuntimeAwareCache<rnwgpu:: PrototypeCacheEntry>::get) have identical mangled names in both packages with different bodies. The linker keeps a single weak definition, so webgpu's prototype installation can execute Skia's copy, which reads RNJsi::BaseRuntimeAwareCache::_mainRuntime before RNSkManager has set it and aborts:

Assertion failed: (rt != nullptr && "Expected main Javascript
runtime to be set in the BaseRuntimeAwareCache class."),
RuntimeAwareCache.h line 27

Moving the copied files into RNJsi gives every colliding symbol a distinct mangled name. Verified against react-native-webgpu@0.8.1: the assert reproduced before the rename and the app boots cleanly after, with both packages' cache instantiations present in the binary.

fixes wcandillon/react-native-webgpu#367

wcandillon and others added 2 commits August 5, 2026 10:21
…th react-native-webgpu

The typed-JSI-bindings migration copied the NativeObject/JSIConverter
files from react-native-webgpu but left eight files in the rnwgpu
namespace. When both libraries are linked into one app, the template
instantiations (e.g. rnwgpu::StaticRuntimeAwareCache<rnwgpu::
PrototypeCacheEntry>::get) have identical mangled names in both
packages with different bodies. The linker keeps a single weak
definition, so webgpu's prototype installation can execute Skia's
copy, which reads RNJsi::BaseRuntimeAwareCache::_mainRuntime before
RNSkManager has set it and aborts:

  Assertion failed: (rt != nullptr && "Expected main Javascript
  runtime to be set in the BaseRuntimeAwareCache class."),
  RuntimeAwareCache.h line 27

Moving the copied files into RNJsi gives every colliding symbol a
distinct mangled name. Verified against react-native-webgpu@0.8.1:
the assert reproduced before the rename and the app boots cleanly
after, with both packages' cache instantiations present in the
binary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wcandillon
wcandillon merged commit 923476c into main Aug 5, 2026
19 checks passed
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.10.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.11.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reopen #323: expo SDK 54: iOS build fails when using both react-native-wgpu (0.5.11) and @shopify/react-native-skia (2.6.4)

1 participant