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

pre-requisites for experimental ARM build #251

Closed
shiftkey opened this issue Apr 8, 2020 · 18 comments · Fixed by #897
Closed

pre-requisites for experimental ARM build #251

shiftkey opened this issue Apr 8, 2020 · 18 comments · Fixed by #897

Comments

@shiftkey
Copy link
Owner

shiftkey commented Apr 8, 2020

There have been several requests for shipping something for ARM versions:

I'm going to use this issue to capture blockers for this:

  • embedded Git - Remove support for arm64 going forward desktop/dugite-native#315 - need to figure out how to build Git from source locally and slipstream the packaged bits into a build
  • native dependencies - NodeJS does have support for building native modules for ARM64, but I haven't explored this
  • local packaging - there's manual steps to do this here but we'd need to update this to support scripted builds
  • continuous integration builds - I want to avoid shipping releases to be tied to a specific machine - how can we avoid this?

Please upvote this if you're interested, or comment if you have any insights to contribute about this work.

@AaronDewes
Copy link

continuous integration builds - I want to avoid shipping releases to be tied to a specific machine - how can we avoid this?

Azure pipelines has arm and arm64.

@Botspot
Copy link

Botspot commented Dec 15, 2020

I have an extra Raspberry Pi 4 that can be set up as a compiling server. @shiftkey, would that benefit you at all?

@theofficialgman
Copy link

theofficialgman commented Mar 22, 2021

arm64 support seems to have been finalized (just waiting on tests) as of a few weeks ago for github desktop macos and windows 10 builds.
interested in arm64 finally getting (and hopefully maintaining) support on linux as welll

@dubiouscript
Copy link

is this relevant ?
desktop/dugite-native#330 (comment)

GitHub actions has no arm64 support

👀

@Botspot
Copy link

Botspot commented Apr 2, 2021

is this relevant ?
desktop/dugite-native#330 (comment)

GitHub actions has no arm64 support

👀

Yes that is relevant. Fortunately, there's a way around this: it's possible to use QEMU within Github actions to emulate armv7l and arm64 machines for compilation purposes.
Several repositories have been doing this recently, like eDEX-UI. These links may be helpful for anyone who's interested: (in no particular order)

Something similar ought to be possible for Github desktop in this case.

@simonSlamka
Copy link

simonSlamka commented Jul 15, 2021

What's the status of this issue? @shiftkey

Running Fedora on a Silicon MacBook.

@xarbit
Copy link

xarbit commented Sep 4, 2021

I have the same situation and question as @simonSlamka
Is there anything I can help with?

@shiftkey

@theofficialgman
Copy link

I've recently been informed about an ARM sponsored program called "Works on ARM".
I'll copy the description here:

Arm and miniNodes have partnered to make Arm-based edge devices and single board computers available for open source software developers to build, test and optimize for Arm. Developers can request hardware for any number of use-cases including, but not limited to:

Porting, testing, and optimizing for Arm
Building new projects on Arm-based edge hardware
Getting more visibility for your project through the Works on Arm program

https://github.com/WorksOnArm/mininodes-arm-edge

If you wanted, I'm sure you could apply (create a simple github issue stating what the project is for and it will almost certainly be accepted). Have them setup a ubuntu bionic ARM64 image on one of the devices (easiest to just do it on a jetson nano or xavier since thats already what they run). Create a github actions ARM64 selfhosted runner on there, and then use it for this project and any of the dependencies.

@theofficialgman
Copy link

theofficialgman commented May 5, 2022

@Botspot I went through the process of manually building first dugite-native (and patching its build script), then patching the many github desktop buildfiles that are hardcoded for x64, and made a deb and appimage for arm64. this was all built on bionic (as is github desktop and dugite normally) so it should work on anything newer than that.

the files are too big to drop here so I put them in my testing repo. I was too lazy to fix rpm but that is simple as well. the dugite-native arm64 linux build is there as well.
https://github.com/theofficialgman/testing/releases/tag/github-desktop

Edit: see #251 (comment) for instructions
edit2: rpm, deb, and appimage all now available

@cycool29
Copy link

cycool29 commented May 5, 2022

@Botspot I went through the process of manually building first dugite-native, then patching the many github desktop buildfiles that are hardcoded for x64, and made a deb and appimage for arm64. this was all built on bionic (as is github desktop and dugite normally) so it should work on anything newer than that.

the files are too big to drop here so I put them in my testing repo. I was too lazy to fix rpm but that is simple as well. the dugite-native arm64 linux build is there as well. https://github.com/theofficialgman/testing/releases/tag/github-desktop

Signing in to GitHub is not working on AppImage, it won't return to the app after signing in from the browser.

DEB package works perfectly! 🎉

I am on Raspberry Pi OS bullseye arm64.

@theofficialgman
Copy link

theofficialgman commented May 5, 2022

Signing in to GitHub is not working on AppImage, it won't return to the app after signing in from the browser.

Yeah I noticed the same thing. I've never tried the appimages from this repo so there might be the same problem. The files contained are the same as the Deb and raw folder (Which both work as you said).

Edit: seems like a known issue #710 #632 (comment)

@theofficialgman
Copy link

theofficialgman commented May 5, 2022

also I just want to react to the "blockers" posting in the original post and how I got around them:

embedded Git - desktop/dugite-native#315 - need to figure out how to build Git from source locally and slipstream the packaged bits into a build

just pull dugite-native and edit a couple of the build scripts to use arm64 instead of the currently hardcoded x86_64/amd64/x86. git LFS already has arm64 linux builds posted so just the dependencies.json file and the buildscripts need to be edited to use it. then it will build correctly and produce a tar.xz

native dependencies - NodeJS does have support for building native modules for ARM64, but I haven't explored this
local packaging - there's manual steps to do this here but we'd need to update this to support scripted builds

I'm not having any issues at all here, must have been a problem a long time ago but it "just works" now.

continuous integration builds - I want to avoid shipping releases to be tied to a specific machine - how can we avoid this?

current releases are already shipped for a specific machine. some of the binaries are built statically but most of it depends on glibc 2.27+ (because your continuous integration builds use ubuntu bionic as a base). Just create an arm64 self hosted runner for github actions and deploy it on a nvidia jetson running ubuntu bionic (or another arm computer running ubuntu bionic) and your builds will be just as compatible as the current releases are for x86_64 linux

and of course, this repo has multiple buildscripts and files that need editing to package the debs/rpm/appimage with the correct arm64 naming

@theofficialgman
Copy link

theofficialgman commented May 6, 2022

copying over the changes I made to this thread, this is not upstreamable in this case:

edit: refer to this comment where I keep the instructions updated for latest release of github desktop Botspot/pi-apps#1775 (comment)

@Hanro50
Copy link

Hanro50 commented Sep 11, 2022

image
Using the the aur on arch I actually managed to get this to build on arm

Requirements to build

  1. System requirements:

6GB of ram. If you have less then you are going to need to add some swap.
You need 6GB free just to be clear or your system will crash.

  1. git and base-devel

You'll get build errors otherwise

  1. gconf

This guide won't cover exactly how to install this, but if you get stuck on an error related to architecture=>follow the install guide and ignore line 2 under step one's subheading

  1. working a xorg environment

Not sure if it works on wayland. I only tested it on X11.

Steps to install:

This is a rough guide

  1. Clone the repository from the aur.

git clone https://aur.archlinux.org/github-desktop.git

  1. edit PKGBUILD

You need to change the line arch=(x86_64) to arch=(aarch64)
You also need to change the line cp -r --preserve=mode dist/github-desktop-linux-x64/* "$pkgdir/opt/$pkgname/" to cp -r --preserve=mode dist/github-desktop-linux-arm64/* "$pkgdir/opt/$pkgname/"

  1. During the install. You are going to need to make the following file "./github-desktop/src/github-desktop/app/node_modules/dugite/git". I recommend doing it after webpack starts compiling

cd github-desktop&&makepkg -si
mkdir src/github-desktop/app/node_modules/dugite/git
Not sure why, but git isn't downloaded correctly

  1. After this, the app should have completed installing, but git is broken.

Fixing git:

  1. Install openssh, make and curl

Needed for some functionality in git. This is why we can't use the system provided package.
You still need said package btw.

  1. goto /opt/github-desktop/resources/app

cd /opt/github-desktop/resources/app

  1. clone git

sudo git clone https://github.com/git/git.git

  1. build git

sudo make prefix=/opt/github-desktop/resources/app/git/ all doc info
sudo make prefix=/opt/github-desktop/resources/app/git/ install install-doc install-html install-info
Feel free to ignore any errors.

If everything works you should be able to launch this on arm. I've yet to install vs code so I cannot comment on how well that works. If you logged in before fixing git, file->options->git->save should fix the desync between the gui and the backend.

It runs well on the pi. I hope this is somewhat helpful to someone.

@monomycelium
Copy link

monomycelium commented Sep 12, 2022

@Hanro50, thank you for the amazing guide! i had no idea there was such a close resource to build a variety of software using aur. i did have to build gconf, but aur also made that easy for me. but step two is confusing to me:

  1. During the install. You are going to need to make the following file "./github-desktop/src/github-desktop/app/node_modules/dugite/git". I recommend doing it after webpack starts compiling

cd github-desktop&&makepkg -si
mkdir src/github-desktop/app/node_modules/dugite/git
Not sure why, but git isn't downloaded correctly

but when i run the two commands there, i get this:

╭─mycelium@asahi:~/Documents/github-desktop ‹master●› 
╰─🐧 $ cd github-desktop&&makepkg -si
mkdir src/github-desktop/app/node_modules/dugite/git
==> ERROR: PKGBUILD does not exist.
mkdir: cannot create directory ‘src/github-desktop/app/node_modules/dugite/git’: No such file or directory

or should i just do this:

DUGITE=./github-desktop/src/github-desktop/app/node_modules/dugite/git
mkdir -p ${DUGITE}

@necrose99
Copy link

necrose99 commented Feb 27, 2023

napi-rs/napi-rs#1206
perhaps a means of linux in that wall of TLDR

@theofficialgman
Copy link

@shiftkey I have done the work a week ago to bring ARM32/ARM64 linux to the CI for dugite and dugite native (at equal or faster speed than x86_64 builds so NO issue there)

please see if you can push these PRs through (referenced above) and then building for ARM32/64 linux for Desktop can be done simply in the CI here. those are the last blocking issues and it would be a shame for fully functional PRs to sit any longer with no response.

@shiftkey
Copy link
Owner Author

For anyone who wants to test these out, a pre-release package is available here: https://github.com/shiftkey/desktop/releases/tag/release-3.2.7-test7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.