Skip to content
This repository has been 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
pcjcos pushed a commit to MediaWikiAGE/MAGE that referenced this issue Jun 14, 2021
* Update dependencies, part 1

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

* Update dependencies, part 2

Mostly preparing to get rid of unsupported and vulnerable PostCSS 7.
Notes:
 - This requires a lot of beta versions for Vue-related packages.
   Non-beta versions tend to depend on PostCSS 7.
 - PostCSS 7 is still not eliminated entirely as one of the Vue packages
   still requires 7.
 - The babel-eslint package is deprecated, but can't be upgraded to the
   non-deprecated @babel/eslint-parser package, otherwise the standard
   build process would be broken.
 - The change in the SVG icon component was needed to make SVG icons
   display again. Not sure why this happened.
 - It seems Electron 13 can't be used due to no support from Keytar.

* Fix sorting functions in spellbook.js

* Fix login form allowing to enter "new" data under existing names

This silently overwrote and/or added to old settings. Now it's a
validation error.

* Fix saving wiki farms with certain URL patterns

Closes: #67

* Adjust breakpoints in the login screen

Closes: #65

* Increase vertical spacing in the login form

That makes the fields much more clearly separated.
Closes: #64

* Add event handlers for modals

Currently just the Escape key is handled to close the modal.

Closes: #63

* Update dependencies, part 3

This gets rid of the PostCSS security alert. Unfortunately, two
new and unrelated vulnerabilities were reported in other indirect
dependencies two days ago.

Closes: #66

* Address keyboard navigation in task view modals

The actual view still has some issues.

* Switch to Tailwind utility

and adjust the lightness slightly. This should also fit both light
and dark themes (somewhat).

* Improve task view navigation further

Add focus indicators, fix elements that shouldn't be focusable,
fix the "no input" zone of "Enabled?" checkboxes, and extract the
"deferred focus" hack into its own method. Sigh.

Closes: #59

* Fix logic error with deferred focusing

That added one iteration to the loop = extra 50 milliseconds of waiting.
Improves switching times when the conditionally-rendered element
is absent from the DOM entirely (read: `v-if`).

* Make the controls on the home page more separated

Like with the changes to the login menu.

* Improve keyboard navigation for the home view

Like with the tasks view. Also de-cluttered the HTML by using
`@apply` in a `<style>` rather than specifying all utilities
inline.

* Improve focusing indication in the login view as well

* Import jquery

Why didn't anyone do this before?

* Implement class-based dark mode handling

Simplifies style testing.

Closes: #61

* Persist home view state

This should actually be not just a major usability issue, but a
critical matter of communicating state to other components.

* Fix logic error in home view

Otherwise this will print errors about accessing the `accounts`
property of `undefined`.

* Persist login view data

* Improve inactive input visibility in dark login view

* Persist task view state.

This does not persist actual task process. This will have to be handled
very, very differently, and I'm not sure how yet.

Closes: #53

* Fix improperly using event handler
@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