fix: support Windows ARM64 (clangarm64) in install.cmd#1259
Open
AchoArnold wants to merge 3 commits into
Open
Conversation
Git for Windows on ARM64 uses a `clangarm64` directory instead of `mingw64`. The installer now auto-detects `clangarm64` when `mingw64` is not present, so it works out of the box on ARM64 Windows machines without requiring the user to manually supply the path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates install.cmd to support Git for Windows on ARM64, where the installation uses a clangarm64 directory layout instead of mingw64, by detecting and accepting either directory when resolving the install prefix.
Changes:
- Extend prefix auto-detection to fall back to
clangarm64whenmingw64is not present. - Update default install path logic (
%ProgramFiles%\Git) to detectclangarm64. - Update install path validation to accept either
mingw64orclangarm64.
Comments suppressed due to low confidence (1)
install.cmd:75
- The user guidance still says the supplied path should point to the
mingw64directory, but the script now also supportsclangarm64. This can confuse ARM64 users who hit the fallback path handling.
echo Using git install path "%~1" as PREFIX, please make sure it's really a
echo path to the mingw64 directory...
echo.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+42
to
+48
| if exist "%installdir%mingw64" ( | ||
| set PREFIX=%installdir%mingw64 | ||
| ) else if exist "%installdir%clangarm64" ( | ||
| set PREFIX=%installdir%clangarm64 | ||
| ) else ( | ||
| set PREFIX=%installdir%mingw64 | ||
| ) |
Comment on lines
41
to
+45
| for %%G in ("%bindir%") do set installdir=%%~dpG | ||
| set PREFIX=%installdir%mingw64 | ||
| if exist "%installdir%mingw64" ( | ||
| set PREFIX=%installdir%mingw64 | ||
| ) else if exist "%installdir%clangarm64" ( | ||
| set PREFIX=%installdir%clangarm64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Git for Windows on ARM64 uses a
clangarm64directory instead ofmingw64. Runninginstall.cmdon an ARM64 Windows machine fails with:Solution
Updated
install.cmdto auto-detectclangarm64whenmingw64is not present. The changes cover all four places where the script resolves the target directory:clangarm64ifmingw64doesn't exist%ProgramFiles%\Gitclangarm64in user-provided install pathsmingw64orclangarm64When both directories exist,
mingw64is preferred to preserve existing behavior on x86/x64 systems.Testing
Tested on Windows 11 ARM64 with Git for Windows 2.54.0 (
clangarm64layout). The installer now correctly detects and installs toC:\Program Files\Git\clangarm64without requiring the user to manually supply the path.