-
Notifications
You must be signed in to change notification settings - Fork 2.6k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Any plans for an ARM64-compatible release #2346
Comments
My ignorance here, but is Windows on ARM64? This maybe an 'upstream' question to see if the new Azure CI capability could build and test for ARM (and maybe the Rasp pi? he says with ulterior motives...) |
I looked into it, and the main issue is the lack of an ARM64 version of MSYS2. There does seem to exist an ARM64 version (at least a preliminary one) of Cygwin (on which MSYS2 is based), so there is hope. However, I would like to encourage everybody who is interested in ARM64 support to chip in some work, as there is plenty to do before we will have a working Git for Windows on ARM64. Like, highly encourage. I talk about MSYS2 because we need this for the parts of Git that are still implemented as Unix shell and Perl scripts ( In the short run, if you should try to build Git for Windows yourself, in Visual Studio, by cloning this repository and checking out |
It's my understanding that you can only natively build ARM64 apps on Windows if they are based off of UWP. Otherwise, there is an x86 emulator for running Win32 applications, and Microsoft announced in November that they were working on an x64 emulator for Windows applications. I think we would need to wait until Microsoft makes x64 emulation generally available to approach this. If there's any preliminary work I can do in the mean time that would help out, please feel free to let me know and I will be happy to see what I can do. |
@dscho I'm interested in helping with bringing Git for Windows to ARM64. Locally i was able to get the vckpg dependencies built for ARM64 with only a tiny bit of hacking. The result of my efforts is a an ARM64 git.exe binary that at least dumps the help message successfully on my ARM laptop (i haven't tried anything else yet). Would you like to chat either here or offline about what you see as the full list of work that might be required beyond this? ian Bearman |
That sounds amazing! Let's chat here, okay? One of the biggest obstacles to getting Git to work on ARM is the lack of a Bash. But many things already work without a Bash... So we could aim first for building a slightly incomplete Git for Windows (ARM64 edition) using the Visual C build. What was that hackery you needed? Patches to |
I can create a PR for my changes, but i'm not sure the process for this. The changes are all in the 'git' source tree. Is there doc/contributors guide that covers this? In the meantime, here's an outline of what i did based on SDK-64:
After these changes, building the git.sln for ARM64 "just works". I copied over to my ARM64 device and i have some very basic functionality working (i.e. the logo and help message). I dropped the binary into a folder layout matching an installed version and things got a bit better, but authentication for a fetch didn't work (missing DLLs i believe) and git checkout doesn't work if there are any new files (i didn't look further into this last week). Is there a top-down view i can get of dependencies? That might be better than stabbing tin the dark looking for missing pieces. Additionally, i couldn't find documentation on building the installer, which i thought might give me a clue as to what binaries i need to look for. |
The documentation for building an installer is at https://github.com/git-for-windows/git/wiki/Making-an-installer |
Btw, i've tried to push my local changes to the git repo, but its not working for me...
|
You don't have push access to git-for-windows/git (very few people do). Click "Fork" near the top to create a copy on your github account, push there, then create a pull request. |
I'm making steady progress by mixing x86 binaries (from x86 install of Git for Windows) and the ARM64 binaries i built. I'm blocked on a few things right now and any help on these is appreciated:
i'm not sure where to start to investigate this, so pointers to what the authentication process or where its located in source at lest might give me a push in the right direction.
Please let me know your thoughts on these topics. thanks, |
Spending time debugging The libcurl dependency is a vcpkg dependency... so i didn't run any configuration on it: is there possibly something strange here? Is this is a scenario that is not tested in VS build scenario? Additional help is appreciated. |
Have you seen microsoft/vcpkg#9683? To get openssl support with vcpkg curl you apparently need to run |
@rimrul , thanks. that was my conclusion as well from reading the vckpg docs, but that still leaves open my second question: Is this is a scenario that is not tested in VS build scenario? How far into uncharted territory am i right now? |
Far ;-) Last time I tried to compile for ARM, |
Nevermind, I should have read back further: |
Thank you for the workaround, @dscho , My 'uncharted territory' was more about the VS build then ARM64. From what i cnan teThe x86 and x64 vcpkg builds of curl also do not have openSSL support as it not included in the default build. Is the VS build intended to be fully functional? |
Not really. I'll try to give you a very brief (and probably incomplete) overview: Git for Windows consists of the parts that are implemented in C, and some Perl/shell scripts. The Perl/shell scripts are run via MSYS2's Perl and Bash. Unfortunately, Git assumes that a shell interpreter is available (yay for Linux legacy), which shows when you try to execute a pager ( The biggest problem with MSYS2 is that it is derived from Cygwin, and Cygwin started only recently looking into supporting ARM (I have not checked how far that effort went so far). Suffice to say, MSYS2 is not provided for ARM. Apart from that, Git for Windows is actually independent from MSYS2. The parts that are implemented in C (which are nowadays almost all commands, notable exceptions are the submodule support, We usually use GCC to build those executables, in particular the We also provide a way to build with Visual C. Regarding this question:
We try our best to keep it as functional as possible, the CI/PR pipeline tries to verify that. Note that the test suite itself is implemented in shell script, therefore you won't be able to run any of those regression tests if you don't have a shell interpreter (and we typically use MSYS2's Bash for that, more on that below). So the "VS build" is actually a hodgepodge of executables compiled with Visual C, copied into the right place (I do not even think that we have an official MSBuild target for that), and Perl/shell scripts run via the parts from a MSYS2 system (which are compiled with yet another fork of GCC). Now, for the dependencies. I will restrict myself to the C part here. The minimal set of dependencies consists of Git for Windows also uses these dependencies in addition:
Now back to the shell scripts. There is BusyBox, and there is a Win32 port of it. BusyBox is an all-in-one executable that provides the functionality of a POSIX shell, of all the Unix utilities frequently expected by scripts, e.g. For Perl, I do not really have any hope (and no, using Strawberry Perl is not an option: Git's heaviest Perl user is |
As you probably guessed: indeed, the regression test suite does not test HTTP/HTTPS functionality on Windows. The reason is that Git's regression tests covering that use case require Apache2 server executables to be available for starting up a transient HTTPS server. |
I was able to get curl building with openSSL and cloning from Azure DevOps worked!
BTW, this is about 2.5x faster clone than the x86 emulated Git for Windows 🏎 💨 |
What do you think of my idea of building an ARM64 installer with x86 binaries? It seems like this could create a ramp to convert to native ARM64 step-by-step. Initially the package could contain ARM64 git compiled binaries and dependencies and then move to ARM64 mingw and other utilities once they are avaiable/supported? |
Excellent news! About the x86 binaries... Honestly, I'd like to avoid that, but it would make sense, wouldn't it? That way you have a fully functional Git for Windows, relatively fast in most commands... |
x86 emulation on Windows on ARM is quite good; my option is that developers shouldn't shy away from taking advantage of it. |
Okay, that makes sense. So to build an ARM64 version of Git for Windows, we would start with a 32-bit Git for Windows SDK, build the ARM64 binaries via MSBuild, install them into the SDK and then bundle the result. The installer itself is already an x86 executable (so that we can use the same framework for both 32-bit/64-bit). The only tricky thing for now would be the step where the binaries are copied into the SDK; the command |
I'm hacking through the various pieces to put something together as proof-of-concept. After spending some time on it yesterday, i think some help understanding how the scripts and utilities in build-extra work might accelerate things. Is there any literature on the shell script methodology or installer tools that are used? Specifically i'm working on how the script is discovering what binaries to copy into the install package as i need to add some new ones, but generally in order to turn this into something more then just a hack, i think i need more details. |
Update: i've hacked up several files in the installation to build an appropriate installer and i have things basically working now from what i can tell. I ran my installer on my ARM64 Windows laptop and was able to clone a repo using the ARM64 git. The changes i've made to the installer are a mess though. Current state:
Pretty happy with where things are for a Friday afternoon! |
@manbearian excellent progress! FWIW I think the best way to address these things would be to hack something related to There are already customizations in that script with regards to MinGit, and we can easily add more. Having said that, my personal preference would be to build a The way we build this package is via To build the Finally, it would be really awesome if we could build the binaries via |
@tommyvct I have to admit that the tone of this almost-demand rubs me in all the wrong ways. You may not have meant to sound like it, but it sure comes over as if you considered this a thing other people do for you and all you have to do exactly nothing but sit back. Comments like this make me want to stop spending any time on that project. It is very demotivating. |
I'm sorry if my tone was not appropriate. You see that this issue has been inactive for 5 months, and I just want to have an update on the situation as an outsider, and potentially what I can do. I feel sorry that your comments also sounds demotivating. You may not in a good mood, but Christmas is fast approaching, why not take a break? Merry Christmas 🎄 |
@dscho While I totally understand and also feel that the coronavirus situation is getting on all of us and hence there is a lot of frustration in the air, I'm pretty sure @tommyvct didn't mean anything wrong and is probably just not a native English speaker. Me too, btw, so please keep this in mind 🙂 In any case, I believe we are all very supportive of you and this project. I personally am fully open to support your efforts as much as I can, whether by providing my Surface Pro X as a build/test ground, picking up some tasks (please let me know what exactly needs to be done there), or donating to the project. Please stay safe and try to still have fun in these dark times! We're all in the same boat ✋ |
@Alovchin91 thank you for providing a bit of motivation again. Much appreciated. |
I'd very much appreciate an ARM64 native build of the git tools when working on my Surface Pro X. The emulation using the x86 binaries works for basic usage, but it fails with high-demand scenarios. For example, git lfs filtering fails when trying to fetch a 1 GB binary...
|
Can't wait for git to run natively on windows 10 on ARM, would love to help but I really have no clue :( |
|
Let me try to summarize our progress here. The main goal currently is to create an arm64 package that has the Steps to get to a first arm64 release (again, mostly with
Here's a rough first arm64 version for anyone who wants to try: https://github.com/dennisameling/git/releases/tag/2.30.0-beta2 |
Sounds good, we only have to do that in the post-install part of the
Right. I still hope that you can get an i686 version of |
That should be possible to determine using IsWow64Process2(). |
Heh, I just added this suggestion 15 minutes ago: git-for-windows/MINGW-packages#44 (comment) |
According to this blog post from 2017 it should work, but we might need to be careful on Windows 10 prior to 1709. |
Good idea, thanks for sharing! Will check it now |
It works with x86/i686 executable on ARM64 device: x86/i686 executable on x64 device: I'll spend some time this weekend to see how I can incorporate this in the |
Well, we're talking about the Git wrapper here, so it would need to do its own |
|
Got it to work (including on Windows 8.1, haven't tested Win7) in git-for-windows/MINGW-packages#44 🎉 |
So far, I suppose that |
I would've liked the internal consistency of doing this kind of dynamic function loading the same way throughout the Git for Windows code base, but I see your point. Seems like Dennis already picked the loading implementation from the blog post anyways. |
Update: we're making great progress. I was able to create a To see an overview of open PRs for the ARM64 work please see this comment. Here's how it works: This is basically a So it first looks in Here you can see that it indeed uses Git from We're getting very close everyone! Exciting times 🎉 |
@dennisameling seems like that release was removed, any word on it? |
@KritantaDev sorry, I had to re-fork this repo. Just uploaded the beta release again on the same URL, could you please try again now? 😊 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Are there any plans to support an ARM64-compatible release of Git for Windows?
The text was updated successfully, but these errors were encountered: