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

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE when building on Raspberry Pi #1372

Closed
xarvh opened this issue May 30, 2021 · 4 comments
Closed

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE when building on Raspberry Pi #1372

xarvh opened this issue May 30, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@xarvh
Copy link

xarvh commented May 30, 2021

Behavior of the program

npm run build:arm32 fails with an ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

Expected behavior

The build should succeed.

To Reproduce

  1. clone the FreeTube repo
  2. git checkout v0.13.1-beta
  3. npm i
  4. npm run build:arm32

Screenshots

[...]
renderer (webpack 5.37.0) compiled successfully in 55112 ms

> [email protected] build-release:arm32
> node _scripts/build.js arm32

  • electron-builder  version=22.10.5 os=5.10.17-v7l+
  • electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies

To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`
  • writing effective config  file=build/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=linux arch=armv7l
  • packaging       platform=linux arch=armv7l electron=12.0.7 appOutDir=build/linux-armv7l-unpacked
  • Unpacking electron zip  zipPath=undefined
  • building        target=zip arch=armv7l file=build/freetube-0.13.1-armv7l.zip
  • building        target=AppImage arch=armv7l file=build/FreeTube-0.13.1-armv7l.AppImage
  • building        target=deb arch=armv7l file=build/freetube_0.13.1_armv7l.deb
  ⨯ cannot execute  cause=exit status 1
                    errorOut=/home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: cannot execute binary file: Exec format error
    /home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success
    
                    command=/home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/fpm -s dir --force -t deb -d libgtk-3-0 -d libnotify4 -d libnss3 -d libxss1 -d libxtst6 -d xdg-utils -d libatspi2.0-0 -d libuuid1 -d libsecret-1-0 --deb-compression xz --architecture armhf --name freetube --after-install /tmp/t-JkETVm/2-after-install --after-remove /tmp/t-JkETVm/5-after-remove --description '
     A private YouTube client' --version 0.13.1 --package /home/nw/FreeTube/build/freetube_0.13.1_armv7l.deb --maintainer 'PrestonN <[email protected]>' --url 'https://github.com/FreeTubeApp/FreeTube#readme' --vendor 'PrestonN <[email protected]>' --license AGPL-3.0-or-later /home/nw/FreeTube/build/linux-armv7l-unpacked/=/opt/FreeTube /home/nw/FreeTube/_icons/icon.svg=/usr/share/icons/hicolor/scalable/apps/freetube.svg /tmp/t-JkETVm/8-FreeTube.desktop=/usr/share/applications/freetube.desktop
                    workingDir=
ExecError: /home/nw/FreeTube/node_modules/app-builder-bin/linux/arm/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/home/nw/FreeTube/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
  exitCode: 2,
  alreadyLogged: true,
  code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE'
}

OS: Raspbian
OS Version: Linux raspberrypi 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux
FreeTube version: v0.13.1-beta (had the same problem with v0.12.x)
Installation Method: npm 7.15.0

Additional context
I could not find much about ERR_ELECTRON_BUILDER_CANNOT_EXECUTE other than it's just that the electron-builder remote service is not available any more.
However, that is supposedly used only for cross-compilation, which is not the case.

In the logs above, the cannot execute binary file: Exec format error suggests that it may be a problem with electron-builder itself; when I try to actually cross compile from my x86_64 ubuntu, I get:

[...]
renderer (webpack 5.37.0) compiled successfully in 12132 ms

> [email protected] build-release:arm32
> node _scripts/build.js arm32

  • electron-builder  version=22.10.5 os=5.11.0-7614-generic
  • electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies

To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`
  • writing effective config  file=build/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=linux arch=armv7l
  • packaging       platform=linux arch=armv7l electron=12.0.7 appOutDir=build/linux-armv7l-unpacked
  • Unpacking electron zip  zipPath=undefined
  • building        target=zip arch=armv7l file=build/freetube-0.13.1-armv7l.zip
  • building        target=AppImage arch=armv7l file=build/FreeTube-0.13.1-armv7l.AppImage
  • building        target=deb arch=armv7l file=build/freetube_0.13.1_armv7l.deb
  • building        target=apk arch=armv7l file=build/freetube-0.13.1-armv7l.apk
  • building        target=rpm arch=armv7l file=build/freetube-0.13.1.armv7l.rpm
  • building        target=pacman arch=armv7l file=build/freetube-0.13.1-armv7l.pacman
  ⨯ cannot execute  cause=exit status 1
                    out={:timestamp=>"2021-05-30T09:58:49.878440+0200", :message=>"Process failed: /bin/bash failed (exit code 127). Full command was:[\"/bin/bash\", \"-c\", \"LANG=C bsdtar -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' .PKGINFO .INSTALL usr opt\"]", :level=>:error}
    
                    command=/home/nw/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/fpm -s dir --force -t pacman -d c-ares -d ffmpeg -d gtk3 -d http-parser -d libevent -d libvpx -d libxslt -d libxss -d minizip -d nss -d re2 -d snappy -d libnotify -d libappindicator-gtk3 --pacman-compression xz --architecture armv7l --name freetube --after-install /tmp/t-76xxDb/6-after-install --after-remove /tmp/t-76xxDb/7-after-remove --description '
     A private YouTube client' --version 0.13.1 --package /home/nw/FreeTube/build/freetube-0.13.1-armv7l.pacman --maintainer 'PrestonN <[email protected]>' --url 'https://github.com/FreeTubeApp/FreeTube#readme' --vendor 'PrestonN <[email protected]>' --license AGPL-3.0-or-later /home/nw/FreeTube/build/linux-armv7l-unpacked/=/opt/FreeTube /home/nw/FreeTube/_icons/icon.svg=/usr/share/icons/hicolor/scalable/apps/freetube.svg /tmp/t-76xxDb/b-FreeTube.desktop=/usr/share/applications/freetube.desktop
                    workingDir=
ExecError: /home/nw/FreeTube/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/home/nw/FreeTube/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (events.js:421:26)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  exitCode: 2,
  alreadyLogged: true,
  code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE'
}

i.e., the build fails even if .cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby is executed on the correct architecture.

@xarvh xarvh added the bug Something isn't working label May 30, 2021
@harshcurious
Copy link
Contributor

If you are just interested in getting FreeTube working on a Raspberry Pi, might I suggest Pi Apps. Obviously, it is not a solution to your build issue. But they have a build script you might want to take a look at.

@xarvh
Copy link
Author

xarvh commented Jun 26, 2021

@harshcurious thank you, I will try! =)

@Jai-JAP
Copy link
Contributor

Jai-JAP commented Jun 28, 2022

@efb4f5ff-1298-471a-8973-3d47447115dc

I have seen this issue before... That is an error caused by user not using correct steps for compiling and not an issue with freetube.

Seeing the log contents says that builder has downloaded fpm-linux-x64 on arm linux and hence cannot execute error

retrieved from #2113 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants