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

Output directory structure for native modules for Electron - any risks here? #177

Open
witcher112 opened this issue Jan 20, 2023 · 0 comments

Comments

@witcher112
Copy link

Hi!

First of all, thanks for the great project, I made my Rush monorepo work with electron-builder thanks to that!

I wanted to ask about the situation with the output directory structure for Electron. I saw electron-forge uses a directory called "narive_modules" but I couldn't find any information on why. Besides that, in the code itself, there is a comment:

// retain directory depth structure for binaries for rpath to work out

It seems important as well but I still can't understand how it matters. (do some packages have tendencies to do some relative path operations with native modules?)

I would be very grateful if someone can explain the reasons for all of that, I just want to be sure that nothing could ever break in my app if I use a different output structure.

PS. I actually did a modification that allows prefixing the output path with the package name so instead of output structure like:

  • main.js
  • build/Release/keytar.node
  • prebuilds/win32-x64/node.napi.node

we can get:

  • main.js
  • keytar/build/Release/keytar.node
  • ffi-napi/prebuilds/win32-x64/node.napi.node

(my fork is based on @MarshallOfSound which makes the package work with modules like node-ffi)

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