Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Build from source fails on ARM #818

Closed
4 of 10 tasks
paulwratt opened this issue Nov 3, 2020 · 12 comments
Closed
4 of 10 tasks

Build from source fails on ARM #818

paulwratt opened this issue Nov 3, 2020 · 12 comments

Comments

@paulwratt
Copy link

Technical information

Using version:

  • master (running from GitHub-published source code, currently v3.0.0-pre)
  • latest (latest release, currently v2.2.2)
  • vX.X.X (specify other version)

Running on:

  • Linux
  • Windows
  • macOS

How comfortable you are with your system and/or IT in general:

  • I'm kind of lost, honestly
  • I know what's up, I could help you run some commands or checks
  • My machine is fully under my control, tell me what you need
  • I attended Defcon last year

Problem

I am on a RPi4 with RaspberryPiOS Buster (32bit). I tried Building from the README.md

- `npm install` (NOT `install-linux` or `install-windows`)
- `npm run build-linux` or `build-windows` or `build-darwin`

Both the Master (GitHub Repo) and the v2.2.2 (.tgz) fail to build (with different errors).

I wont paste the .tgz build error, but it looked stupid. Lots of:

/home/pi/.cache/node-gyp/14.15.0/include/node/v8.h:6475:46: note:   candidate expects 1 argument, 0 provided
../src/unix/pty.cc:714:68: error: no matching function for call to 'v8::_function-name_'

Building from the repo gets further, but it fails with the following error:

> [email protected] build-linux /home/pi/fix-repo/edex-ui
> electron-builder build -l -p never

  • electron-builder  version=22.8.0 os=5.4.72-v7l+
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=linux arch=x64
  ⨯ cannot execute  cause=exit status 1
                    out=
    > [email protected] install /home/pi/fix-repo/edex-ui/prebuild-src/node_modules/node-pty
    > node scripts/install.js
    
    make: Entering directory '/home/pi/fix-repo/edex-ui/prebuild-src/node_modules/node-pty/build'
      CXX(target) Release/obj.target/pty/src/unix/pty.o
    make: Leaving directory '/home/pi/fix-repo/edex-ui/prebuild-src/node_modules/node-pty/build'
    
                    errorOut=g++: error: unrecognized command line option ‘-m64’
    make: *** [pty.target.mk:113: Release/obj.target/pty/src/unix/pty.o] Error 1
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/pi/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
    gyp ERR! System Linux 5.4.72-v7l+
    gyp ERR! command "/home/pi/n/bin/node" "/home/pi/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/pi/fix-repo/edex-ui/prebuild-src/node_modules/node-pty
    gyp ERR! node -v v14.15.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok 
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `node scripts/install.js`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2020-11-03T12_27_22_559Z-debug.log
    
                    command=/home/pi/n/bin/node /home/pi/n/lib/node_modules/npm/bin/npm-cli.js rebuild [email protected]
                    workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-linux: `electron-builder build -l -p never`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build-linux script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-11-03T12_27_22_634Z-debug.log

I dont know about you but:
• rebuilding native dependencies [email protected] platform=linux arch=x64
seems to me like it will always fail on ARM (actually anything NOT x64 - which is everything else)

This seems like it is not picking up a setting from somewhere, or making a presumption.

Presuming this is the only thing in the Master Repo that needs fixing, can another release be made asap

I installed Node.js (14.15.0) & NPM (6.14.8) using curl -L https://git.io/n-install | bash.

Cheers

Paul

@GitSquared
Copy link
Owner

ARM is unsupported. See #804 for somebody trying to make it work, but it's really hacky.

This seems like it is not picking up a setting from somewhere, or making a presumption.

It is, something like x32 ? X : Y, meaning default to x64. As said above ARM is not handled.

can another release be made asap

Nope. #769

@paulwratt
Copy link
Author

paulwratt commented Nov 3, 2020

So I used the right command line to build it? Would it be any different if I used v15 of Node.js (I dont think so)?

If you point me to the right place(-ish) I can at least try some (non-hacky) patches, so (at least) this error will not occur, and then it can work on any architecture (including RISC-V & Power).

I have built Electron apps on ARM before, they work fine.

@GitSquared
Copy link
Owner

eDEX has some native dependencies written in C/C++, like node-pty... and others I think, I don't really remember as i haven't seriously worked on this repo for about a year now. You should look into arm support in those projects first.

@paulwratt
Copy link
Author

paulwratt commented Nov 3, 2020

it appears v2.2.2 has some issues with headers.

Am I right in understanding that electron-builder is a seperate project that may be failing, or (my guess) a configuration is being passed to electron-builder which is in the edex-ui repo?

EDIT: I just did a quick grep, and (in node_modules/app-builder-lib/out/platformPackager.js.map:1:) there is an issue link (about halfway down) for electron-builder right at the point where arch is set and x64 is the default, but that issue is from 2018, and talks about AppImage (is that correct, am I actually building an AppImage version of edex-ui?)

Should maybe I rather be using Starting from source instead, with:

npm run install-linux
npm start

@GitSquared
Copy link
Owner

a configuration is being passed to electron-builder which is in the edex-ui repo?

Yup, from this line onwards:

"build": {

See also the scripts section in this same file.

am I actually building an AppImage version of edex-ui?

Yes, that's what "building" means in the context of this repo, packaging dependencies, eDEX source code and assets and Electron white-label binaries into a single executable.

Should maybe I rather be using Starting from source instead

Normally you try starting it before bundling it (which what "build" really means here).

If dependencies successfully installed, npm start will start the app in development mode.

@paulwratt
Copy link
Author

paulwratt commented Nov 3, 2020

Bah, Starting from source instructions works fine!

EDIT: re: edex-ui/package.json yeah there are arch targets for linux, and a doc says:

For example, if you don’t want to pass --ia32 and --x64 flags each time, but instead build by default NSIS target for all archs for Windows:

It seems like the Build will work too, but its late/early - I will try take it out or modify it tomorrow

EDIT: could not wait (I set arch to armv7l):

> [email protected] build-linux /home/pi/fix-repos/edex-ui
> electron-builder build -l -p never

  • electron-builder  version=22.8.0 os=5.4.72-v7l+
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=linux arch=armv7l
  • packaging       platform=linux arch=armv7l electron=9.3.1 appOutDir=dist/linux-armv7l-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v9.3.1/electron-v9.3.1-linux-armv7l.zip size=63 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v9.3.1/electron-v9.3.1-linux-armv7l.zip duration=1m40.248s
  • building        target=AppImage arch=armv7l file=dist/eDEX-UI Linux (armv7l).AppImage
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z size=1.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z duration=6.833s
  ⨯ cannot execute  cause=exit status 1
                    errorOut=/home/pi/.cache/electron-builder/appimage/appimage-12.0.1/linux-arm32/mksquashfs: Compressor "xz" is not supported!
    /home/pi/.cache/electron-builder/appimage/appimage-12.0.1/linux-arm32/mksquashfs: Compressors available:
    	gzip (default)
    
                    command=/home/pi/.cache/electron-builder/appimage/appimage-12.0.1/linux-arm32/mksquashfs /home/pi/fix-repos/edex-ui/dist/__appImage-armv7l '/home/pi/fix-repos/edex-ui/dist/eDEX-UI Linux (armv7l).AppImage' -offset 143620 -all-root -noappend -no-progress -quiet -no-xattrs -no-fragments -comp xz -Xdict-size 100% -b 1048576
                    workingDir=/home/pi/fix-repos/edex-ui/dist/__appImage-armv7l
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-linux: `electron-builder build -l -p never`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build-linux script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-11-03T16_19_05_346Z-debug.log

Close, but no cigar. Here it needs gzip instead of the default xz, which is crazy because RPiOS has had ARM .xz since Jessy /Wheezy (like 8 years now) - tomorrow

But I would say edex-ui does support ARM, it just doesn't know it yet (needs some config tweaks). ie forget the v2.2.2 patch effort, there does not seem a need when some minor changes for 3.0.0-pre will have it working out of the box.

@parkerlreed
Copy link

I was able to compile master on AArch64 just fine.

It fails because electron-builder is dumb and tries to use the fpm x86_64 on ARM to build the package.

All that was needed was to

  • Build fpm from source and install.
  • Compile with USE_SYSTEM_FPM="true" somewhere in your environment.

Untitled

@paulwratt
Copy link
Author

paulwratt commented Nov 3, 2020

@parkerlreed cheers. I just edited that post again, and I think its even simpler than what you did. But I am starting to see a pattern here with electron-builder :)

EDIT: I just noticed I had this (2018) #313 post by @thallada (last post), open the whole time, but did not get around to reading it until just now (the original workaround is mentioned here ) . It mentions everything so far. And "hey presto", edex-ui 3.0.0-pre Master does actually in fact Build out of the box. Ho hum.

recap:
To get eDex-UI to work on RaspberryPi OS, follow the instructions in this comment starting at number 2

@GitSquared
Copy link
Owner

@parkerlreed That photo looks dope. Well done!

@marceltoma
Copy link

marceltoma commented Nov 4, 2020

Raspberry Pi 4 + Ubuntu Mate
I just changed the package.json to make it work
"linux": { "target": [ { "target": "AppImage", "arch": [ "arm64" ] } ],
123951145_10224721077400246_1791131814938718594_o

@paulwratt
Copy link
Author

A note in a file/readme would help out here I think, a RaspberryPi text specific or "ToubleShooting" text (either should be fine), or simply just mention it on the front page (README.md) - thanks for everyones help and screenshots btw.

GitSquared added a commit that referenced this issue Nov 5, 2020
@rekab72 rekab72 mentioned this issue Nov 8, 2020
@rekab72
Copy link

rekab72 commented Nov 8, 2020

Raspberry Pi 4 + Ubuntu Mate
I just changed the package.json to make it work
"linux": { "target": [ { "target": "AppImage", "arch": [ "arm64" ] } ],
![123951145_10224721077400246_1791131814938718594_o]

@marceltoma Can you post your build instructions or your working build as a release?

@lebarde lebarde mentioned this issue Nov 25, 2020
18 tasks
GitSquared added a commit that referenced this issue Nov 26, 2020
eugene2candy pushed a commit to eugene2candy/edex-ui that referenced this issue Apr 10, 2021
eugene2candy pushed a commit to eugene2candy/edex-ui that referenced this issue Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants