session-desktop icon indicating copy to clipboard operation
session-desktop copied to clipboard

[Feature Request] ARM64

Open FatBirdie opened this issue 3 years ago • 115 comments

Hi Would love to see an AppImage made for Arm64 so Session could be run on Raspberry, Pine etc. I'm not sure if interest for this is very low or non existent, but if you have a need for it please give this a thumbs up.

Cheers!

FatBirdie avatar May 15 '21 07:05 FatBirdie

As someone that has primarily ARM devices due to not being able to afford something better, this would be a huge quality of life improvement.

To my knowledge, this would be required to get it to run on a PinePhone as well since they use an Allwinner A64 SoC. The PinePhone would need additional support through proper UI scaling but that's already been mentioned in issue #1304.

ryouko-dev avatar May 30 '21 01:05 ryouko-dev

Has any progress for this to be added as a feature been made? I own a pinephone and would really appreciate support for arm64 - either being able to build from source or as an AppImage.

Happy to help debug/contribute too.

BugInACode avatar Jun 25 '21 03:06 BugInACode

Hey,

I cannot test this all the way as I only have a remove raspi 4 without a display, but I get a Gtk-WARNING **: 03:01:32.435: cannot open display:

so I guess it almost start. Maybe the screen not present is the only left issue? Here is what I did:

in package.json change the build-release command to

    "build-release": "cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release --arm64",

(just add the --arm64 at the end in fact)

then run

yarn icon-gen
yarn build-release

it should build you a file release/session-desktop-linux-arm64-1.6.6.AppImage

see the arm64 in its name. upload that to your raspberry. try to start it, complains about missing libz.so

looks like the library is installed on raspi with the version number /usr/lib/aarch64-linux-gnu/libz.so.1 so you just need to sudo ln -s /usr/lib/aarch64-linux-gnu/libz.so.1 /usr/lib/aarch64-linux-gnu/libz.so and then ./session-desktop-linux-arm64-1.6.6.AppImage

At this point, it just asks on my side for a screen. What do you get?

Bilb avatar Jun 29 '21 01:06 Bilb

@Bilb Thanks for the response, unfortunately I could not run yarn icon-gen and got the following error. Searching online I could not find what exit code 127 was relating to.

mobian@mobian:~/session-desktop$ yarn icon-gen
yarn run v1.22.10
$ electron-icon-maker --input=images/session/session_icon_1024.png --output=./build
/bin/sh: 1: electron-icon-maker: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you confirm I should be building this on the pinephone, or should I do this on another linux machine (amd64) and then transfer the AppImage across?

BugInACode avatar Jun 29 '21 03:06 BugInACode

Never used Yarn before, getting this error, both on my PI and my x64: $ yarn icon-gen 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'icon-gen'

FatBirdie avatar Jun 29 '21 07:06 FatBirdie

@Bilb Thanks for the response, unfortunately I could not run yarn icon-gen and got the following error. Searching online I could not find what exit code 127 was relating to.

mobian@mobian:~/session-desktop$ yarn icon-gen
yarn run v1.22.10
$ electron-icon-maker --input=images/session/session_icon_1024.png --output=./build
/bin/sh: 1: electron-icon-maker: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you confirm I should be building this on the pinephone, or should I do this on another linux machine (amd64) and then transfer the AppImage across?

I tried on my x64 so I would recommend doing the same.

About your error. Did you run yarn install --frozen before?

Bilb avatar Jun 30 '21 05:06 Bilb

Never used Yarn before, getting this error, both on my PI and my x64: $ yarn icon-gen 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'icon-gen'

what is the yarn package installed? it's not supposed to be a binary you installed from your repository but an npm global binary

Before trying to build a release you should first follow those steps as seen in the Building.md file

sudo apt-get install python2
# install nvm by following their github README
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn grunt # transpile and assemble files

then which yarn should return something like ~/.nvm/versions/node/v14.17.1/bin/yarn

Only then you can try to do what I am taking about in this comment

