question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debian package builds fail on ARMv7

See original GitHub issue
  • 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:22

github_iconTop GitHub Comments

3reactions
olof-nordcommented, Apr 8, 2021

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.

1reaction
alienzhangywcommented, Aug 2, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CrossBuildPackagingGuidelines - Debian Wiki
Guidelines for cross-build friendly packages. This page describes good (and bad) practice in packaging (and upstream code) with respect to ...
Read more >
Debian Build-Depends on non-package binary
No, there is no way to enforce a build- (or other) dependency which isn't a Debian binary package. All the dependency, conflict etc....
Read more >
Debian Packages of R Software
Be aware that you may also have to install build dependencies (typically ... The other R packages available as precompiled Debian packages ......
Read more >
Building binary deb packages: a practical guide
Internally, a deb package contains a collection of folders that mimics a typical Linux ... version 1.0, built for 64-bit ARM processors.
Read more >
Swift for Debian Armv7 - Compiler
The generate-swiftpm-toolchain.sh and build-swift-package.sh scripts can be used to cross compile packages. Example of Docker image usage:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found