flecs icon indicating copy to clipboard operation
flecs copied to clipboard

[partially works] doesn't build for linux armhf/arm64

Open Itai-Nelken opened this issue 5 years ago • 27 comments

doesn't build on Ubuntu arm64 for Raspberry Pi

steps I followed:

  1. git clone https://github.com/th-ch/youtube-music
  2. cd youtube-music
  3. yarn
  4. yarn start (to start the app)

when running yarn I get this error:

00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one.

Itai-Nelken avatar Dec 07 '20 12:12 Itai-Nelken

I think i fixed the issue by installing yarn using the instructions on the official website

Itai-Nelken avatar Dec 07 '20 12:12 Itai-Nelken

works perfectly ok. but I did get one error:

itai@UbuntuPi4-ultra-4gb:~/youtube-music$ yarn
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > [email protected]" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
[1/6] ⡀ registry-js
[4/6] ⡀ electron
[3/6] ⡀ phantomjs-prebuilt
[5/6] ⢀ electron-chromedriver
error /home/itai/youtube-music/node_modules/phantomjs-prebuilt: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/itai/youtube-music/node_modules/phantomjs-prebuilt
Output:
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm64

is that anything bad, or can I ignore it? also how can I package (to deb or AppImage)?

Anyway, thank you for this great app!

Itai-Nelken avatar Dec 07 '20 12:12 Itai-Nelken

it always starts up with the DevTools open even though they are disabled

Itai-Nelken avatar Dec 07 '20 13:12 Itai-Nelken

and the addblocker doesn't work. it did work on my mac, so I guess it isn't something to do with the app.

Itai-Nelken avatar Dec 07 '20 13:12 Itai-Nelken

Hey @Itai-Nelken, thanks for the feedback! I never tried on ARM64 but in all cases phantomJS should not be required, because it is a dev dependency (useful for dev but not to build the app) - if you only want to build, you can try:

yarn --frozen-lockfile
yarn build:linux

Not sure if will work on electron/electron-builder side (current electron version of the project is 10 while latest version is 11) but worth giving it a try!

th-ch avatar Dec 07 '20 22:12 th-ch

Thanks a lot! will this also work on armhf (arm 32 bit)? I'll try anyway.

if you need any help with testing on ARM64 and ARMHF i can help you.

Itai-Nelken avatar Dec 07 '20 22:12 Itai-Nelken

when running yarn build:linux I get this error:

yarn run v1.22.5
$ yarn run clean && electron-builder --linux
$ rimraf dist
/bin/sh: 1: rimraf: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Itai-Nelken avatar Dec 08 '20 07:12 Itai-Nelken

I tried building again, and I got this error when running yarn --prod --frozen-lockfile:

pi@Twisterpi4-ultra-4gb:~/youtube-music $ yarn --prod --frozen-lockfile
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > [email protected]" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
$ yarn run icon && yarn run plugins
yarn run v1.22.5
$ rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated
/bin/sh: 1: rimraf: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
pi@Twisterpi4-ultra-4gb:~/youtube-music $ 

Itai-Nelken avatar Dec 08 '20 07:12 Itai-Nelken

@Itai-Nelken Apologies, you actually need all dependencies to build the app (I edited my previous comment) so command is yarn --frozen-lockfile before yarn build:linux (but the phantomJS error should not be a blocker to build 🤞)

th-ch avatar Dec 08 '20 20:12 th-ch

@th-ch still doesn't work. here is the terminal output of yarn --frozen-lockfile:

pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ yarn --frozen-lockfile
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/[email protected]" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > [email protected]" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
[1/6] ⠠ registry-js
[4/6] ⠠ electron
[3/6] ⠠ phantomjs-prebuilt
[5/6] ⠠ electron-chromedriver
error /home/pi/Downloads/youtube-music/node_modules/phantomjs-prebuilt: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/pi/Downloads/youtube-music/node_modules/phantomjs-prebuilt
Output:
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm




pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ 

and yarn build:linux:

pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ yarn build:linux
yarn run v1.22.5
$ yarn run clean && electron-builder --linux
$ rimraf dist
  • electron-builder  version=22.8.1 os=5.4.79-v7l+
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  ⨯ Unsupported arch arm  stackTrace=
                            Error: Unsupported arch arm
                                at archFromString (/home/pi/Downloads/youtube-music/node_modules/builder-util/src/arch.ts:43:13)
                                at computeArchToTargetNamesMap (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/targets/targetFactory.ts:43:20)
                                at Packager.doBuild (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:429:41)
                                at Packager._build (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:373:57)
                                at Packager.build (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:337:12)
                                at executeFinally (/home/pi/Downloads/youtube-music/node_modules/builder-util/src/promise.ts:12:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ 

Itai-Nelken avatar Dec 08 '20 21:12 Itai-Nelken

btw I'm using a armhf (32bit) OS now(RaspberryPi OS, debian)

Itai-Nelken avatar Dec 08 '20 21:12 Itai-Nelken

@th-ch I managed to build the app on Linux (armv7l(armhf))! here are the steps:

git clone https://github.com/th-ch/youtube-music.git
cd youtube-music
yarn --frozen-lockfile
yarn build:linux --linux appimage --armv7l

change --armv7l with --arm64 to build a arm 64bit AppImage. the appimage will be in youtube-music/dist.

Itai-Nelken avatar Dec 30 '20 10:12 Itai-Nelken

here is a screenshot: Screenshot_2020-12-30_12-47-03 I'm running the app on a RaspberryPi 4 4gb running TwisterOS.

Itai-Nelken avatar Dec 30 '20 10:12 Itai-Nelken

@th-ch now I get a error when trying to download music, here is a screenshot: youtube-music-error

Itai-Nelken avatar Jan 02 '21 21:01 Itai-Nelken

Hey @Itai-Nelken, thank you for the detailed feedback! Glad to see it working 😃 For the downloader issue, the mp3 conversion is done with the WebAssembly version of FFmpeg and not sure of how well it is supported on ARM 😬 - I don't have an ARM machine at the moment to test, keeping the issue opened to track progress on this!

th-ch avatar Jan 08 '21 21:01 th-ch

@th-ch I tried installing it using

git clone https://github.com/ffmpegwasm/ffmpeg.wasm.git
cd ffmpeg.wasm
npm install @ffmpeg/ffmpeg @ffmpeg/core --armv7l

and it installed successfully, but I still get the same error when trying to download...

also I have a spare pi that I can set up with remote desktop for you if you want.

Itai-Nelken avatar Jan 08 '21 23:01 Itai-Nelken

I tried a few more thing. here is what I did (keep in mind I hardly have any idea what I'm doing, so I might be doing really stupid things): I tried installingffmpeg.wasm with yarn: yarn add @ffmpeg/ffmpeg download still doesn't work, same error. I changed to the youtube-music folder and ran that command again, then I built the app again - same error when downloading...

Itai-Nelken avatar Jan 08 '21 23:01 Itai-Nelken

here are the build instructions for linux arm so far (I added everything I did, so there might be some uneeded instructions):

Install dependencies

node.js

There are two ways to install node.js: using apt and the nodesource repo and using nvm (node version manager), I recommend using nvm because using the nodesource repo has broken system permissions multiple times for me.

curl is needed, but you can change it with wget if you use the correct flags.

nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install node

nodesource

curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt install nodejs -y

yarn


curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn -y

build youtube music

git clone https://github.com/th-ch/youtube-music.git
cd youtube-music
yarn --frozen-lockfile

build a appimage

yarn build:linux --linux appimage --armv7l

build a deb

yarn build:linux --linux deb --armv7l

~~I had to run yarn --frozen lockfile, yarn build:linux --linux appimage --armv7l & yarn build:linux --linux deb --armv7l as root. otherwise the commands failed.~~ change armv7l with arm64 for building for Linux arm64.

notes

  • the downloader plugin doesn't work.

Itai-Nelken avatar Feb 16 '21 07:02 Itai-Nelken

Related to https://github.com/electron-userland/electron-builder/issues/5626

JellyBrick avatar Oct 07 '23 08:10 JellyBrick

Hi!

I'm trying to build for arm64, followed these steps but ending with

root@odroid:~/youtube-music#yarn build:linux --linux appimage --arm64
yarn run v1.22.22
error Command "build:linux" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

Am I missing something?
Thanks.

zyssai avatar Jul 19 '24 07:07 zyssai

Hey @zyssai

What you are looking for is most likely pnpm dist:linux:rpm-arm64. Or if you want to modify some parameters, you can simply type out the full command

pnpm clean && pnpm build && pnpm electron-builder --linux appimage:arm64 -p never

We have since switched to pnpm for the package management, and the build scripts have changed.

Here you can see which scripts exist.

ArjixWasTaken avatar Jul 19 '24 08:07 ArjixWasTaken

Thanks for your support. As building is unknown for me, not sure if I do it right.

root@odroid:~/youtube-music# pnpm clean && pnpm build && pnpm electron-builder --linux appimage:arm64 -p never

> [email protected] clean /root/youtube-music
> del-cli dist && del-cli pack && del-cli .vite-inspect

sh: 1: del-cli: not found
 ELIFECYCLE  Command failed.
 WARN   Local package.json exists, but node_modules missing, did you mean to install?
root@odroid:~/youtube-music#

Same with

pnpm dist:linux:rpm-arm64

zyssai avatar Jul 19 '24 17:07 zyssai

As building is unknown for me, not sure if I do it right.

first step is to install the dependencies, pnpm install only after that can you build it

ArjixWasTaken avatar Jul 19 '24 17:07 ArjixWasTaken

I missed this step, thanks.

But it does not install correctly unfortunately, I'll try to investigate.

root@odroid:~/youtube-music# pnpm install
Lockfile is up to date, resolution step is skipped
Packages: +863
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Downloading @ffmpeg.wasm/[email protected]: 9.45 MB/9.45 MB, done
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /root/.local/share/pnpm/store/v3  Virtual store is at:             node_modules/.pnpm
Downloading [email protected]: 5.63 MB/5.63 MB, done
Downloading [email protected]: 45.10 MB/45.10 MB, done
Progress: resolved 863, reused 0, downloaded 863, added 863, done
node_modules/.pnpm/[email protected]/node_modules/electron: Running postinstall script...
node_modules/.pnpm/[email protected]/node_modules/bufferutil: Running install script...
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script...
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running posnode_modules/.pnpm/[email protected]/node_modules/esbuild: Running posnode_modules/.pnpm/[email protected]/node_modules/bufferutil: Running install script, failed in 10.6s
.../node_modules/bufferutil install$ node-gyp-build                │ gyp info it worked if it ends with ok                            │ gyp info using [email protected]
│ gyp info using [email protected] | linux | arm64
│ gyp info find Python using Python version 3.12.3 found at "/us…
│ gyp http GET https://nodejs.org/download/release/v22.5.0/node-…
│ gyp http 200 https://nodejs.org/download/release/v22.5.0/node-…
│ gyp ERR! Completion callback never invoked!
│ gyp ERR! System Linux 6.6.40-114
│ gyp ERR! command "/root/.nvm/versions/node/v22.5.0/bin/node" "…
│ gyp ERR! cwd /root/youtube-music/node_modules/.pnpm/bufferutil…
│ gyp ERR! node -v v22.5.0
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! Node-gyp failed to build your package.
│ gyp ERR! Try to update npm and/or node-gyp and if it does not …
└─ Failed in 10.6s at /root/youtube-music/node_modules/.pnpm/[email protected]/node_modules/bufferutil
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 433ms
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 305ms
node_modules/.pnpm/[email protected]/node_modules/utf-8-validate: Running install script...
node_modules/.pnpm/[email protected]/node_modules/usocket: Running install script, failed in 8.6s (skipped as optional)
 ELIFECYCLE  Command failed with exit code 6.

zyssai avatar Jul 19 '24 17:07 zyssai

So no way to have something working. Too many errors, it's out of my knowledge, thanks tho.

Last try was this one.


root@odroid:~# cd youtube-music/
root@odroid:~/youtube-music# ls
README.md                 node_modules    tests
assets                    package.json    tsconfig.json
changelog.md              patches         vite-plugins
docs                      pnpm-lock.yaml  web
electron.vite.config.mts  renovate.json
license                   src
root@odroid:~/youtube-music# npm install

removed 87 packages, changed 67 packages, and audited 1058 packages in 35s

250 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (7 moderate, 1 high)

To address all issues possible, run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
root@odroid:~/youtube-music# npm audit fix --force
npm warn using --force Recommended protections disabled.
npm warn audit Updating electron-updater to 6.3.0, which is outside your stated dependency range.
npm warn audit No fix available for dbus-next@*
npm warn audit No fix available for @jellybrick/mpris-service@*

added 2 packages, changed 1 package, and audited 1060 packages in 8s

250 packages are looking for funding
  run `npm fund` for details

# npm audit report

request  *
Severity: moderate
Server-Side Request Forgery in Request - https://github.com/advisories/GHSA-p8p7-x288-28g6
Depends on vulnerable versions of tough-cookie
No fix available
node_modules/request
  node-gyp  <=7.1.2
  Depends on vulnerable versions of request
  node_modules/usocket/node_modules/node-gyp
    usocket  0.2.2 - 0.3.0
    Depends on vulnerable versions of node-gyp
    node_modules/usocket
      dbus-next  *
      Depends on vulnerable versions of usocket
      Depends on vulnerable versions of xml2js
      node_modules/dbus-next
        @jellybrick/mpris-service  *
        Depends on vulnerable versions of dbus-next
        node_modules/@jellybrick/mpris-service

tough-cookie  <4.1.3
Severity: moderate
tough-cookie Prototype Pollution vulnerability - https://github.com/advisories/GHSA-72xf-g2v4-qvf3
No fix available
node_modules/tough-cookie

xml2js  <0.5.0
Severity: moderate
xml2js is vulnerable to prototype pollution - https://github.com/advisories/GHSA-776f-qx25-q3cc
No fix available
node_modules/xml2js

7 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.
root@odroid:~/youtube-music# npm fund
[email protected]
├─┬ https://github.com/sponsors/sindresorhus
│ │ └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
│ └── https://github.com/sponsors/epoberezkin
│     └── [email protected], [email protected]
├── https://locize.com
│   └── [email protected]
├── https://opencollective.com/peer
│   └── [email protected], [email protected]
├── https://github.com/sponsors/LuanRT
│   └── [email protected], [email protected]
├── https://opencollective.com/typescript-eslint
│   └── @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected], @typescript-eslint/[email protected]
├─┬ https://opencollective.com/unts/projects/eslint-import-resolver-ts
│ │ └── [email protected]
│ └─┬ https://github.com/privatenumber/get-tsconfig?sponsor=1
│   │ └── [email protected]
│   └── https://github.com/privatenumber/resolve-pkg-maps?sponsor=1│       └── [email protected]
├─┬ https://opencollective.com/eslint-plugin-prettier
│ │ └── [email protected]
│ ├── https://github.com/prettier/prettier?sponsor=1
│ │   └── [email protected]
│ └── https://opencollective.com/unts
│     └── [email protected], @pkgr/[email protected]
├── https://github.com/sponsors/isaacs
│   └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
├─┬ https://github.com/vitejs/vite?sponsor=1
│ │ └── [email protected]
│ └─┬ https://opencollective.com/postcss/
│   │ └── [email protected]
│   └── https://github.com/sponsors/ai
│       └── [email protected]
├── https://github.com/sponsors/antfu
│   └── [email protected], @antfu/[email protected], [email protected]
├── https://github.com/sponsors/broofa
│   └── [email protected]
├── https://github.com/sponsors/RubenVerborgh
│   └── [email protected]
├── https://github.com/sponsors/feross
│   └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
├─┬ https://ko-fi.com/killymxi
│ │ └── @selderee/[email protected], [email protected], [email protected], [email protected], [email protected]
│ └─┬ https://github.com/fb55/domhandler?sponsor=1
│   │ └── [email protected]
│   └── https://github.com/sponsors/fb55
│       └── [email protected], [email protected], [email protected]
├─┬ https://github.com/cheeriojs/dom-serializer?sponsor=1
│ │ └── [email protected]
│ └── https://github.com/fb55/entities?sponsor=1
│     └── [email protected]
├─┬ https://github.com/fb55/htmlparser2?sponsor=1
│ │ └── [email protected]
│ └── https://github.com/fb55/domutils?sponsor=1
│     └── [email protected]
├── https://github.com/chalk/chalk-template?sponsor=1
│   └── [email protected]
├── https://github.com/sponsors/jonschlinkert
│   └── [email protected]
├─┬ https://github.com/sindresorhus/got?sponsor=1
│ │ └── [email protected]
│ └── https://github.com/sindresorhus/is?sponsor=1
│     └── @sindresorhus/[email protected]
├── https://opencollective.com/webpack
│   └── @develar/[email protected]
├── https://github.com/sponsors/gjtorikian/
│   └── [email protected]
├── https://github.com/sponsors/malept
│   └── @malept/[email protected]
├── https://github.com/sponsors/sibiraj-s
│   └── [email protected]
├─┬ https://opencollective.com/babel
│ │ └── @babel/[email protected]
│ └── https://opencollective.com/browserslist
│     └── [email protected], [email protected], [email protected]
└── https://github.com/sponsors/mesqueeb
    └── [email protected], [email protected]

root@odroid:~/youtube-music# pnpm clean && pnpm build && pnpm electron-builder --linux appimage:arm64 -p never

> [email protected] clean /root/youtube-music
> del-cli dist && del-cli pack && del-cli .vite-inspect


> [email protected] build /root/youtube-music
> electron-vite build

(node:11592) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
vite v5.3.4 building SSR bundle for production...
✓ 2603 modules transformed.
dist/main/index.js  3,718.30 kB
✓ built in 1m 29s
vite v5.3.4 building SSR bundle for production...
✓ 491 modules transformed.
dist/preload/preload.es6-CcUQUbmK.js    3.89 kB
dist/preload/preload.js               751.85 kB
✓ built in 56.79s
vite v5.3.4 building for production...
✓ 237 modules transformed.
../dist/renderer/index.html                 0.48 kB
../dist/renderer/youtube-music.iife.js  2,026.68 kB
✓ built in 58.72s
  • electron-builder  version=24.13.3 os=6.6.40-114
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=pack/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected], [email protected], [email protected] platform=linux arch=arm64
  ⨯ cannot execute  cause=exit status 7
                    errorOut=npm error code 7
    npm error path /root/youtube-music/node_modules/usocket
    npm error command failed
    npm error command sh -c node-gyp rebuild
    npm error gyp info it worked if it ends with ok
    npm error gyp info using [email protected]
    npm error gyp info using [email protected] | linux | arm64
    npm error (node:13961) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    npm error (Use `node --trace-deprecation ...` to show where the warning was created)
    npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
    npm error (node:13961) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    npm error gyp http GET https://electronjs.org/headers/v31.2.1/node-v31.2.1-headers.tar.gz
    npm error gyp http 200 https://electronjs.org/headers/v31.2.1/node-v31.2.1-headers.tar.gz
    npm error gyp http GET https://electronjs.org/headers/v31.2.1/SHASUMS256.txt
    npm error gyp http 200 https://electronjs.org/headers/v31.2.1/SHASUMS256.txt
    npm error gyp ERR! UNCAUGHT EXCEPTION
    npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
    npm error gyp ERR! stack     at createConfigFile (/root/youtube-music/node_modules/usocket/node_modules/node-gyp/lib/configure.js:117:21)
    npm error gyp ERR! stack     at /root/youtube-music/node_modules/usocket/node_modules/node-gyp/lib/configure.js:84:9
    npm error gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:187:23)
    npm error gyp ERR! System Linux 6.6.40-114
    npm error gyp ERR! command "/root/.nvm/versions/node/v22.5.0/bin/node" "/root/youtube-music/node_modules/usocket/node_modules/.bin/node-gyp" "rebuild"
    npm error gyp ERR! cwd /root/youtube-music/node_modules/usocket    npm error gyp ERR! node -v v22.5.0
    npm error gyp ERR! node-gyp -v v7.1.2
    npm error gyp ERR! Node-gyp failed to build your package.
    npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
    npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-20T12_38_13_394Z-debug-0.log

                    command=npm rebuild [email protected] [email protected] [email protected]
                    workingDir=