Bilb avatar Jun 30 '21 05:06 Bilb

@Bilb

About your error. Did you run yarn install --frozen before?

I decided to clone the repo and begin from scratch on my x64, when I run this I got this output

However I decided to continue building and created the AppImage. I moved it to the pinephone and executed ./session-desktop-linux-1.6.7.AppImage (on the pinephone, not through ssh) and got the following output, unsure whether the two are related.

EDIT: I changed the outputs to be uploaded to the pastebin so the thread is tidy

BugInACode avatar Jun 30 '21 13:06 BugInACode

In thr first output, you get an error here import sys; print "%s.%s.%s" % sys.version_info[:3]; this looks very much like a python3 as default error.

Can you tell me what's returned by which python & python --version ?

Bilb avatar Jun 30 '21 23:06 Bilb

Ah yes, my mistake I thought it was changed to python2 after installing.

$ which python
/home/aquarius/anaconda3/bin/python
$ python --version
Python 3.7.6

~~I have two python binaries python2 and python2.7, does it matter which one is used?~~ There is a symbolic link between them

BugInACode avatar Jun 30 '21 23:06 BugInACode

you should be able to overide your default python temporary just with this command alias python=/usr/bin/python2.7 (or wherever python is installed locally)

and rerun your command yarn install --frozen

Bilb avatar Jun 30 '21 23:06 Bilb

Just reran yarn install --frozen-lockfile and did not produce any errors. yarn icon-gen and yarn build-release also completed successfully, however I still get an error after running the AppImage on the pinephone. The cause seems different to the one I mentioned earlier but seems like it produced the same error. This is the output

BugInACode avatar Jul 01 '21 00:07 BugInACode

before build-release you also need to compile .ts and .tsx files to js. with yarn grunt

Bilb avatar Jul 01 '21 00:07 Bilb

yarn grunt had no errors but the AppImage being run on the pinephone did not change as per my last response.

BugInACode avatar Jul 01 '21 00:07 BugInACode

maybe just compile on amd64 PC with electron-builder config like

electron-builder build --linux ... --arm64 --armv7l

peepo5 avatar Jul 03 '21 20:07 peepo5

When I try to install electron-builder using yarn add electron-builder [--dev] I am unable to as there is a conflict between some modules. If using nvm v10.19.0 there is an error of

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=12.0.0". Got "10.19.0"
error Found incompatible module.

and if nvm v12.0.0 is used then the following error is produced

error [email protected]: The engine "node" is incompatible with this module. Expected version "^10.19.0". Got "12.0.0"
error Found incompatible module.

As with FatBirdie this too my first time using these commands and I am unsure how to move forward from here.

As with the error log from my previous comment, I am not sure where the error is coming from as on lines 6-9 it appears that in the home/mobian/.config/Session folder there is only one (empty) folder named Dictionaries/. Is this what should be expected?

BugInACode avatar Jul 05 '21 05:07 BugInACode

@Bilb @peepopoggers I have taken this a few steps back and attempted to build the AppImage for my x64 and was able to run it. I have then proceeded to create the AppImage for my own raspberry pi but I am unable to execute the AppImage as I get the error below.

I followed the below steps in order, can you let me know if I'm building correctly?

On x64

git clone <repo>
cd session-desktop/
nano package.json    # add --arm64 to the end of the build release line
alias python='/usr/bin/python2'
nvm use 10.19.0
npm install -g yarn    # make sure yarn is up to date
yarn install --frozen-lockfile
yarn generate
yarn build-release

Instead of yarn generate I have also tried yarn icon-gen then yarn grunt individually I then copy the AppImage via USB from my x64 to the Raspberry Pi

On Raspberry Pi

pi@raspberrypi:~ $ ./session-desktop-linux-arm64-1.6.7.AppImage 
bash: ./session-desktop-linux-arm64-1.6.7.AppImage: cannot execute binary file: Exec format error
pi@raspberrypi:~ $ sudo !!
sudo ./session-desktop-linux-arm64-1.6.7.AppImage 
./session-desktop-linux-arm64-1.6.7.AppImage: 2: ./session-desktop-linux-arm64-1.6.7.AppImage: Syntax error: "(" unexpected

