-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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-builder and cross platform build #1697
Comments
The However electron/rebuild#176 suggests that |
Thanks for your fast response. I am a little bit confused which electron-userland build tools is using other libraries like electron-rebuild :D and how without digging to deep into them. And in the electron-build documentation it is mentioned that crossplatform builds are possbile if the native module provides prebuilds for each platform.
|
Hey i checked the output of my ci when building the app on ubuntu for macos:
and electron-builder seems like to use node-pre-gyp |
The options listed at https://www.electron.build/configuration/configuration#Configuration-buildDependenciesFromSource might help, e.g. Failing that you'll need to ask this on the relevant electron repo - good luck! |
@lovell yeah sorry to bother you with that. But like i said i lost my mind during searching through all the possibilities. And do not understand the arguments. I thought buildDependenciesFromSource does not use the prebuild ones, instead it builds the things from source code. and npmRebuild is the right option to rebuild node-modules for the correct platform during the build step. So sorry and thanks for your help :). Nice support and fast. |
so i will close this issue here. Thanks again 👍 |
Sorry to bump a closed issue, but I think this is still the case and I think the only way to make it work is to build under the target platform rather than cross-compiling. Here is what I found out: 1/ Pre-v0.26, separate electron prebuilts were provided, but it seems that with v0.26, there is a single napi release. electron-builder uses a package called
This fails since it makes a request to the following non-existent url: https://github.com/lovell/sharp/releases/download/v0.26.2/sharp-v0.26.2-electron-v76-win32-x64.tar.gz pre-0.26, it was making a request to the following url, which succeeded: 2/ The issue of libvips. However, even at v0.25, it was not properly working since libvips was still using the host library version. So, the correct That leads me to conclude that the only way to make it work is to build on the target platform (or via docker.) Could you please confirm that is the case or do you know if there is anything I'm missing? |
@ustun As of v0.26.0, Electron should use the same N-API binaries as Node.js - see commit dcc42f8 - make sure you're not overriding If you're still having problems, please open a new issue with a reference to a complete, standalone code repo that allows someone else to reproduce this. |
Thank you for the explanation @lovell I believe the issue is with prebuilt-install and electron-builder. I'll ask those maintainers on how to proceed. In the meantime, we are planning to use GitHub Action to compile and get a prebuilt version for our needs. |
Hey there i want to build a macos electron app on an ubuntu machine.
Sharp is the only "native" module. But i think the problem is, that when electron-builder is running, it simply uses the linux native module instead of installing the version for the target electron build os.
Is this even possible or is there a way to achieve this?
The build on my CI works withou any error, but when i start my app it freezes directly without throwing an error. If i remove sharp, it works again.
I thought when this repo provides all native prebuilts electron-builder downloads the one necessary for the target platform.
The text was updated successfully, but these errors were encountered: