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

Electron builder fails to get the proper version of fpm ; it downloads the version for x86,but it needs the arm64 version #1801

Open
Marietto2008 opened this issue Jul 5, 2021 · 3 comments

Comments

@Marietto2008
Copy link

Marietto2008 commented Jul 5, 2021

Hello.

I would like to install ferdi inside docker on my jetson nano (arm64).

Below u can see the dockerfile that I have written with the help of @https://github.com/vraravam.

Unfortunately there is an error that I'm not able to fix.

First of all which versions of the tools I have used :

Electron-Builder Version = 22.11.7

Node Version = v14.17.1

Electron=13.1.5

Target: platform=linux arch=arm64/tegra/jetson nano/kernel 4.9.201+

This is the dockerfile :

FROM node:fermium-buster

LABEL Author="ZioMario <marietto2008@gmail.com>"
 
LABEL Title="arm64/ferdi"

#Environment variables

ARG username=ferdi-arm64-builder
ENV HOME /home/$username
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH "/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/lib:/usr/include:/usr/share"
ENV HW="GPU"
ENV ELECTRON_CACHE /home/$username/.cache/electron
ENV ELECTRON_BUILDER_CACHE /home/$username/.cache/electron-builder
ENV TERM xterm

RUN apt-get update && apt-get install -y ca-certificates curl netbase wget tzdata rpm git xz-utils nano gedit

RUN git clone https://github.com/getferdi/ferdi.git && cd ferdi && git submodule update --init --recursive

WORKDIR /ferdi

ENV PREVAL_BUILD_INFO_PLACEHOLDERS=true

RUN npx lerna bootstrap 
RUN npm run rebuild
RUN cd recipes && npm i && npm run package
RUN npm run build

This is what happens when I launch the build command :

root@zi-desktop:~/Desktop/zi/Work/I9/Virt/dockers/arm64/ferdi# ./bui

Sending build context to Docker daemon  33.28kB
Step 1/24 : FROM node:fermium-buster
 ---> 109b9ba84108
Step 2/24 : LABEL Author="ZioMario <marietto2008@gmail.com>"
 ---> Using cache
 ---> 20c005c29cc9
Step 3/24 : LABEL Title="arm64/ferdi"
 ---> Using cache
 ---> 51dea1369463
Step 4/24 : ARG username=ferdi-arm64-builder
 ---> Using cache
 ---> ae40fdfc18fe
Step 5/24 : ENV HOME /home/$username
 ---> Using cache
 ---> 8076a745bbad
Step 6/24 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 9110a87d5a80
Step 7/24 : ENV LC_ALL C.UTF-8
 ---> Using cache
 ---> b478d5677474
Step 8/24 : ENV LANG C.UTF-8
 ---> Using cache
 ---> d14da44af979
Step 9/24 : ENV PATH "/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/lib:/usr/include:/usr/share"
 ---> Using cache
 ---> fc1a29c72196
Step 10/24 : ENV HW="GPU"
 ---> Using cache
 ---> 237e49d420ca
Step 11/24 : ENV ELECTRON_CACHE /home/$username/.cache/electron
 ---> Using cache
 ---> 16e89c30063a
Step 12/24 : ENV ELECTRON_BUILDER_CACHE /home/$username/.cache/electron-builder
 ---> Using cache
 ---> 30f26c993122
Step 13/24 : ENV TERM xterm
 ---> Using cache
 ---> e1b3cd8be1e2
Step 14/24 : RUN apt-get update && apt-get install -y ca-certificates curl netbase wget tzdata rpm git xz-utils nano gedit
 ---> Using cache
 ---> 14d118335122
Step 15/24 : RUN echo "pcm.!default { type plug slave.pcm "null" }" >> /etc/asound.conf
 ---> Using cache
 ---> 86c569f5e465
Step 16/24 : RUN usermod -aG audio root
 ---> Using cache
 ---> 4057ef087e49
Step 17/24 : RUN git clone https://github.com/getferdi/ferdi.git && cd ferdi && git submodule update --init --recursive
 ---> Using cache
 ---> 7ecc9e92d2cf
Step 18/24 : WORKDIR /ferdi
 ---> Using cache
 ---> d2709a433169
Step 19/24 : ENV PREVAL_BUILD_INFO_PLACEHOLDERS=true
 ---> Using cache
 ---> f04b2b530e94
Step 20/24 : RUN npx lerna bootstrap
 ---> Using cache
 ---> caa94cc4e901
Step 21/24 : RUN npm run rebuild
 ---> Using cache
 ---> ea25137e2cc9
Step 22/24 : RUN cd recipes && npm i && npm run package
 ---> Using cache
 ---> bb0d3248c80c
Step 23/24 : RUN npm run build
 ---> Running in 24aad37cce1e

> ferdi@5.6.0-nightly.72 prebuild /ferdi
> preval-build-info-cli && gulp build

[21:56:46] Requiring external module @babel/register
[21:56:53] Using gulpfile /ferdi/gulpfile.babel.js
[21:56:53] Starting 'build'...
[21:56:53] Starting 'clean'...
[21:56:53] Finished 'clean' after 4.07 ms
[21:56:53] Starting 'mvSrc'...
[21:56:53] Starting 'mvPackageJson'...
[21:56:53] Starting 'mvLernaPackages'...
[21:56:53] Starting 'exportBuildInfo'...
[21:56:54] Finished 'exportBuildInfo' after 501 ms
[21:56:54] Finished 'mvPackageJson' after 724 ms
[21:56:55] Finished 'mvLernaPackages' after 1.66 s
[21:56:55] Finished 'mvSrc' after 2.23 s
[21:56:55] Starting 'html'...
[21:56:55] Starting 'scripts'...
[21:56:55] Starting 'styles'...
[21:56:55] Starting 'verticalStyle'...
[21:56:55] Starting 'recipes'...
[21:56:55] Starting 'recipeInfo'...
[21:57:01] Finished 'html' after 6.09 s
[21:57:01] Finished 'verticalStyle' after 6.09 s
[21:57:02] Finished 'styles' after 7.18 s
[21:57:03] Finished 'recipeInfo' after 7.68 s
[21:57:32] Finished 'recipes' after 37 s
[21:57:45] Finished 'scripts' after 50 s
[21:57:45] Finished 'build' after 52 s

