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

Error while rebuilding for arm #1140

Closed
VitorAndrey opened this issue Feb 9, 2024 · 5 comments
Closed

Error while rebuilding for arm #1140

VitorAndrey opened this issue Feb 9, 2024 · 5 comments

Comments

@VitorAndrey
Copy link

VitorAndrey commented Feb 9, 2024

Hello! Thnx for your time in advance.
I am trying to use better-sqlite3 in my electron aplication wich is supposed to run in raspberry pi 3 so arch amrv7l. I tested in windows at first and it worked perfectly, got this error while rebuilding for this new platform.

me@raspberrypi:~/leitor-de-preco-ts $ LIZ_COMPAT=1
me@raspberrypi:~/leitor-de-preco-ts $ npm i

> [email protected] postinstall
> electron-builder install-app-deps

  • electron-builder  version=24.9.1
  • loaded configuration  file=/home/me/leitor-de-preco-ts/electron-builder.yml
  • rebuilding native dependencies  [email protected] platform=linux arch=armv7l
  • install prebuilt binary  name=better-sqlite3 version=9.4.0 platform=linux arch=armv7l napi=
  • build native dependency from sources  name=better-sqlite3
                                          version=9.4.0
                                          platform=linux
                                          arch=armv7l
                                          napi=
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 7.1.1
    prebuild-install warn install prebuilt binaries enforced with --force!
    prebuild-install warn install prebuilt binaries may be out of date!
    prebuild-install info looking for local prebuild @ prebuilds/better-sqlite3-v9.4.0-electron-v119-linux-armv7l.tar.gz
    prebuild-install info looking for cached prebuild @ /home/me/.npm/_prebuilds/3289b1-better-sqlite3-v9.4.0-electron-v119-linux-armv7l.tar.gz
    prebuild-install http request GET https://github.com/WiseLibs/better-sqlite3/releases/download/v9.4.0/better-sqlite3-v9.4.0-electron-v119-linux-armv7l.tar.gz
    prebuild-install http 404 https://github.com/WiseLibs/better-sqlite3/releases/download/v9.4.0/better-sqlite3-v9.4.0-electron-v119-linux-armv7l.tar.gz
    prebuild-install warn install No prebuilt binaries found (target=28.2.2 runtime=electron arch=armv7l libc= platform=linux

What I already tried: setting the LIZ_COMPAT=1 env variable as I found in old issues.

@Prinzhorn
Copy link
Contributor

Prinzhorn commented Feb 9, 2024

This is not an error but a warning that no prebuild was found. You should still be able to compile locally.

@m4heshd any idea why there is no linux arm prebuild for v119? Looking at the assets https://github.com/WiseLibs/better-sqlite3/releases/tag/v9.4.0 I'm confused why for some versions they are missing? E.g. v115 and v120 have linux arm builds, but not v119

@VitorAndrey
Copy link
Author

@Prinzhorn Thanks for helping! I'm sorry if this is trivial, but I've never done it before. I just need to download the corresponding package version for my architecture at https://github.com/WiseLibs/better-sqlite3/releases/tag/v9.4.0? After that, how do I compile locally?

@Prinzhorn
Copy link
Contributor

@VitorAndrey this all happens automatically when prebuild fails, but you've seem to have that disabled

warn install prebuilt binaries enforced with --force

@m4heshd
Copy link
Contributor

m4heshd commented Feb 9, 2024

@m4heshd any idea why there is no Linux arm prebuild for v119?

Module version 119 is reserved by Electron (v28 to be specific). Unfortunately, we're not building for Electron on arm at the moment.

Now that arm is sort of becoming major on desktop, practically we should build for Electron on arm but the current method we're using to build for arm is notoriously slow. Qemu has a reputation for being just that. BS3's build workflow would take days to finish if we were to do that.

I recently added a feature to BS3 for building arm64 binaries natively on mac. As I mentioned in the PR note, there IS a possibility of building Linux arm builds on that very same runner. But still, I'm not exactly sure how armv7 builds would behave in that environment. Technically, should build fine with similar performance as arm64 builds. Can't be sure till we try though.

UPDATE:
Unfortunately, this won't be a possibility in the near future since M1 lacks support for nested virtualization. Just learned this, not a mac user myself. So it's a no-go for Qemu and any sort of emulation on this runner.

@VitorAndrey
Copy link
Author

VitorAndrey commented Feb 14, 2024

@Prinzhorn, @m4heshd, thank you so much for your time and assistance. It turns out that using Electron Rebuild worked. I ran electron-rebuild -f -w better-sqlite3, and it generated all the necessary components to make the library work in the Raspberry Pi 3 environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants