Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

ARM64 support on Linux #115

Closed
blackmennewstyle opened this issue Jan 17, 2022 · 10 comments
Closed

ARM64 support on Linux #115

blackmennewstyle opened this issue Jan 17, 2022 · 10 comments
Labels
feature New feature

Comments

@blackmennewstyle
Copy link

Hello talented devs :)

Can we hope for some arm64 support in the future? I'm planning to install the wallet on a Raspberry Pi 4 8GB running GNU/Linux Debian 11 - kernel 5.10.0-9-arm64, is it possible at the current stage of the project? If not, will it be possible in the future? :$

@mvaivre
Copy link
Member

mvaivre commented Jan 17, 2022

Hey there, thanks for your message!
The ARM64 architecture is not yet supported on Linux, mostly due to the lack of demand so far. But here you are...
So yeah, we can definitely hope for some arm64 in the future, probably in the next release! ;)

@mvaivre mvaivre changed the title Can we hope for arm64 support in the future? ARM64 support on Linux Jan 17, 2022
@mvaivre mvaivre added the feature New feature label Jan 17, 2022
@blackmennewstyle
Copy link
Author

Hey there, thanks for your message! The ARM64 architecture is not yet supported on Linux, mostly due to the lack of demand so far. But here you are... So yeah, we can definitely hope for some arm64 in the future, probably in the next release! ;)

Nice :)
Merci beaucoup Mikaël !
Enjoy your week :)

@mvaivre
Copy link
Member

mvaivre commented Feb 28, 2022

@nop33 Hey Ilias, could you look into this while I'm testing the address derivation & UX?
It should basically be 1 flag to add in the package.json script + adapt the corresponding github build action.
Do you still have VMWare running on your M1 mac? If so, should be quite easy to spin up an arm64 build of debian / ubuntu. If not, don't spend to much effort on this RN. KMP, thanks!

@nop33
Copy link
Member

nop33 commented Feb 28, 2022

Hey @mvaivre, I am working on implementing tests for the settings utility functions of the wallet project, as we discussed in the PR. I don't have a VMWare installed, but I can install one. I can do that after I implement the tests.

nop33 added a commit that referenced this issue Feb 28, 2022
nop33 added a commit that referenced this issue Feb 28, 2022
nop33 added a commit that referenced this issue Feb 28, 2022
nop33 added a commit that referenced this issue Mar 1, 2022
@nop33
Copy link
Member

nop33 commented Mar 1, 2022

Hello @blackmennewstyle! I've added a new npm script that you can use to build the app for ARM64 from source (I updated the README with instructions). Unfortunately, I couldn't get GitHub's CI to work with ARM64 just yet. The process to build for ARM64 from source is very simple:

npm install
npm run electron-pack-linux:arm64

Keep in mind that the master branch is cutting-edge code and should not be used in production. Use code from the releases instead.

@blackmennewstyle
Copy link
Author

Hello @blackmennewstyle! I've added a new npm script that you can use to build the app for ARM64 from source (I updated the README with instructions). Unfortunately, I couldn't get GitHub's CI to work with ARM64 just yet. The process to build for ARM64 from source is very simple:

npm install
npm run electron-pack-linux:arm64

Keep in mind that the master branch is cutting-edge code and should not be used in production. Use code from the releases instead.

Hello :)

Thank you for your response. I'm not really an expert with npm but if i understand correctly, i need to download the sources from a release, for example: https://github.com/alephium/alephium-wallet/archive/refs/tags/v1.1.0.tar.gz . And i should replace the package.json contained in the tar.gz file with this one: https://github.com/alephium/alephium-wallet/blob/support-arm64-linux/package.json

@nop33
Copy link
Member

nop33 commented Mar 1, 2022

..., i need to download the sources from a release, for example: https://github.com/alephium/alephium-wallet/archive/refs/tags/v1.1.0.tar.gz . And i should replace the package.json contained in the tar.gz file with this one: https://github.com/alephium/alephium-wallet/blob/support-arm64-linux/package.json

That would probably work, but there might have been other changes in the package.json file between v1.1.0 and the latest master which might cause your procedure to not work. I would recommend following the following procedure (assuming you are not very familiar with git):

  1. Extract the contents of the ZIP/tar.gz file
  2. Open your terminal
  3. Navigate to the extracted ZIP folder
  4. Execute the command npm install
  5. Execute the command npm run build && npx electron-builder -l --arm64
  6. The .deb file will be inside the /dist directory

I hope this helps!

@blackmennewstyle
Copy link
Author

..., i need to download the sources from a release, for example: https://github.com/alephium/alephium-wallet/archive/refs/tags/v1.1.0.tar.gz . And i should replace the package.json contained in the tar.gz file with this one: https://github.com/alephium/alephium-wallet/blob/support-arm64-linux/package.json

That would probably work, but there might have been other changes in the package.json file between v1.1.0 and the latest master which might cause your procedure to not work. I would recommend following the following procedure (assuming you are not very familiar with git):

1. Extract the contents of the ZIP/tar.gz file

2. Open your terminal

3. Navigate to the extracted ZIP folder

4. Execute the command `npm install`

5. Execute the command `npm run build && npx electron-builder -l --arm64`

6. The `.deb` file will be inside the `/dist` directory

I hope this helps!

Definitely helped :)

wget https://github.com/alephium/alephium-wallet/archive/refs/tags/v1.1.0.tar.gz
tar -xvf v1.1.0.tar.gz
cd alephium-wallet-1.1.0

npm install

npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated [email protected]: Use promise-toolbox/fromEvent instead
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

added 2766 packages, and audited 2767 packages in 3m

185 packages are looking for funding
  run `npm fund` for details

46 vulnerabilities (32 moderate, 12 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

npm run build && npx electron-builder -l --arm64


> [email protected] build
> cross-env REACT_APP_VERSION=$npm_package_version INLINE_RUNTIME_CHUNK=false REACT_APP_CSP="script-src 'self'" react-scripts build

Creating an optimized production build...
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0

YOUR TYPESCRIPT VERSION: 4.5.2

Please only submit bug reports when using the officially supported version.

=============
Compiled successfully.

File sizes after gzip:

  783.3 KB   build/static/js/2.e5b24d0c.chunk.js
  180.75 KB  build/static/js/main.342dd536.chunk.js
  2.57 KB    build/static/css/2.7983be9c.chunk.css
  781 B      build/static/js/runtime-main.d77c4cef.js
  432 B      build/static/css/main.a4d683a3.chunk.css

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

  \u2022 electron-builder  version=22.14.5 os=5.10.0-11-arm64
  \u2022 loaded configuration  file=package.json ("build" field)
  \u2022 loaded parent configuration  preset=react-cra
  \u2022 writing effective config  file=dist/builder-effective-config.yaml
  \u2022 packaging       platform=linux arch=arm64 electron=15.3.2 appOutDir=dist/linux-arm64-unpacked
  \u2022 building        target=AppImage arch=arm64 file=dist/Alephium-1.0.2-arm64.AppImage
  \u2022 building        target=deb arch=arm64 file=dist/alephium-wallet_1.0.2_arm64.deb
  \u2a2f cannot execute  cause=exit status 1
                    errorOut=/home/ceedii/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/ceedii/.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
    /home/ceedii/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/ceedii/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success
    
                    command=/home/ceedii/.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 libsecret-1-0 --deb-recommends libappindicator3-1 --deb-compression xz --architecture arm64 --after-install /tmp/t-U77MgT/0-after-install --after-remove /tmp/t-U77MgT/1-after-remove --description '
     The official Alephium wallet' --version 1.0.2 --package /home/ceedii/alephium-wallet-1.1.0/dist/alephium-wallet_1.0.2_arm64.deb --name alephium-wallet --maintainer 'Alephium dev <[email protected]>' --url https://./ --vendor 'Alephium dev <[email protected]>' --deb-priority optional /home/ceedii/alephium-wallet-1.1.0/dist/linux-arm64-unpacked/=/opt/Alephium /home/ceedii/alephium-wallet-1.1.0/assets/icon.png=/usr/share/icons/hicolor/512x512/apps/alephium.png /tmp/t-U77MgT/2-alephium.desktop=/usr/share/applications/alephium.desktop
                    workingDir=

However, i seem to have an issue with the .deb file build procedure.

@nop33
Copy link
Member

nop33 commented Mar 1, 2022

Hm, I didn't face this issue on my arm64 MacBook. Maybe this helps? jordansissel/fpm#1801 (comment) (or this electron-userland/electron-builder#5154 (comment))

@blackmennewstyle
Copy link
Author

blackmennewstyle commented Mar 1, 2022

Hm, I didn't face this issue on my arm64 MacBook. Maybe this helps? jordansissel/fpm#1801 (comment)

Oh i actually remember using that command with yarn for building LBry on my Raspberry Pi 4, i should have thought about it :)

export USE_SYSTEM_FPM=true
npm run build && npx electron-builder -l --arm64

> [email protected] build
> cross-env REACT_APP_VERSION=$npm_package_version INLINE_RUNTIME_CHUNK=false REACT_APP_CSP="script-src 'self'" react-scripts build

Creating an optimized production build...
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0

YOUR TYPESCRIPT VERSION: 4.5.2

Please only submit bug reports when using the officially supported version.

=============
Compiled successfully.

File sizes after gzip:

  783.3 KB (-27 B)  build/static/js/2.e5b24d0c.chunk.js
  180.75 KB (-4 B)  build/static/js/main.342dd536.chunk.js
  2.57 KB (-44 B)   build/static/css/2.7983be9c.chunk.css
  781 B             build/static/js/runtime-main.d77c4cef.js
  432 B             build/static/css/main.a4d683a3.chunk.css

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

  \u2022 electron-builder  version=22.14.5 os=5.10.0-11-arm64
  \u2022 loaded configuration  file=package.json ("build" field)
  \u2022 loaded parent configuration  preset=react-cra
  \u2022 writing effective config  file=dist/builder-effective-config.yaml
  \u2022 packaging       platform=linux arch=arm64 electron=15.3.2 appOutDir=dist/linux-arm64-unpacked
  \u2022 building        target=AppImage arch=arm64 file=dist/Alephium-1.0.2-arm64.AppImage
  \u2022 building        target=deb arch=arm64 file=dist/alephium-wallet_1.0.2_arm64.deb

Definitely made the trick. Successfully built and installed :)
With root privileges

dpkg -i dist/alephium-wallet_1.0.2_arm64.deb 
Selecting previously unselected package alephium-wallet.
(Reading database ... 242126 files and directories currently installed.)
Preparing to unpack .../alephium-wallet_1.0.2_arm64.deb ...
Unpacking alephium-wallet (1.0.2) ...
Setting up alephium-wallet (1.0.2) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...

Screenshot_2022-03-01_15-03-48
Thank you so much for your assistance :)

LeeAlephium pushed a commit that referenced this issue May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

3 participants