I've also tried [sudo] chmod [a]+x session-desktop-linux-arm64-1.6.7.AppImage and it returns the same errors.

As I have an external monitor if I can replicate your AppImage for my Raspberry Pi I can also check whether the build was successful before moving back to the pinephone.

BugInACode avatar Jul 08 '21 04:07 BugInACode

can you try to rebuild on your computer after having removed in package.json the

    "afterPack": "./build/afterPackHook.js"

(and the , right before it). Does that Syntax error: "(" unexpected still happens?

Bilb avatar Jul 09 '21 06:07 Bilb

No it does not remove the error EDIT: I assume you also meant follow all the steps I took previously and that they are correct

BugInACode avatar Jul 09 '21 07:07 BugInACode

Just tried to see if the latest updates fixed this and I can only get so far as to run yarn install --frozen-lockfile and run in to the error

[1/6] Validating package.json... error [email protected]: The engine "node" is incompatible with this module. Expected version "^14.16.0". Got "10.19.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Any updates on when this will work? The main reason I dont use my pinephone daily yet is because I dont have a secure messaging platform working yet and would really like this to work.

BugInACode avatar Oct 17 '21 05:10 BugInACode

nvm install 14.16.0 probably giving it what it wants? The instructions I'm guessing are old and it's no longer looking for 10.19.0. Confirm it's installed with nvm --version.

necro-nemesis avatar Oct 19 '21 00:10 necro-nemesis

@necro-nemesis changing the version to 14.16.0 did allow ~~it to attempt to build~~ yarn install --frozen-lockfile to execute but it failed giving this error. Unfortunately I'm not familiar with this language and am unable to debug it.

BugInACode avatar Oct 19 '21 00:10 BugInACode

It's having a problem building sqlite3 or .. better-sqlite3 and archiving it. Try installing git-lfs sudo apt install git-lfs and build again. You may need to delete your node modules and yarn clean cache.

necro-nemesis avatar Oct 19 '21 00:10 necro-nemesis

I was able to build the AppImage for the pinephone, but when I tried opening it I got this error, again not sure how to proceed but it does look like it's almost complete

BugInACode avatar Oct 19 '21 01:10 BugInACode

You're further ahead than I am at this point. I'm trying to build on a Pi4 to see if it's feasible. Possibly someone working on Session development could throw us a bone?

necro-nemesis avatar Oct 19 '21 01:10 necro-nemesis

One thing I discovered poking around is the annoying network timeout warnings has a an option yarn install --frozen-lockfile --network-timeout 600000

necro-nemesis avatar Oct 19 '21 01:10 necro-nemesis

I don't think the timeout was a problem for me, I have been building on an x64 system if that makes any difference. Hopefully the devs pull through then!

BugInACode avatar Oct 19 '21 02:10 BugInACode

timeout was an issue for me and that fixed the option. I've the added challenge on trying to build on 32bit but if the objective is to use on Raspberry Pi OS then I'm limited there. Not sure of the merit in supporting this build but at this point it's just the challenge to see if it will build.

The Linux build instructions could use some attention like listing current dependencies. The correct version to build on etc. I was even looking over the github Actions CI Ubuntu build to see what was there that could be missing. That's where I picked up on the timeout option.

necro-nemesis avatar Oct 19 '21 03:10 necro-nemesis

nvm install 14.16.0 probably giving it what it wants? The instructions I'm guessing are old and it's no longer looking for 10.19.0. Confirm it's installed with nvm --version.

nvm install without version specified, on linux should look for the .nvmrc file containing the right version of nvm to install.

Bilb avatar Oct 19 '21 03:10 Bilb

Could you send me the full logs of the furthest you got ?

Bilb avatar Oct 19 '21 03:10 Bilb