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

Debian package for ARM #6153

Closed
rugk opened this issue Feb 15, 2018 · 32 comments
Closed

Debian package for ARM #6153

rugk opened this issue Feb 15, 2018 · 32 comments
Labels
A-Packaging Packaging, signing, releasing O-Occasional Affects or can be seen by some users regularly or most users rarely T-Enhancement

Comments

@rugk
Copy link
Contributor

rugk commented Feb 15, 2018

Your Debian package is not available for ARM devices, but considering this are only static files, which Riot consists of, so you could easily also provide it for these devices AFAIK.

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

The riot-web debian package is the electron build which is not just static files

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

The issue you might want to comment on is #2777

@rugk
Copy link
Contributor Author

rugk commented Feb 15, 2018

Hmm, don't understand. You already provide Debian packages (so #2777 should be solved), so the only thing you'd need there is to ad ARM support.
And I am talking about web version, not the electron one!

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

The packages you mentioned are of the electron build. No packages of just the static files are provided other than the tarballs on github. Riot-web is the repository for the electron app too.

@rugk
Copy link
Contributor Author

rugk commented Feb 15, 2018

Ah, ugh, that's confusing. Don't you think two repos (at least for issue reporting) are better, considering that you'll just see such issues as this one being confused. (Or make an issue template, where you ask the user to enter whether this is about the web or Electron version)
And please clarify the Readme. The current instructions just state: Use Debian packages or this ZIP. It does not even explain that the one is for desktop systems and the other thing for servers.

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

at least for issue reporting

no because then you run into duplication, the amount of electron code in the source vs the rest is a measly couple of %, 99% of issues are not specific to the electron app, as the electron app merely wraps riot-web

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

(Or make an issue template, where you ask the user to enter whether this is about the web or Electron version)

This is already the case.
image

@rugk
Copy link
Contributor Author

rugk commented Feb 15, 2018

Aha okay, only reported suggestions. Good…

So maybe just clarify that stuff in the Readme, then.

@t3chguy
Copy link
Member

t3chguy commented Feb 15, 2018

Agreed that the readme should be explicit, in hindsight the package should be riot-web-electron but renaming at this point would break auto-updating AIUI

@rugk
Copy link
Contributor Author

rugk commented Feb 15, 2018

Can't you create meta packages or so that still refer the old package name? (Don't know anything about that stuff, but have heard that such a thing is possible.)

@uhoreg
Copy link
Member

uhoreg commented Feb 22, 2018

Yes, the usual way in Debian of renaming packages while still retaining upgrades is to create a transitional package with the old name that depends on the new name. By the way, the issue for properly naming the desktop package is #3012

@t3chguy
Copy link
Member

t3chguy commented Feb 22, 2018

@uhoreg am I right that it would mean that riot-web would still be unusable for a web packaging at that point though?

@uhoreg
Copy link
Member

uhoreg commented Feb 22, 2018

Yes, you wouldn't want to re-use the riot-web package name -- at least not until you're sure that everyone has migrated. e.g. in Debian, you would keep the transitional package for one release of Debian, and then I think in the next release, you could use the package name for something else. In Riot's case, maybe waiting a year would suffice.

For the web packaging, you could use the name riot-webapp or something like that.

If someone can figure out how to convince electron-builder to build a package with the right name, then creating a transitional package isn't that hard -- you should be able to do it easily using the equivs package.

@mdimura
Copy link

mdimura commented May 24, 2019

I tried building from source for arm64 on an arm64 machine and it failed. From what I understood, one should not build on arm64 machines, but rather cross-build.
So I tried to cross-build on ubuntu 18.04 x64, using this script:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update

sudo apt-get install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
                       g++-aarch64-linux-gnu build-essential clang \
                       libdbus-1-dev libgtk-3-dev \
                       libnotify-dev libgnome-keyring-dev libgconf2-dev \
                       libasound2-dev libcap-dev libcups2-dev libxtst-dev \
                       libxss1 libnss3-dev gcc-multilib g++-multilib curl \
                       gperf bison python-dbusmock openjdk-8-jre

sudo apt install -y nodejs yarn git

git clone https://github.com/vector-im/riot-web.git
cd riot-web
export NODE_OPTIONS=--max-old-space-size=2048
yarn install
./scripts/fetch-develop.deps.sh
yarn build
yarn add electron
./node_modules/.bin/build -l deb --arm64

And I get the package riot-web_1.1.2_arm64.deb, which installs fine, but only shows empty window when launched on the aarch64 machine. Here are the build log and stderr.
Riot_arm64
Is it possible to build riot-desktop for arm64? Am I doing something wrong?

@mdimura
Copy link

mdimura commented May 27, 2019

I tried building using the electronuserland/builder docker image, and it worked!
Here is my build script:

#!/bin/bash

git clone https://github.com/vector-im/riot-web.git
cd riot-web

mkdir -p ${PWD##*/}-node-modules ${PWD}/../cache/electron ${PWD}/../cache/electron-builder

cat <<EOF > build_riot_deb.sh
yarn install
./scripts/fetch-develop.deps.sh
cp config.sample.json config.json
yarn build
./node_modules/.bin/electron-builder -l deb --arm64
EOF
chmod +x build_riot_deb.sh

sudo docker run --rm -ti \
 --env ELECTRON_CACHE="/root/.cache/electron" \
 --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
--env NODE_OPTIONS="--max-old-space-size=2048" \
 -v ${PWD}:/project \
 -v ${PWD##*/}-node-modules:/project/node_modules \
 -v ${PWD}/../cache/electron:/root/.cache/electron \
 -v ${PWD}/../cache/electron-builder:/root/.cache/electron-builder \
 electronuserland/builder /bin/bash -c "./build_riot_deb.sh"

And here is the package: riot-web_1.1.2_arm64.deb
Would it be possible to provide such a build via the official packages.riot.im/debian/ repository?

@jryans jryans added A-Packaging Packaging, signing, releasing and removed A-Packaging Packaging, signing, releasing labels Jul 29, 2019
@cake2
Copy link

cake2 commented Mar 21, 2020

I tried building using the electronuserland/builder docker image, and it worked!
Here is my build script:

#!/bin/bash

git clone https://github.com/vector-im/riot-web.git
cd riot-web

mkdir -p ${PWD##*/}-node-modules ${PWD}/../cache/electron ${PWD}/../cache/electron-builder

cat <<EOF > build_riot_deb.sh
yarn install
./scripts/fetch-develop.deps.sh
cp config.sample.json config.json
yarn build
./node_modules/.bin/electron-builder -l deb --arm64
EOF
chmod +x build_riot_deb.sh

sudo docker run --rm -ti \
 --env ELECTRON_CACHE="/root/.cache/electron" \
 --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
--env NODE_OPTIONS="--max-old-space-size=2048" \
 -v ${PWD}:/project \
 -v ${PWD##*/}-node-modules:/project/node_modules \
 -v ${PWD}/../cache/electron:/root/.cache/electron \
 -v ${PWD}/../cache/electron-builder:/root/.cache/electron-builder \
 electronuserland/builder /bin/bash -c "./build_riot_deb.sh"

And here is the package: riot-web_1.1.2_arm64.deb
Would it be possible to provide such a build via the official packages.riot.im/debian/ repository?

Thank you for the instructions in your script MD. I could not build on a armhf device so I cross compiled following your example and it seems to work. riot-web_1.5.13_armv7l.deb

@fwolfst
Copy link

fwolfst commented Jun 24, 2020

Still interest for a working "client" on ARM/raspbian.

Especially because both firefox and chromium packages on raspbian are too old to use the webclient (well with chromium it sorta works, but I'd prefer something more solid).

@ThatGeoGuy
Copy link

Alright all, I want an ARM build in the riot repo as well, but I think this issue needs to be closed. For a few reasons:

  1. riot-desktop is now separate from riot-web, and this issue doesn't pertain to riot-web, but rather riot-desktop.
  2. It is vastly easier to build ARM yourself since riot 1.6.0 / when the riot-desktop split happened.

For those curious, here's what I used to build riot-desktop on my Pinebook Pro, post riot 1.6.0 where web and desktop were split. I'm sure this could be adapted to use Docker if you wanted to go that far, but it's highly unnecessary if you can already build on the device itself.

git clone git@github.com:vector-im/riot-desktop.git
cd riot-desktop
yarn install # make sure you're not using global NPM packages, they will not package properly!!!
yarn run fetch --noverify --cfgdir '' # there are several variants of this in the README for different use cases
USE_LOCAL_FPM="true" yarn run build

The weird part of this build command is the USE_LOCAL_FPM part. This is due to a bug in electron-builder where for whatever reason it uses the x86 FPM even if you're on ARM. So install FPM locally using gem, since it's a ruby package.

sudo gem install fpm -v 1.9.3

I chose version 1.9.3 because it seems that's what electron-builder was using by default. I attempted to use the latest (1.11?) for my version of ruby but then ran into dpkg errors later because of xz compression. To be honest, I'm not versed enough in any of these tools to really say why.

From that it should output a deb file in the dist/ folder inside the riot-desktop repo, which can be installed with dpkg.

Anyways, it took me some time to get this far, so I hope this helps someone. I wouldn't know where to put these instructions otherwise, but aside from the FPM issue everything is very straightforward and easy. @uhoreg all this said is there a good spot for these docs / instructions, and can we close this issue / move it to the riot-desktop repo where it probably belongs now?

@rugk
Copy link
Contributor Author

rugk commented Jun 29, 2020

riot-desktop is now separate from riot-web, and this issue doesn't pertain to riot-web, but rather riot-desktop.

Organisation/repo admins can move an issue to a different repo on GitHub, so that should be done IMHO.

@t3chguy
Copy link
Member

t3chguy commented Jun 29, 2020

riot-desktop issues are tracked in this repo for deduplication.

@joshbowyer
Copy link

@ThatGeoGuy I followed your instructions but building for arm64 failed on USE_LOCAL_FPM="true" yarn run build with errorOut=/home/mobian/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/mobian/.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

@ThatGeoGuy
Copy link

Indeed, it appears that USE_LOCAL_FPM stopped working shortly after I posted that (classic).

My workaround was just to symlink ~/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-.linux-x86/bin/fpm to /usr/local/fpm. It is starting to get hacky, but I don't hold out much hope for the electron-builder devs to fix this issue anytime soon.

@joshbowyer
Copy link

That worked, thank you!

@Thatoo
Copy link

Thatoo commented Oct 18, 2020

could it be possible to get an arm64 package? for Pinebook, Pinephone and Pinetab for example...

@Thatoo
Copy link

Thatoo commented Nov 28, 2020

The only matrix-client supporting E2E that can be installed on arm is Nheko so far. sudo apt install nheko .
It is sad that we can't yet do a simple sudo apt install element-desktop and get element installed on pinetab/pinephone with mobian.
I'm guessing it is difficult task to make an arm deb packet.

@joshbowyer
Copy link

The only matrix-client supporting E2E that can be installed on arm is Nheko so far. sudo apt install nheko .

Actually Mirage works very well on arm64 and has E2EE: https://github.com/mirukana/mirage, and this has also been packaged for debian as matrix-mirage

@Thatoo
Copy link

Thatoo commented Nov 28, 2020

Thank you for this information

@Thatoo
Copy link

Thatoo commented Nov 28, 2020

Well, actually Nheko crashes as soon as I enter my id @xxx:xxx .
I couldn't install mirage because of lack of a qt5-default package on mobian.
I'll try again later, hopefully with Element that I appreciate particularly.

@Thatoo
Copy link

Thatoo commented Dec 11, 2020

Mirage is now in the mobian repo : mirukana/mirage#108
It works great and it will do the job waiting for Element to come too.

@heini
Copy link

heini commented May 28, 2021

Hmm, 3+ years after this issue has been created there are still no element-desktop packages available for Debian arm/arm64 from the official repositories...

@netnut404
Copy link

netnut404 commented Apr 11, 2022

Ttry as I might, I cannot reproduce your successful build @mdimura with your script I end up at the end missing the electron-builder inside the .bin dir

@SimonBrandner SimonBrandner added the O-Occasional Affects or can be seen by some users regularly or most users rarely label Apr 12, 2022
@t3chguy
Copy link
Member

t3chguy commented Mar 15, 2023

Closing in favour of element-hq/element-desktop#650

@t3chguy t3chguy closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Packaging Packaging, signing, releasing O-Occasional Affects or can be seen by some users regularly or most users rarely T-Enhancement
Projects
None yet
Development

No branches or pull requests