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
{{ message }}
Repository navigation
macOS prebuild code signing issues with ANGLE binaries #314
Since 8.1.6, the build process has been changed to no longer build the ANGLE code from source, but to include the already built binaries/dynamic libraries (from a Chrome install?) in the repo. This simplifies and speeds up the build step, in addition to updating the project to use a non-severely-outdated version of ANGLE.
However, one side effect is that on macOS, these files –specifically libEGL.dylib and libGLESv2.dylib– when packaged up into the prebuild files –along with webgl.node– lead to the Node runtime crashing when webgl.node is loaded after the gl package's main method is run.
I've done some digging and here are the reproducible steps on macOS:
in a fresh repo, install the gl package through npm: npm install gl@9.0.0-rc.3
start a node REPL (or create and run a script file) with const gl = require("gl")(10, 10)
💥
Note that the RC3 version is important as this one has macOS prebuilt binaries still included. RC4 has them disabled and RC2 and lower have missing files.
I managed to fix the prebuilt ANGLE files locally by navigating to node_modules/gl/build/Release and running codesign -f -s - libGLESv2.dylib and codesign -f -s - libEGL.dylib to re-codesign the packages (presumably with my local machine's toolchain and signing info – I'm not entirely sure). This results in the library behaving as intended. However, this is a local-only solution, and not suitable for distribution. Also note that simply removing the signature (via --remove-signature), if there is any, has no effect.
In the meantime, I've disabled prebuilt binaries for macOS, and instead opted to force installing macOS users to build from source. This might be an OK compromise as most devs are doing development on macOS (as opposed to deployment) and likely have the requisite build tools available.
Note: I have not tested the Linux or Windows prebuilds yet. The code signing issue may not affect Linux. I do not have a Windows machine to test with.
Hey Daniel, I'm also unfamiliar with OSX code signing. I picked up the ANGLE libs from the Chrome distribution, so they should be signed in a way that Chrome could use them. I'll let you know if I have any time in the future to follow up. It won't be in the next few weeks for sure.
Activity
dhritzkiv commentedon Apr 7, 2025
@null77 would you happen to have any insight into this issue? Either a quick fix or a long term solution?
Packaging/Codesigning/Distributing native code is not something I am familiar with.
null77 commentedon Apr 8, 2025
Hey Daniel, I'm also unfamiliar with OSX code signing. I picked up the ANGLE libs from the Chrome distribution, so they should be signed in a way that Chrome could use them. I'll let you know if I have any time in the future to follow up. It won't be in the next few weeks for sure.
dhritzkiv commentedon Apr 8, 2025
No worries! I only pinged you in case you had ideas.
wefhy commentedon Jul 22, 2025
I've been facing this issue as well. Can confirm that
v9.0.0-rc.6works fine.