> ferdi@5.6.0-nightly.72 build /ferdi
> electron-builder

  • electron-builder  version=22.11.7 os=4.9.201+
  • loaded configuration  file=/ferdi/electron-builder.yml
  • 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`

  • installing production dependencies  platform=linux arch=arm64 appDir=/ferdi/build
  • packaging       platform=linux arch=arm64 electron=13.1.5 appOutDir=out/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v13.1.5/electron-v13.1.5-linux-arm64.zip size=83 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v13.1.5/electron-v13.1.5-linux-arm64.zip duration=10.269s
  • building        target=AppImage arch=arm64 file=out/Ferdi-5.6.0-nightly.72-arm64.AppImage
  • building        target=tar.gz arch=arm64 file=out/ferdi-5.6.0-nightly.72-arm64.tar.gz
  • 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=1.345s
  • building        target=deb arch=arm64 file=out/ferdi_5.6.0-nightly.72_arm64.deb

The error comes when,at some point,electron builder download the following wrong file :

• 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.789s

Since I'm on arm64,it fails later when executed :

cannot execute  cause=exit status 127

errorOut=/home/ferdi-arm64-builder/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/ferdi-arm64-builder/.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/ferdi-arm64-builder/.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 arm64 --after-install /tmp/t-DlVaxe/0-after-install --after-remove /tmp/t-DlVaxe/1-after-remove --description 'Messaging app for WhatsApp, Slack, Telegram, Gmail, Hangouts and many many more.
Ferdi is your messaging app / former Emperor of Austria and combines chat & messaging services into one application. Ferdi currently supports Slack, WhatsApp, Gmail, Facebook Messenger, Telegram, Google Hangouts, GroupMe, Skype and many more. You can download Ferdi for free for Mac & Windows.' --version 5.6.0-nightly.72 --package /ferdi/out/ferdi_5.6.0-nightly.72_arm64.deb --name ferdi --maintainer 'Amine Mouafik <amine@mouafik.fr>' --url https://github.com/getferdi/ferdi --vendor 'Amine Mouafik <amine@mouafik.fr>' --deb-priority optional --license Apache-2.0 /ferdi/out/linux-arm64-unpacked/=/opt/Ferdi /ferdi/build-helpers/images/icons/16x16.png=/usr/share/icons/hicolor/16x16/apps/ferdi.png /ferdi/build-helpers/images/icons/24x24.png=/usr/share/icons/hicolor/24x24/apps/ferdi.png /ferdi/build-helpers/images/icons/32x32.png=/usr/share/icons/hicolor/32x32/apps/ferdi.png /ferdi/build-helpers/images/icons/48x48.png=/usr/share/icons/hicolor/48x48/apps/ferdi.png /ferdi/build-helpers/images/icons/64x64.png=/usr/share/icons/hicolor/64x64/apps/ferdi.png /ferdi/build-helpers/images/icons/96x96.png=/usr/share/icons/hicolor/96x96/apps/ferdi.png /ferdi/build-helpers/images/icons/128x128.png=/usr/share/icons/hicolor/128x128/apps/ferdi.png /ferdi/build-helpers/images/icons/256x256.png=/usr/share/icons/hicolor/256x256/apps/ferdi.png /ferdi/build-helpers/images/icons/512x512.png=/usr/share/icons/hicolor/512x512/apps/ferdi.png /ferdi/build-helpers/images/icons/1024x1024.png=/usr/share/icons/hicolor/1024x1024/apps/ferdi.png /tmp/t-DlVaxe/7-ferdi.desktop=/usr/share/applications/ferdi.desktop
 
workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1                                                                                                      
npm ERR! ferdi@5.6.0-nightly.72 build: `electron-builder`                                                             
npm ERR! Exit status 1                                                                                                
npm ERR!                                                                                                              
npm ERR! Failed at the ferdi@5.6.0-nightly.72 build script.                                                           
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.                    
npm ERR! A complete log of this run can be found in:                                                                  
npm ERR!     /home/ferdi-arm64-builder/.npm/_logs/2021-07-03T22_23_21_928Z-debug.log                                  
The command '/bin/sh -c npm run build' returned a non-zero code: 1

I tried to look for this file on the disk and I found it here :

#find / -name fpm

    /239f483a4e2ef1bc818a9a8924f2c57a73cec349faa854ab5e5a97bbbc52ef52/diff/home/ferdi-arm64-builder/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/fpm

this informations is partially useful for me. What I need to know is the exact name of the file where it downloads the fpm-1.9.3-2.3.1-linux-x86 package,because I want to remove the wrong link and instead,I want to add the link of the working version of fpm,for arch64. Someone else found already this error and they tried to fix it as best they could. I see that no one of the electron builder team fix it definitely.

This error seems to be like these ones :

electron-userland/electron-builder#3901

and this one :

https://stackoverflow.com/questions/64269973/electron-build-on-linux-fails-to-create-an-rpm-package-periodically

Im not expert,but I can understand what's the problem,but what I don't know is how to fix it.

we are working on the project here :

getferdi/sponsors-only#404

@jordansissel
Copy link
Owner

I don't know much about electron builder. This error seems to be because the build process is downloading the wrong fpm package. It isn't using any release package of fpm that I control, so I don't think I can resolve this for you.

A quick search finds this issue asking for Arm packages containing fpm in electron-buidler: electron-userland/electron-builder-binaries#17

I think you might be best trying the elctron-builder-binaries project issue tracker.

@marceloch2
Copy link

marceloch2 commented Sep 15, 2021

@Marietto2008

I manage to build my Electron App for a Raspberry PI 4 Arm64.
Maybe this will help you.

sudo pacman -S ruby
sudo gem install fpm
export USE_SYSTEM_FPM=true  <<<------IMPORTANT BEFORE ANY BUILD

export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"

My package.json command if you need an example
`"package": "yarn build && electron-builder build --publish never"`

And the Linux section example as well.

"linux": {
"description": "...",
"packageCategory": "office",
"category": "office",
"target": [{
"target": "AppImage",
"arch": "arm64"
},{
"target": "pacman",
"arch": "arm64"
}],
"icon": "icon.png"
},

@mkurz
Copy link

mkurz commented Nov 8, 2022

If someone wants to make fpm in electron-builder work for arm64/aarch64 I wrote a guide how to do so here: signalapp/Signal-Desktop#6063 (comment)
Feel free to pick up that work, I don't have time to do so.

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

4 participants