git-credential-manager icon indicating copy to clipboard operation
git-credential-manager copied to clipboard

Make it easier to build for ARM

Open ankitbko opened this issue 2 years ago • 11 comments

As of now code changes are required to build for ARM64 as detailed in #237 . The build.sh has also changed since the PR was created and now has pinned runtime variable. https://github.com/GitCredentialManager/git-credential-manager/blob/859900272fae3d3b89e39cf85ffdcf28003f5afc/src/linux/Packaging.Linux/build.sh#L53

Ask is to parameterize as much as possible so even though it is not officially supported, users can build a version for ARM without having to make all these code changes.

ankitbko avatar Jan 09 '22 13:01 ankitbko

@mjcheetham I would like to work on this issue. Please let me know if this is alright and any pointers to get started.

surya-prakash-susarla avatar Apr 10 '22 07:04 surya-prakash-susarla

@Surya-06 thank you for volunteering to work on this issue 🌟! You are more than welcome to start whenever you have spare time to tackle it. As for pointers, I would take a look at the build.sh script and the dotnet documentation on Linux runtimes before diving in.

ldennington avatar Apr 12 '22 22:04 ldennington

thanks @ldennington , I'll try to find some time and close this.

surya-prakash-susarla avatar Apr 13 '22 11:04 surya-prakash-susarla

@ldennington I took a fresh pull today and somehow when I just run dotnet -c build LinuxRelease or dotnet -c build LinuxDebug it builds just fine (earlier I got multiple errors when restoring the solution files and build would fail). I also faced issues with dotnet 5 vs 6 etc. Can you please confirm if what I'm seeing is right? I can't remember setting any persistent variable which could've affected subsequent builds etc. and noticed that there was a change which upgraded the dotnet version. PS: I'm building on a Rpi 4B.

surya-prakash-susarla avatar Apr 15 '22 07:04 surya-prakash-susarla

@Surya-06 - I'm a bit confused about what the ask is. Are you still having problems building? If so, could you paste in the error text you see?

ldennington avatar Apr 15 '22 18:04 ldennington

@ldennington Sorry for the delay, I got caught up in other things. The problem is weird actually. 2 weeks back I cloned the repo on my rpi and tried to build it locally. I remember running into a ton of errors and after following multiple threads I removed some of the configurations from the solution file and also installed a couple of utils before I could actually build the binary. When I started to work on this issue I deleted my old clone and made a fresh clone to isolate the changes. Weirdly enough, when I build it now it builds without any complaints and I can't understand how it is working. I see that the dotnet version was upgraded between the 2 clones the last time I checked but wasn't sure if this fixed the issue. I will try creating a different user this time and try some stuff there to confirm but I wanted to check if there is a possibility that this just started working after the upgrade.

surya-prakash-susarla avatar Apr 26 '22 14:04 surya-prakash-susarla

Sorry - accidentally tapped the Close button on this issue.

I think as long as it's building fine now we shouldn't worry about it too much 😊. If you start to have issues again, though, let us know!

ldennington avatar Apr 26 '22 18:04 ldennington

As far as I can tell the only impediment to an arm build is "RUNTIME=linux-x64" in src/linux/Packaging.Linux/layout.sh When I change that to RUNTIME=linux-arm64, it builds on a Jetson. There was a trick to getting dotnet setup too but that is the only one for GCM.

AronRubin avatar Jun 12 '23 14:06 AronRubin

What is the goal here? I managed to build and install it on an ubuntu-22.04 arm64 server by changing the RUNTIME variable, as @AronRubin suggested, and then

git-credential-manager/src/linux/Packaging.Linux$ ./layout.sh
git-credential-manager/src/linux/Packaging.Linux$ ./pack.sh --version=2.4.1 --payload=/home/ubuntu/Projects/git-credential-manager/out/linux/Packaging.Linux/Debug/payload/ --symbols=/home/ubuntu/Projects/git-credential-manager/out/linux/Packaging.Linux/Debug/payload.sym
git-credential-manager/out/linux/Packaging.Linux/Debug/deb$ sudo dpkg -i gcm-linux_arm64.2.4.1.deb

I also did not need any trick for the dotnet setup. I simply installed dotnet-sdk-7.0 and dpkg-dev. Or are you looking fore easy cross compilation? What do you need to make an arm release?

NicoDietrich avatar Nov 23 '23 09:11 NicoDietrich

What is the goal here?

Speaking for myself, a .deb package for Raspberry Pi would be great. (#1117 was closed in favor of this issue.)

haukex avatar Nov 24 '23 08:11 haukex

What is the goal here? I managed to build and install it on an ubuntu-22.04 arm64 server by changing the RUNTIME variable, as @AronRubin suggested, and then

git-credential-manager/src/linux/Packaging.Linux$ ./layout.sh
git-credential-manager/src/linux/Packaging.Linux$ ./pack.sh --version=2.4.1 --payload=/home/ubuntu/Projects/git-credential-manager/out/linux/Packaging.Linux/Debug/payload/ --symbols=/home/ubuntu/Projects/git-credential-manager/out/linux/Packaging.Linux/Debug/payload.sym
git-credential-manager/out/linux/Packaging.Linux/Debug/deb$ sudo dpkg -i gcm-linux_arm64.2.4.1.deb

I also did not need any trick for the dotnet setup. I simply installed dotnet-sdk-7.0 and dpkg-dev. Or are you looking fore easy cross compilation? What do you need to make an arm release?

Worked for me on Ubuntu 22.04! Published my build here: https://github.com/trueToastedCode/git-credential-manager/releases

trueToastedCode avatar Jan 28 '24 10:01 trueToastedCode