Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Pre-build for electron is broken #380

Closed
Kupstas opened this issue Apr 29, 2021 · 18 comments
Closed

Pre-build for electron is broken #380

Kupstas opened this issue Apr 29, 2021 · 18 comments

Comments

@Kupstas
Copy link

Kupstas commented Apr 29, 2021

v7.6.0 has a pre-build version for electron, but after update to v7.7.0 electron-builder shows me 404 error

@shiftkey
Copy link
Contributor

The big change with v7.7.0 is the switch to N-API for prebuilds #331 but I'm not sure how that would affect electron-builder. Do you know what URL it's trying to reach that's 404ing @Kupstas?

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

@shiftkey

 • build native dependency from sources  name=keytar
                                          version=7.7.0
                                          platform=darwin
                                          arch=x64
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 6.0.1
    prebuild-install info looking for cached prebuild @ /Users/nikolaykupstas/.npm/_prebuilds/00e678-keytar-v7.7.0-electron-v87-darwin-x64.tar.gz
    prebuild-install http request GET https://github.com/atom/node-keytar/releases/download/v7.7.0/keytar-v7.7.0-electron-v87-darwin-x64.tar.gz
    prebuild-install http 404 https://github.com/atom/node-keytar/releases/download/v7.7.0/keytar-v7.7.0-electron-v87-darwin-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=12.0.5 runtime=electron arch=x64 libc= platform=darwin)

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

install prebuilt binary  name=keytar version=7.6.0 platform=darwin arch=x64

this is normal log message

@sergiou87
Copy link
Collaborator

Weird, it shouldn't be looking for prebuilds with "electron-vXX" in them, as you can see in https://github.com/atom/node-keytar/releases/tag/v7.7.0

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

Maybe because for v7.6.0 you have 80 more pre-build versions?)

@sergiou87
Copy link
Collaborator

But those aren't needed anymore thanks to the N-API 😅

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

As you see they are still needed. Or maybe I do something wrong?

@shiftkey
Copy link
Contributor

I'm not familiar enough with electron-builder to know the fix currently, but the failure is because it's looking for runtime=electron and looking for the wrong prebuild. It should be choosing runtime=napi here, which is supported by rebuild-install.

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

electron-builder has no option to set runtime. It's always searching electron pre-build =(

I'll investigate this moment

@sergiou87
Copy link
Collaborator

Have you tried using DEBUG=electron-builder to get more debug info around that error?

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

Yep. There is no useful info

@sergiou87
Copy link
Collaborator

I don't think this will make a difference, but in the projects where I use N-API (or more specifically keytar), we have prebuild-install v6.1.1, while you have v6.0.1. Maybe try bumping that dependency and see if it works? 🤞

Looking at the release notes I don't think it will, but who knows… 🤞

@Kupstas
Copy link
Author

Kupstas commented Apr 29, 2021

I have a latest version of electron-builder. I've installed prebuild-install@6.1.2 but still have same error. I'll write an issue in electron-builder repo tomorrow

@dennisameling
Copy link
Contributor

This is a known issue with electron-builder, we also ran into it with sharp. The fix is for electron-builder to look for N-API prebuilds first. That PR has been merged and is currently pending release. There is a workaround that you can use for the time being, until a new version of electron-builder has been released.

@ashgrover
Copy link

I'm running into this issue as well. The workaround mentioned in electron-builder issue #5438 does not work either. Does anyone know any other workarounds? I'd really appreciate if someone could assist me with this.

@dennisameling
Copy link
Contributor

dennisameling commented Jun 14, 2021

Versions 22.11.1 and higher of electron-builder include the fix for this issue (specifically it includes app-builder-bin 3.5.13 which has the fix).

Please report back here if those versions work for you 👍🏼

AttemptToCallNil added a commit to AttemptToCallNil/MAGE that referenced this issue Jun 14, 2021
Preparing for the postcss update. Note:
- Keytar is intentionally pinned to 7.6.0 due to an electron-builder
  bug that makes 7.7.0 not work.
  atom/node-keytar#380
  electron-userland/electron-builder#5438
@ashgrover
Copy link

@dennisameling
Thank you! I can confirm it works with the latest version of electron-builder on all three platforms(Windows, macOS and Ubuntu).

Turns out nodejs was out of date on my machine and latest version of electron-builder was incompatible with it so it never got upgraded when I ran yarn upgrade --latest. I don't know I how I missed to see that electron-builder was out of date.

After upgrading nodejs and electron-builder it worked without any issues.

Thanks again,
Ash

@sergiou87
Copy link
Collaborator

Nice! I'm glad that works 😌  Thank you @dennisameling for your wisdom and @ashgrover for confirming! ❤️

I guess this can be closed now 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants