electron-builder: Debian package builds fail on ARMv7

  • Version: 22.7.0
  • Electron Version: 8.4.0
  • Electron Type (current, beta, nightly): current
  • Target: armv7l/arm/arm32

Unable to build Debian package (.deb) for --armv7l due to using the wrong build of FPM, which was x86.

  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/fpm-1.9.3-2.3.1-linux-x86/fpm-1.9.3-2.3.1-linux-x86.7z size=4.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/fpm-1.9.3-2.3.1-linux-x86/fpm-1.9.3-2.3.1-linux-x86.7z duration=3.13s
  ⨯ cannot execute  cause=exit status 127
                    errorOut=/home/node/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/node/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: No such file or directory
    
                    command=/home/node/.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 libappindicator3-1 -d libsecret-1-0 --deb-compression xz --architecture armhf --name bridgecmdr --after-install /tmp/t-ufb98R/0-after-install --after-remove /tmp/t-ufb98R/1-after-remove --description '
     Professional switch and monitor controller for retro gaming' --version 2.0.0-beta --package /workdir/dist/bridgecmdr_2.0.0-beta_armv7l.deb --maintainer 'Matthew Holder <sixxgate@hotmail.com>' --url 'https://github.com/6XGate/bridgecmdr#readme' --vendor 'Matthew Holder <sixxgate@hotmail.com>' --license GPL-3.0-or-later /workdir/dist/linux-armv7l-unpacked/=/opt/BridgeCmdr /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/16x16.png=/usr/share/icons/hicolor/16x16/apps/bridgecmdr.png /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/32x32.png=/usr/share/icons/hicolor/32x32/apps/bridgecmdr.png /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/48x48.png=/usr/share/icons/hicolor/48x48/apps/bridgecmdr.png /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/64x64.png=/usr/share/icons/hicolor/64x64/apps/bridgecmdr.png /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/128x128.png=/usr/share/icons/hicolor/128x128/apps/bridgecmdr.png /workdir/node_modules/app-builder-lib/templates/icons/electron-linux/256x256.png=/usr/share/icons/hicolor/256x256/apps/bridgecmdr.png /tmp/t-ufb98R/2-BridgeCmdr.desktop=/usr/share/applications/bridgecmdr.desktop

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 27 (4 by maintainers)

Commits related to this issue

Most upvoted comments

The issue is not so much as to which version, but that FPM is not present with the correct arch, for ARM.

I managed to get a successful electron-builder build with the following:

sudo apt install ruby ruby-dev sudo gem install fpm export USE_SYSTEM_FPM=true

I am trying to use electron-builder on a PinePhone, an ARM device. When building I get the same error as shown by Matthew Rathbone, quoting from the link I posted previously, section “Fixing DEB and RPM Builds for ARM”:

Electron Builder uses FPM to build DEB and RPM files. Typically Electron Builder will download Ruby and FPM to a local directory automatically to make it work. When you try to build you’ll get the following error:

Cannot execute  cause=exit status 1
  errorOut=/home/rathboma/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/rathboma/.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

If you look closely at the error you can see that electron-builder is trying to use an x86 version version of FPM. This is hard coded, and so does not work on an ARM box.

Luckily there is a workaround - Install Ruby, Rubygems, and FPM, then set the totally undocumented USE_SYSTEM_FPM environment variable to true.

If someone wants to pick up the work for electron-builder-binaries (I’m not sure how that repo works or have write-access to it atm), I can help with the app-builder and electron-builder updates as I have write-access to those

I spent some time looking at this today. The options for compiling ruby to a binary executable seem nonexistent. There was a popular tool called ruby-packer/rubyc but is 3 years old and no longer works. tebako is newer and could be what we’re looking for, but I ran into numerous errors when trying it on fpm. Perhaps a Ruby dev could point us in the right direction so I added an issue on fpm repo asking for help.

If someone wants to pick up the work for electron-builder-binaries (I’m not sure how that repo works or have write-access to it atm), I can help with the app-builder and electron-builder updates as I have write-access to those

However, the fpm package still use x86 version. Let’s check document again. the fpm option only support APK, FreeBSD, Pacman, P5P and RPM target option I will trace the source code confirm that whether the deb support the fpm option.

Yes the fpm still use x86 version because it don’t have arm versions, but it works with arm options. You missed this line in the doc:

All LinuxTargetSpecificOptions can be also specified in the deb to customize Debian package.

And “deb” key should be top-level under the “build” key. You can take a look at my repo BlockPi if you still have problems.