Closed rugk closed 1 year ago
The riot-web debian package is the electron build which is not just static files
The issue you might want to comment on is vector-im/element-web#2777
Hmm, don't understand. You already provide Debian packages (so https://github.com/vector-im/riot-web/issues/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!
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.
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.
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
(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.
Aha okay, only reported suggestions. Good…
So maybe just clarify that stuff in the Readme, then.
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
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.)
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 https://github.com/vector-im/riot-web/issues/3012
@uhoreg am I right that it would mean that riot-web
would still be unusable for a web packaging at that point though?
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.
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. Is it possible to build riot-desktop for arm64? Am I doing something wrong?
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?
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
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).
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:
riot-desktop
is now separate from riot-web
, and this issue doesn't pertain to riot-web
, but rather riot-desktop
. 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?
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.
riot-desktop issues are tracked in this repo for deduplication.
@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
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.
That worked, thank you!
could it be possible to get an arm64 package? for Pinebook, Pinephone and Pinetab for example...
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.
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
Thank you for this information
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.
Mirage is now in the mobian repo : https://github.com/mirukana/mirage/issues/108 It works great and it will do the job waiting for Element to come too.
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...
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
Closing in favour of https://github.com/vector-im/element-desktop/issues/650
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.