-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Can't run bundles relying on Argon2 with Electron Builder 24 and up on x64 macOS #374
Comments
You are building it on ARM64 and trying to run on x86_64. This will not work, currently it only installs the version for the current architecture when you add argon2, so you can't directly bundle it. |
Thanks for your reply @ranisalt! Actually it's the reverse - I'm on x64 trying to bundle for both x64 and ARM64 - but aren't there prebuilt binaries for this purpose? I guess you're saying only one of the prebuilts will be installed? Is there any way around this so we can provide users with an universal Electron installer that covers both x64 and ARM64? Or otherwise, if we offer separate downloads, is there a way to create an ARM64 bundle on an x64 machine? (Actually that seems to be what we're already (accidentally) doing. Or is there some way this could be accommodated in the future? This issue doesn't affect other native dependencies we use, (eg. Sharp.) |
I guess the issue is that
If your module uses prebuild for creating prebuilt binaries, it also uses prebuild-install to download them. If this is the case, then electron-rebuild will run prebuild-install to download the correct binaries from the project's GitHub Releases instead of rebuilding them. -- https://github.com/electron/rebuild#how-can-i-integrate-this-with-prebuild I'm guessing I'm misunderstanding something because it runs fine in development, but it seems to have the wrong version in the bundled app. Or maybe |
I don't know how electron-builder works, but it needs to download argon2 during runtime, not during build-time. So, if you are building and packaging your app, and that gets sent to another system, it will not run.
That is the case. Instead, I actually want to use prebuildify to ship all binaries in the package, skipping the download step. It means some ~150 extra KBs on the package, but that's less than the dependencies needed to figure out what file to download anyway. From your error log, though:
You are packaging the arm64 binary, but running the resulting executable on x86_64? |
Hey @ranisalt, I just a found a few minutes ago that the issue is actually in @electron/rebuild and submitted a PR - I apologize for the wild goose chase. Relevant PR: electron/rebuild#1076. I think prebuildify sounds like a good solution though - I think you also mentioned it in #364, although not by name and it sounds like it may reduce the shipped size, although I suspect the binaries are not very compressible so maybe it won't. In any event, developer time is worth more than a few KBs, right? I support the prebuildify idea! Thanks again for all your great work. |
I think the
That appears to be the case. Definitely running on For now we're going back to just packaging |
@ranisalt nice work with the new release! I wonder if you have any updates/thoughts about supporting Electron universal builds? I'm working on confirming a potential solution to this issue for the Thank you again for continuing to build and support this great project! |
@slapbox hey, I'm still looking to just bundle all architectures in the package as we've talked about before, but it's not as trivial as I expected. I was working on the node-gyp-build branch, now it's slightly out of sync with master, so I'll try to rebase that, but it's promising. |
Thank you again so much for everything you do @ranisalt! |
@slapbox you can experiment using the alpha version by installing Note that it is also ESM-only but it shouldn't be a problem |
I experimented argon2@next for an arm64 build on bitwarden cli. |
Should be fixed with v0.40.1 |
Important: I'm not sure this is an Argon2 issue, it may be an Electron-Builder issue
Before creating an issue, please be sure to:
Steps to reproduce
Expected behaviour
"Just works"
Actual behaviour
Environment
Operating system: macOS 12.6.4
Node version: 16.18.0
Compiler version: ???
Additional information:
I decided to create this issue report after proving that other native dependencies (like Sharp) do not suffer this issue with Electron Builder 24. I'm not sure where exactly the issue lies. I suspect with Electron-Builder, but we're sort of at an impasse there. Do you have any ideas what the cause could be @ranisalt? Relevant issue: electron-userland/electron-builder#7512
electron-builder@24.x
implements@electron/rebuild
which didn't used to be used in the build process - I wonder if this issue is relevant? electron/rebuild#1055The text was updated successfully, but these errors were encountered: