You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This indicates that the prebuilt binary is compiled for arm64 instead of x86_64.
Workaround
We were able to work around these issues locally by:
Patching node-datachannel:
We modified the build configuration (in cmake/toolchain/ci.cmake) to ensure that the C++ compiler flags include -frtti (enabling RTTI).
The current approach to work around these problems involves manually patching node-datachannel’s build configuration and explicitly rebuilding the module from source (e.g., using npm rebuild node-datachannel --build-from-source and setting npm_config_arch=x64 on Intel Macs). This process requires custom CI scripts and local workarounds, which is not ideal. Ideally, the prebuilt binaries should be compiled correctly for Electron:
RTTI Enabled: Ensuring that the module is built with RTTI support (i.e. without -fno-rtti).
We are using Electron with @libp2p/[email protected] which depends on [email protected]. We encountered two major issues:
The native module fails with an undefined RTTI symbol error:
This appears to be due to the binary being built with RTTI disabled (likely via
-fno-rtti
).When running the app on an Intel Mac, we see:
This indicates that the prebuilt binary is compiled for arm64 instead of x86_64.
Workaround
We were able to work around these issues locally by:
We modified the build configuration (in
cmake/toolchain/ci.cmake
) to ensure that the C++ compiler flags include-frtti
(enabling RTTI).js-node-datachannel/cmake/toolchain/ci.cmake
Line 23 in 844e1dd
We ran:
This resulted in a freshly built
node_datachannel.node
with the correct RTTI support.Why it's important?
We observed the same issues when testing with latest @ipshipyard/node-datachannel version
^0.26.4
and @libp2p/webrtc version^5.1.0
.The current approach to work around these problems involves manually patching node-datachannel’s build configuration and explicitly rebuilding the module from source (e.g., using
npm rebuild node-datachannel --build-from-source
and settingnpm_config_arch=x64
on Intel Macs). This process requires custom CI scripts and local workarounds, which is not ideal. Ideally, the prebuilt binaries should be compiled correctly for Electron:RTTI Enabled: Ensuring that the module is built with RTTI support (i.e. without
-fno-rtti
).PR:
p2plabsxyz/peersky-browser#18
The text was updated successfully, but these errors were encountered: