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

x86 ruby is downloaded and called on an ARM64 computer, when doing npm run dist:deb #88

Closed
SmartLayer opened this issue Feb 4, 2024 · 2 comments

Comments

@SmartLayer
Copy link

The error below is caused by attempting to execute ruby (x86) on an arm64 computer. Note that this laptop already have ruby (arm64) installed, the npm code here simply doesn't run the locally installed ruby and insists on running it from fpm.

$ npm run dist:deb

> google-chat-linux@5.27.23-6 dist:deb
> electron-builder --linux=deb

  • electron-builder  version=24.4.0 os=6.5.0-1008-laptop
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • executing @electron/rebuild  arch=arm64 version=27.0.3 appDir=/usr/local/src/google-chat-linux
  • packaging       platform=linux arch=arm64 electron=27.0.3 appOutDir=dist/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v27.0.3/electron-v27.0.3-linux-arm64.zip size=101 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v27.0.3/electron-v27.0.3-linux-arm64.zip duration=8.721s
  • building        target=deb arch=arm64 file=dist/google-chat-linux_5.27.23-6_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.483s
  ⨯ cannot execute  cause=exit status 1
                    errorOut=/home/weiwu/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/weiwu/.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/weiwu/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/weiwu/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success
    
                    command=/home/weiwu/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/fpm -s dir --force -t deb -d xdg-desktop-portal --deb-recommends libappindicator3-1 --deb-compression xz --architecture arm64 --after-install /tmp/t-w0FjGz/0-after-install --after-remove /tmp/t-w0FjGz/1-after-remove --description '
     Unofficial alternative Google Chat desktop app' --version 5.27.23-6 --package /usr/local/src/google-chat-linux/dist/google-chat-linux_5.27.23-6_arm64.deb --name google-chat-linux --maintainer 'Roberto Fasciolo <rob@robyf.net>' --url https://github.com/squalou/google-chat-linux --vendor 'Roberto Fasciolo <rob@robyf.net>' --deb-priority optional --license WTFPL /usr/local/src/google-chat-linux/dist/linux-arm64-unpacked/=/opt/google-chat-linux /usr/local/src/google-chat-linux/build/icons/48.png=/usr/share/icons/hicolor/48x48/apps/google-chat-linux.png /usr/local/src/google-chat-linux/build/icons/64.png=/usr/share/icons/hicolor/64x64/apps/google-chat-linux.png /usr/local/src/google-chat-linux/build/icons/256.png=/usr/share/icons/hicolor/256x256/apps/google-chat-linux.png /tmp/t-w0FjGz/2-google-chat-linux.desktop=/usr/share/applications/google-chat-linux.desktop
                    workingDir=
@squalou
Copy link
Owner

squalou commented Feb 5, 2024

Hi,

Thanks for reporting this, I've never tried ARM build yet, I'm glad someone does !

Looks like it's an issue with electron builder, and if you already have ruby and fpm installed on your system you may try this workaround :

export USE_SYSTEM_FPM="true" && npm run dist:deb

Let me know if it works.

(read it here: electron-userland/electron-builder#3901)

I'll read further if there's a better way / another packager plugin better suited for this.

regards,

@SmartLayer
Copy link
Author

SmartLayer commented Feb 5, 2024

It works and I am using the deb generated right now. I hope there is a way to remove such a need, hence #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants