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

Added Linux aarch64 capability #323

Closed
wants to merge 1 commit into from

Conversation

K0HAX
Copy link

@K0HAX K0HAX commented Feb 15, 2022

I have a Pinebook Pro and I wanted to be able to use Element Desktop on it.

This solution is working at the time of writing with Element Desktop 1.10.3.

I added build:aarch64 to package.json.
electron-builder tries to use its bundled x86 version of fpm by default, so the aarch64 builder uses the environment variable USE_SYSTEM_FPM=true to override this.

I added the aarch64-unknown-linux-gnu target to scripts/hak/target.ts

After making those changes, in Gentoo I ran:

sudo gem install fpm
sudo ln -s /usr/local/lib64/ruby/gems/2.7.0/bin/fpm /usr/local/bin/
yarn install
yarn run fetch --importkey
yarn run fetch --noverify --cfgdir ""
yarn run build:native --target aarch64-unknown-linux-gnu
yarn run build:aarch64

I didn't find an fpm package in Gentoo's package manager, so I did it a lazy way. I'm sure there's a more elegant way to handle that part.


Here's what your changelog entry will look like:

✨ Features

  • Added Linux aarch64 capability (#323). Contributed by @K0HAX.

@K0HAX K0HAX requested a review from a team as a code owner February 15, 2022 21:25
@novocaine
Copy link
Contributor

novocaine commented Feb 16, 2022

Is there a way to make this "just work" if you run yarn run build:native on aarch64 as it does on other platforms?

@K0HAX
Copy link
Author

K0HAX commented Feb 26, 2022

I just tested with yarn run build:native on aarch64 and that does "just work".
Unfortunately, yarn run build does not "just work" because electron-builder is pulling and trying to use fpm-1.9.3-2.3.1-linux-x86.7z, which doesn't work on ARM processors. That's what USE_SYSTEM_FPM=true fixes. That seems to be a bug in electron-builder, but their issue history suggests to me that they aren't interested in fixing that bug.

I don't know enough about how package.json works to fix this.

@novocaine
Copy link
Contributor

Okay! I think we just might need to make a note of how to get this to work in https://github.com/vector-im/element-desktop/blob/develop/docs/native-node-modules.md#compiling-for-specific-architectures ?

Also, I wonder .. if the workaround means that there's always a likely extra step to install a custom FPM locally, maybe the docs should suggest passing USE_SYSTEM_FPM as an explicit environment variable when running yarn run build (rather than embedding it in the build script).. This might be a bit more transparent to people and allow them to figure out their own workaround if needed.

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change looks fine as-is, though I do agree with @novocaine here in that documentation is the way to go on this.

For a project like this, the README is more important than build commands magically working ;)

@t3chguy
Copy link
Member

t3chguy commented Jun 10, 2022

#376 adds the target already

@t3chguy
Copy link
Member

t3chguy commented Jun 10, 2022

Agreed with the others on this issue, that the env var should be a documentation feature rather than a built-in command. If you want to open a new PR to document how to build aarch64 using the existing commands & targets that'd be ideal, thanks!

@t3chguy t3chguy closed this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants