electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.61k stars 1.74k forks source link

install-app-deps stores native modules for different architectures in same file (they overwrite each other) #2129

Closed koraa closed 6 years ago

koraa commented 7 years ago

Hi, I am currently trying to build an electron application that uses the native module printer@0.2.2; the build is for windows and linux for 32bit and 64bit intel architectures each (4 builds).

electron-builder automatically builds the native dependencies, which is very nice :+1: Unfortunately the result is always stored at node_modules/printer/build/Release/node_printer.node, so when I try to run my application the next time, I get this error: wrong ELF class: ELFCLASS32.

This error basically just tells me that the shared object/native module was built for the wrong architecture (32bit instead of 64bit). I can fix this by running electron-builder install-app-deps again, but it's not very pretty to do so…

It would be nice if electron-builder stored the native modules for different architectures in different files (node_printer.${os}.${arch}.node for example). This way it would not be necessary to rebuild the modules so often and it would not be possible to get one's own application into a state that won't launch (which might be confusing to the uninitiated).

develar commented 6 years ago

Sorry, but it is up to native node module author.