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

Tool for prebuilt binaries #61

Open
mischnic opened this issue Dec 9, 2018 · 9 comments
Open

Tool for prebuilt binaries #61

mischnic opened this issue Dec 9, 2018 · 9 comments

Comments

@mischnic
Copy link
Contributor

mischnic commented Dec 9, 2018

In this issue kusti8/proton-native#179 (comment) develar mentioned that for "cross-packaging" (for a different platform) we should use https://www.npmjs.com/package/prebuild (so the platform/arch to download binaries for can be set via an environment variable by electron-builder (here).

@parro-it
Copy link
Owner

I don't see the reason why, we need only one version of the binaries, that's because we use N-API that has ABI compatibility

@mischnic
Copy link
Contributor Author

An example: I want to package an app on macOS for all three platforms. For that, electron-builder needs the respective binaries (this is about platform/architecture, not the node version). The requested platform is specified by the env variables in the electron-builder code I referenced (list of options here: https://github.com/mapbox/node-pre-gyp#options)

@parro-it
Copy link
Owner

But we already have the binaries published for the different OS... they're the ones downloaded to avoid compilation. Does electron-builder needs some different naming scheme for them?
Sorry, the it's probably just me not understanding the problem...

@mischnic
Copy link
Contributor Author

they're the ones downloaded to avoid compilation. Does electron-builder needs some different naming scheme for them?

No, it't just that electron-builder needs to download a binary for Windows if I'm creating a Windows package on my Mac. There is currently no way to do that.

@parro-it
Copy link
Owner

No, it't just that electron-builder needs to download a binary for Windows if I'm creating a Windows package on my Mac. There is currently no way to do that.

If it's not a problem about the name of the packages, so what exactly?
Nothing on our side prevents electron-builder to download whatever platform of the binaries it want, from whatever platform it's running...

@mischnic
Copy link
Contributor Author

If it's not a problem about the name of the packages, so what exactly?
Nothing on our side prevents electron-builder to download whatever platform of the binaries it want, from whatever platform it's running...

There has to be a way for a packaging tool to tell the libui-napi download tool which version it should download.

Nothing on our side prevents electron-builder to download whatever platform of the binaries it want, from whatever platform it's running...

No, because electron-builder doesn't download the binaries. libui-napi/tools/libui-download.js and libui-napi/tools/ibui-napi-download.js do.

@parro-it
Copy link
Owner

Maybe electron-builder does prefer another site to host the binaries?

@mischnic
Copy link
Contributor Author

mischnic commented Dec 10, 2018

Maybe electron-builder does prefer another site to host the binaries?

No, that is fine as it is.

There just has to be a way (by using process.env.npm_config_platform if it's specified) to override the os selection in the download tools of libui-napi:

const platform = nodePlatformToOS(opts.platform || os.platform());

@parro-it
Copy link
Owner

No, because electron-builder doesn't download the binaries. libui-napi/tools/libui-download.js and libui-napi/tools/ibui-napi-download.js do.

😝😝 I taked my time, but finally I understand what you mean!!
Ok, so I remember there is already an arch and os arguments in the download tools to allow to force a different architecture/os .

It's probably not working becuase noone never used it...
I'll give it a shot tonight and report here...

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

2 participants