Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@electron/rebuild ignores symlinks for native modules, which crashes the application #1123

Open
beshkenadze opened this issue Jan 25, 2024 · 1 comment

Comments

@beshkenadze
Copy link

Great! Including a demo project to reproduce the bug is an excellent way to provide additional context and aid in troubleshooting. Here's a revised version of your GitHub issue incorporating the link to your demo project:


Body:

Environment:

  • Electron Forge version: 7.2.0
  • Electron version: v28.2.0
  • Operating System and version: macOS Sonoma 14.2.1
  • Last known working Electron Forge version (if applicable): n/a

Issue Description:
When using electron-rebuild in my Electron Forge project, I've encountered a bug where the symlinks for native modules are ignored during the copy process. This leads to crashes, as the necessary libraries are not correctly linked.

Steps to Reproduce:

  1. Clone the demo project: https://github.com/beshkenadze/electron-forge-native_modules-symlink-bug
  2. npm i & npm run start

Expected Behavior:
The electron-rebuild process should handle symlinks in native_modules correctly, ensuring that all necessary libraries are properly linked and accessible.

Actual Behavior:
Symlinks in native_modules are ignored during the rebuild process, causing runtime crashes due to missing library links.

Additional Information:

App threw an error during load
Error: dlopen(/Users/.../my-new-app/.webpack/main/native_modules/lib/napi-v8/tfjs_binding.node, 0x0001): Library not loaded: @loader_path/../../deps/lib/libtensorflow.2.dylib
  Referenced from: <DE780050-AAAC-3B4D-955D-C8090D464B45> /Users/.../my-new-app/.webpack/main/native_modules/lib/napi-v8/tfjs_binding.node
  Reason: tried: '/Users/.../my-new-app/.webpack/main/native_modules/lib/napi-v8/../../deps/lib/libtensorflow.2.dylib' (no such file)

Screenshots/Logs:

Orignal libs

orignal_libs

Copied libs

copied_libs
@beshkenadze
Copy link
Author

Maybe related to electron/forge#2126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant