3.18-1 beta fails on aarch64 source build #1326
Description
I'm having non-stop troubles starting the latest Patchwork release while attempting to build it from source using #1324 neon-arm64 branch. Any guidance appreciated. Here is what I'm seeing.
$ npm start
ssb-patchwork@3.18.1-beta.1 start /home/rock/patchwork
electron index.js
/home/rock/patchwork/node_modules/electron/index.js:14
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (/home/rock/patchwork/node_modules/electron/index.js:14:11)
at Object. (/home/rock/patchwork/node_modules/electron/index.js:18:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/home/rock/patchwork/node_modules/electron/cli.js:3:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ssb-patchwork@3.18.1-beta.1 start: electron index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ssb-patchwork@3.18.1-beta.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Activity
black-puppydog commentedon Nov 13, 2020
Hi there :)
yeah, figuring out how to build with neon for arm was actually the main point of the beta. I already looked into it for a bit. It seems to be mostly a matter of build environment. See #1324
Thanks for looking into this in any case!
If you just want to run patchwork, then running off the last release (or
masterbefore the neon commits) is of course the easiest. But I'm sure you know that. :)sunjam commentedon Nov 13, 2020
sunjam commentedon Nov 13, 2020
$ npm start
App threw an error during load
Error: No native build was found for platform=linux arch=arm64 runtime=electron abi=82 uv=1 armv=8 libc=glibc node=12.16.3 electron=10.1.5
loaded from: /home/rock/patchwork/node_modules/ssb-keys
Error: No native build was found for platform=linux arch=arm64 runtime=electron abi=82 uv=1 armv=8 libc=glibc node=12.16.3 electron=10.1.5
loaded from: /home/rock/patchwork/node_modules/ssb-keys
black-puppydog commentedon Nov 13, 2020
Yes, the "no native build" error message is from the neon bindings for rust.
Just to be clear: currently,
masteris the same commit from which the last beta was built and will not build on arm64.I just pushed a tag
pre-rustthat marks the last "good" commit.sunjam commentedon Nov 13, 2020
Thanks, I'd just like to clarify how this process works.
git checkout -b pre-rustUnsure on what to do next to get Patchwork up and running locally. Still wrapping my head around this.
black-puppydog commentedon Nov 14, 2020
@sunjam no, if you do
checkout -bthis will create a branch calledpre-rust, but keep that branch at the same commit as where you are currently. To switch to the tag, simply dogit checkout pre-rust(without "-b"). That will print some warnings about not being on a branch any longer. So if you then want to create a branch at the same commit, you can follow the advice in the warning and dogit switch -c rust-freeto create therust-freebranch. But that isn't necessary to build the application.As for building... since you've been experimenting a bunch and have god-knows-which state in the build cache, I personally would simply
rm -r node_modulesto start from a blank slate. Theoretically, runningnpm cishould be enough then (and thennpm startto launch of course) but since you're on arm... Ifnpm cifails, better runnpm iwhich will take longer but should have a better chance of working.I'll try this on my arm machine without the rust bindings... let's see. :)
black-puppydog commentedon Nov 14, 2020
Okay I just confirmed that the above works for me on the r400
sunjam commentedon Nov 15, 2020
I haven't updated npm in about a year and seems I'm on 8.0.0 when modern stable is 15.x so the update process is a total nightmare. :( Still struggling
black-puppydog commentedon Nov 15, 2020
@sunjam I think if you remove
node_modulesand then rebuild with modern npm, it should not really be an upgrade process?Or do you mean you didn't upgrade patchwork in a year? I don't think we changed thaaaat much in the last year, so the upgrade should mostly be maintaenance stuff....
sunjam commentedon Nov 15, 2020
Stuck on nvm 8.0.0 even though I try to switch to current stable
black-puppydog commentedon Nov 15, 2020
have you tried simply
nvm install-latest-npm?sunjam commentedon Nov 15, 2020
Yeah, see bottom of comment above. I just feel like I'm running in circles on this. Unsure on how to rebuild this.
black-puppydog commentedon Nov 15, 2020
hmmm... after re-reading the nvm help strings I'm left unsure whether that's any different from what you did. there seem to be two distinct commands...
edit: in any case, just to make sure, what does
npm --versiongive you with the current setup?sunjam commentedon Nov 15, 2020
$ npm --version
6.14.8
@black-puppydog what is the best method to "rebuild with modern npm"? Thanks for the assistance!
black-puppydog commentedon Nov 15, 2020
So, on x64 (!) I get these here:
and then
rm -rf node_modules && npm ciworks fine.HOWEVER: when I then launch patchwork it opens a blank window and then prints a bunch of ABI mismatch errors.
So I think I'll re-try the whole thing with
nvm use --lts, and in parallel I'll also check with the raspi. :)EDIT: to clarify, this is on the
pre-rusttag's commit.black-puppydog commentedon Nov 15, 2020
Okay, unsurprisingly the x64 was "a bit" faster. and runs fine after
nvm use --lts && npm ci && npm start -- --no-sandboxblack-puppydog commentedon Nov 15, 2020
Confirmed to be working on the raspi. So, could you try with
nvm use --lts?sunjam commentedon Nov 15, 2020
Back to same kinds of errors as when I started.
black-puppydog commentedon Nov 15, 2020
okay I feel like there's some assumption of mine that's not holding up.
from my understanding, this line should only show up if you're trying to compile a version that includes the new neon/rust version of ssb-keys.
I think what may be happening is that you're actually still on a commit that includes those. That may be due to the sequence in which you did the different
git checkoutandgit switchcommands and such.What is your
git statusat the moment?sunjam commentedon Nov 15, 2020
$ git status
On branch pre-rust
nothing to commit, working tree clean
black-puppydog commentedon Nov 15, 2020
sorry, I meant
git log HEAD~..HEADFor comparison, this is mine:
black-puppydog commentedon Nov 15, 2020
(the git log command shows the commit hashes, which is a unique way of seeing where we are. branch/tag names can be ambiguous)
sunjam commentedon Nov 15, 2020
$ git log HEAD~..HEAD
commit 54a329a (HEAD -> pre-rust, origin/master, origin/HEAD, master)
Merge: 810bb6a 88d5d17
Author: Daan Wynen black-puppydog@users.noreply.github.com
Date: Sat Nov 14 17:11:10 2020 +0100
commit 88d5d17
Author: Fábio Emilio Costa fabiocosta0305@gmail.com
Date: Sat Nov 14 13:06:04 2020 -0300
black-puppydog commentedon Nov 15, 2020
Ooookay, I think that's progress! 🎉
Here's what I think happened:
further up, you did a checkout of the
pre-rustbranch instead of the taggit checkout -b pre-rust.From that moment on, you had a local
pre-rustbranch, and when you didgit checkout pre-rust(without the "-b") later it didn't actually switch to the right commit (the one tagged by me) but checked out the now-existing branch, which was created at the wrong commit. So all your previous builds were actually still trying to compile the version of patchwork that includes the neon patches, which won't yet work on arm.So, what I think should fix this:
black-puppydog commentedon Nov 16, 2020
Did that solve it? :)
In any case, I'll keep working on getting the build environment correct on arm, too. This is all new for me though, so I don't have a timeline on this, I'm just doing that because I'll soon be running more on arm myself. 😛
sunjam commentedon Nov 16, 2020