root@odroid:~/youtube-music# ls
README.md                 node_modules       src
assets                    pack               tests
changelog.md              package-lock.json  tsconfig.json
dist                      package.json       vite-plugins
docs                      patches            web
electron.vite.config.mts  pnpm-lock.yaml
license                   renovate.json
root@odroid:~/youtube-music# pnpm install
 WARN  Moving @playwright/test that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving @total-typescript/ts-reset that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving @types/color that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving @types/electron-localshortcut that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving @types/howler that was installed by a different package manager to "node_modules/.ignored"
 WARN  77 other warnings
 WARN  5 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected], [email protected], [email protected], [email protected]
Packages: +864
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 938, reused 862, downloaded 13, added 864, done
node_modules/.pnpm/[email protected]/node_modules/bufferutil: Running install script...
node_modules/.pnpm/[email protected]/node_modules/utf-8-validate: Running install script...
node_modules/.pnpm/[email protected]/node_modules/electron: Running postinstall script...
node_modules/.pnpm/[email protected]/node_modules/utf-8-validate: Running install script, failed in 13.9sules/usocket: Running inst.../node_modules/utf-8-validate install$ node-gyp-build
node_modules/.pnpm/[email protected]/node_modules/bufferutil: Running install script, failed in 13.9s
.../node_modules/bufferutil install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | arm64elease/v22.5.0/node-…
│ gyp info find Python using Python version 3.12.3 found at "/us…
│ gyp http GET https://nodejs.org/download/release/v22.5.0/node-…
│ gyp http 200 https://nodejs.org/download/release/v22.5.0/node-…
│ gyp ERR! Completion callback never invoked!
│ gyp ERR! System Linux 6.6.40-114
│ gyp ERR! command "/root/.nvm/versions/node/v22.5.0/bin/node" "…
│ gyp ERR! cwd /root/youtube-music/node_modules/.pnpm/bufferutil…
│ gyp ERR! node -v v22.5.0
│ gyp ERR! node-gyp -v v10.2.0utube-music/node_modules/.pnpm/utf-8-│ gyp ERR! Node-gyp failed to build your package.
│ gyp ERR! Try to update npm and/or node-gyp and if it does not … p└─ Failed in 13.9s at /root/youtube-music/node_modules/.pnpm/[email protected]/node_modules/bufferutilode_modules/usocket: Running instnode_modules/.pnpm/[email protected]/node_modules/utf-8-validate: Running install script, failed in 13.9s
.../node_modules/utf-8-validate install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | arm64
│ gyp info find Python using Python version 3.12.3 found at "/us…
│ gyp http GET https://nodejs.org/download/release/v22.5.0/node-…
│ gyp http 200 https://nodejs.org/download/release/v22.5.0/node-…
│ gyp ERR! Completion callback never invoked!
│ gyp ERR! System Linux 6.6.40-114
│ gyp ERR! command "/root/.nvm/versions/node/v22.5.0/bin/node" "…
│ gyp ERR! cwd /root/youtube-music/node_modules/.pnpm/utf-8-vali…
│ gyp ERR! node -v v22.5.0
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! Node-gyp failed to build your package.
│ gyp ERR! Try to update npm and/or node-gyp and if it does not …
└─ Failed in 13.9s at /root/youtube-music/node_modules/.pnpm/[email protected]/node_modules/utf-8-validate
node_modules/.pnpm/[email protected]/node_modules/electron: Running postinstall script, done in 9.5s
node_modules/.pnpm/[email protected]/node_modules/usocket: Running install script, failed in 13.7s (skipped as optional)
 ELIFECYCLE  Command failed with exit code 6.
root@odroid:~/youtube-music# cd ..
root@odroid:~# ls
snap  thinclient_drives  youtube-music
root@odroid:~#```

zyssai avatar Jul 20 '24 12:07 zyssai

Hello! The main problem was with fpm package that require electron during build It downloads it automatically x86 version and their repo don't include aarm64.

I am very thankful to this topics: https://github.com/th-ch/youtube-music/issues/85 https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499

The main repo of aarm64 build, my hero! https://github.com/jgresham/fpm-arm-binary

Main longread explanation how it works: https://github.com/signalapp/Signal-Desktop/issues/6063#issuecomment-1307001166

So, the solution is to build fpm by yourself and build any electron apps for aarm64 after.

// First install podman and run
podman run -it --platform=linux/arm64 ubuntu:20.04 bash

// Update vm
sudo apt update
sudo apt install -y curl git build-essential rpm

// Build aarm64 fpm
git clone https://github.com/jgresham/fpm-arm-binary
cd fpm-arm-binary/
chmod +x compile-script.sh
./compile-script.sh

// Make fpm usable by fpm command
sudo mv fpm-arm64-exe /usr/local/bin/fpm
sudo chmod +x /usr/local/bin/fpm
which fpm
fpm --version

// Install node with npm and pnpm
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo npm install -g npm@latest
npm install -g pnpm

// Build Youtube Music, Simple Note, Signal-Desktop, Discord, etc. Anything on Electron
export USE_SYSTEM_FPM=true
git clone https://github.com/th-ch/youtube-music
cd youtube-music
pnpm install --frozen-lockfile
pnpm dist:linux:rpm-arm64

daic11 avatar Sep 11 '24 18:09 daic11

You can use the build for arm64/armhf at over 3.6.1

JellyBrick avatar Oct 14 '24 10:10 JellyBrick