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

[DRAFT] Add ability to build deb files on aarch64 #4762

Closed
wants to merge 17 commits into from

Conversation

jokaorgua
Copy link

This PR is a draft.

I was able to add support of aarch64 containers for building the sources but I do not know how to add arm64 arch for building the packages.

Due to the logs of github actions it still builds x64 on aarch64

I need help with this.

I've checked out the insomnia on my ubuntu 20.04 ARM and ran it through npm run dev. Everything seems to be ok.
Maybe someone could advise better solution for building the arm version of snap or deb files? Would be great

@jokaorgua
Copy link
Author

so the problem of building x86 on aarch64 was in fpm. it has a bug in version prior to 1.13 (jordansissel/fpm#1775)

I've fixed the workflow to install the latest fpm from ubuntu's repo and use it for building

@jokaorgua
Copy link
Author

I'm stuck with installing nvm in the container under aarch64. If anybody knows how to do that properly I will be really appreciated it. Or maybe somebody knows how to install specific version of nodejs without nvm?

@jackkav
Copy link
Contributor

jackkav commented May 12, 2022

If I understand the intent of this PR correctly you would like to add arm64 architecture support to insomnia. Assuming that's the case it would be helpful to start locally and test it out before looking at github actions. Here's how this can be done using electron-builder.

cd packages/insomnia
npm run build:app
BUILD_TARGETS=deb node_modules/.bin/electron-builder build --config electron-builder.config.js --arm64
  • electron-builder  version=23.0.7 os=5.16.19-76051619-generic
overriding build targets to:  [ 'deb' ]
  • loaded configuration  file=/home/jack/git/insomnia/packages/insomnia/electron-builder.config.js
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=@getinsomnia/[email protected] platform=linux arch=arm64
  • packaging       platform=linux arch=arm64 electron=18.1.0 appOutDir=dist/linux-arm64-unpacked
  • building        target=deb arch=arm64 file=dist/Insomnia.Core-2022.4.0-beta.0.deb

@jokaorgua
Copy link
Author

@jackkav I've already built arm64 deb on my local machine. Everything works correctly. But I can not make it building in github action. The main problem, currently, is to install needed version of node. I can not install nvm in arm64 virtual machine in github actions. And I do not know other way to install the exact version of node needed for building the Insomnia

@jackkav
Copy link
Contributor

jackkav commented May 12, 2022

The node version is 16.3.2, you don't need nvm to build we just use .nvmrc to track this version in our tooling.

jokaorgua added 3 commits May 12, 2022 14:46
seems to be working node setup container on aarch64
fixed permissions bug with logs for npm
@jokaorgua
Copy link
Author

@jackkav
how to install the exact version of node without nvm ?
when I install it from repo for ubuntu it installs 16.5.0 and build fails

  > [email protected] preinstall
  > node ./scripts/check-version.js
  
  Incorrect node version installed ...
  
  Current node version -> 16.15.0
  Expected node version -> 16.13.2

jokaorgua added 2 commits May 12, 2022 15:24
found a way how to install needed nodejs without nvm
trying to make npm working
@jokaorgua
Copy link
Author

@jackkav I've found a way how to install exact version of node without npm

but now I have a problem which I can not solve by myself

Run `npm audit` for details.
  lerna notice cli v4.0.0
  lerna info ci enabled
  lerna info Bootstrapping 30 packages
  lerna info Installing external dependencies
  lerna ERR! npm ci exited 243 in 'insomnia-components'
  lerna ERR! npm ci stderr:
  glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
    errno: -13,
    code: 'EACCES',
    syscall: 'scandir',
    path: '/root/.npm/_logs'
  }
  npm ERR! code EACCES
  npm ERR! syscall lstat
  npm ERR! path /root/.npm/_cacache/content-v2/sha512/cb/5d/67184953215f824f766ff6ded52a5f90de14d0a13f5ad50cdece1865e91a76d6027f2154d6ed9df2f4459786e5010b64a19dff835f46a7b5e72903048ff3
  npm ERR! errno -13
  npm ERR! 
  npm ERR! Your cache folder contains root-owned files, due to a bug in
  npm ERR! previous versions of npm which has since been addressed.
  npm ERR! 
  npm ERR! To permanently fix this problem, please run:
  npm ERR!   sudo chown -R 1001:121 "/root/.npm"
  lerna ERR! npm ci exited 243 in 'insomnia-components'
  lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.

I'm not a nodejs dev

@ParitoshBh
Copy link

@jokaorgua I don't have an exact solution to your issue but I did face a similar problem when compiling using a Dockerfile and I had to change user to root.

Also, glued together a script to compile for arm64, might give out a hint as to what's missing with your changes. Here it is - https://github.com/ParitoshBh/script-ions/tree/master/insomnia_arm64_deb

@jackkav
Copy link
Contributor

jackkav commented Oct 11, 2022

Closed as stale.

@jackkav jackkav closed this Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants