-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Windows arm64 support #2915
Windows arm64 support #2915
Conversation
Modern MSVC or Windows versions don't support big-endian, so it's unnecessary to consider architectures when using it. This also makes ARM64 MSVC builds succeed. Helped-by: brian m. carlson <[email protected]> Signed-off-by: Daniel Gurney <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
In 1af265f (compat/bswap.h: simplify MSVC endianness detection, 2020-11-08) we attempted to simplify code by assuming MSVC builds will be for little-endian machines, since only unusably old versions of MSVC supported big-endian MIPS and m68k architectures. However, it's possible that MSVC could be ported to build for a big-endian architecture again, so the simplification wasn't as future-proof as hoped. So let's go back to the old way of detecting MSVC, and then checking architecture from a list of little-endian architecture macros. Note that MSVC does not treat ARM64 as bi-endian, so we can safely treat it as little-endian. Helped-by: brian m. carlson <[email protected]> Helped-by: Jeff King <[email protected]> Helped-by: Johannes Schindelin <[email protected]> Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Daniel Gurney <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
Wow, nice progress! |
There seems to be an issue with This clearly shows up in the CI logs as well: https://github.com/git-for-windows/git/pull/2915/checks?check_run_id=1468481105 The reason the I'll wait for the issue with |
@dscho Good news: ARM64 artifacts were successfully generated in CI and are available at https://github.com/git-for-windows/git/actions/runs/389986817 🎉 I can run Git natively on ARM64 now, and commands like
However, things like
The What are the next steps now? 😊 |
When I follow the steps from I'm not finding any references to |
Yep, this is a known issue: running Git in-place does not work. You can work around that either by calling
Good point. Should be start building |
This is how the relevant step looks currently: & compat/vcbuild/vcpkg_install.bat
if (!$?) { exit(1); }
git init vcbuild-artifacts\compat\vcbuild\vcpkg
if (!$?) { exit(1); }
Copy-Item compat\vcbuild\vcpkg\vcpkg.exe vcbuild-artifacts\compat\vcbuild\vcpkg -Force
if (!$?) { exit(1); }
Copy-Item compat\vcbuild\vcpkg\installed vcbuild-artifacts\compat\vcbuild\vcpkg -Force -Recurse
if (!$?) { exit(1); }
Copy-Item compat\vcbuild\vcpkg\packages vcbuild-artifacts\compat\vcbuild\vcpkg -Force -Recurse
if (!$?) { exit(1); }
# Remove manual pages (they are not used, and only bloat the artifact)
Get-ChildItem vcbuild-artifacts\compat\vcbuild\vcpkg html -recurse -directory | ForEach-Object {Remove-Item $_.FullName -Recurse -Force}
if (!$?) { exit(1); }
Hrm. I don't know, either. There are mentions of |
Oh, this looks interesting: CMake generates an |
Sounds good. You'd just have to change
Oh great! I'll check that tomorrow towards the end of the day. Thanks! 👍 |
Note to self: this might help: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-160#ide-integration
|
If I understand correctly, this does not use the same technique as the |
Apparently git/contrib/buildsystems/CMakeLists.txt Lines 7 to 40 in ffcedc7
... meaning that git/.github/workflows/main.yml Lines 208 to 214 in ffcedc7
|
Yes, that's the idea. If you do this, you should be able to run |
In preparation for more work to support Windows/ARM64, let's merge the fix that already made it into upstream Git. Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Ian Bearman <[email protected]> Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
Co-authored-by: Dennis Ameling <[email protected]> Signed-off-by: Ian Bearman <[email protected]> Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
In this context, a "feature" is a dependency combined with its own dependencies. Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
There are no Windows/ARM64 agents in GitHub Actions yet, therefore we just skip adjusting the `vs-test` job for now. Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
@dennisameling since I cherry-picked your iconv fix, it was my fault that there were merge conflicts. So I figured I'd better resolve them, and so I did (by rebasing the patches, squashing a few fixups here and there and avoiding white-space issues). I force-pushed to your branch (thank you for permitting to do that!), could you have a look? |
Signed-off-by: Dennis Ameling <[email protected]>
@dscho Good news: I was able to get native Git arm64 working on my Surface Pro X. The results:
So it's twice as fast cloning this specific repo as the x86 emulated version of Git 🚀 These were the steps I had to take:
Contents of The steps below take place on the arm64 device
Then I got the following error while trying a
So I did So I basically installed 32-bit Git on my arm64 device and then overwrote the Git binaries with the native What is the next step now to release an "arm64 version" of Git which is basically |
Excellent news! I would recommend installing into BTW if you set Unfortunately, we cannot simply include the ARM64 build products in the |
Oh, and should we maybe merge this PR before doing anything else? |
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
Windows arm64 support
…m64-support Windows arm64 support
Windows arm64 support
Builds upon the work that was started in #2507
I was able to build a Git executable for arm64 locally by doing some hacks/manual fixes. I can create artifacts as well, just can't run
git.exe
yet due to an error thaticonv-2.dll
is missing. To be continued 🚀Related to #2346