lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.53k stars 1.47k forks source link

linux-arm64 build failure #4600

Closed wojtek-viirtue closed 2 years ago

wojtek-viirtue commented 2 years ago

Describe the bug Unable to build on linux-arm64 because electron builder is pulling the wrong fpm binary (x86).

To Reproduce Steps to reproduce the behavior:

  1. Run make build

Expected behavior Compiled binary

Environment (please complete the following information):

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

$ /home/parallels/src/lens/node_modules/.bin/electron-builder --publish onTag
  • electron-builder  version=22.14.5 os=5.4.0-80-generic
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=node-pty@0.10.1 platform=linux arch=arm64
  • rebuilding native dependency  name=node-pty version=0.10.1
  • packaging       platform=linux arch=arm64 electron=13.6.1 appOutDir=dist/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v13.6.1/electron-v13.6.1-linux-arm64.zip size=83 MB parts=4
  • downloaded      url=https://github.com/electron/electron/releases/download/v13.6.1/electron-v13.6.1-linux-arm64.zip duration=7.539s
  • file source doesn't exist  from=/home/parallels/src/lens/locales
  • building        target=AppImage arch=arm64 file=dist/OpenLens-5.3.0-latest.1640124719848.1640125240137.arm64.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=732ms
  • building        target=deb arch=arm64 file=dist/OpenLens-5.3.0-latest.1640124719848.1640125240137.arm64.deb
  • 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=1.138s
  ⨯ cannot execute  cause=exit status 1
                    errorOut=/home/parallels/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/parallels/.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/parallels/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/parallels/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success

                    command=/home/parallels/.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-recommends libappindicator3-1 --deb-compression xz --architecture arm64 --after-install /tmp/t-8U1tgo/3-after-install --after-remove /tmp/t-8U1tgo/0-after-remove --description '
     OpenLens - Open Source IDE for Kubernetes' --version 5.3.0-latest.1640124719848.1640125240137 --package /home/parallels/src/lens/dist/OpenLens-5.3.0-latest.1640124719848.1640125240137.arm64.deb --name open-lens --maintainer 'OpenLens Authors <info@k8slens.dev>' --url https://github.com/lensapp/lens --vendor 'OpenLens Authors <info@k8slens.dev>' --deb-priority optional --license MIT /home/parallels/src/lens/dist/linux-arm64-unpacked/=/opt/OpenLens /home/parallels/src/lens/build/icons/512x512@2x.png=/usr/share/icons/hicolor/512x512/apps/open-lens.png /tmp/t-8U1tgo/4-OpenLens.desktop=/usr/share/applications/open-lens.desktop
                    workingDir=
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [Makefile:59: build] Error 1
jweak commented 2 years ago

Thank you for reporting @wojtek-viirtue .

It's a bug in the electron-builder https://github.com/electron-userland/electron-builder/issues/3901.

There is a workaround by using system's fpm described here: https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499

wojtek-viirtue commented 2 years ago

Thank you @jweak. I can confirm the the following worked: