Skip to content

Commit 195bf95

Browse files
committed
fixup! mingw: allow git.exe to be used instead of the "Git wrapper"
When this commit was originally introduced, Windows/ARM64 support was a fantasy. In the meantime it is reality and we need to do a better job of setting `MSYSTEM` and the `PATH`: We want to support Windows/ARM64 properly. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4cf0647 commit 195bf95

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

compat/mingw.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,6 +3613,10 @@ static size_t append_system_bin_dirs(char *path, size_t size)
36133613
strip_suffix_mem(prefix, &len, "\\mingw64\\bin"))
36143614
off += xsnprintf(path + off, size - off,
36153615
"%.*s\\mingw64\\bin;", (int)len, prefix);
3616+
else if (strip_suffix_mem(prefix, &len, "\\clangarm64\\libexec\\git-core") ||
3617+
strip_suffix_mem(prefix, &len, "\\clangarm64\\bin"))
3618+
off += xsnprintf(path + off, size - off,
3619+
"%.*s\\clangarm64\\bin;", (int)len, prefix);
36163620
else if (strip_suffix_mem(prefix, &len, "\\mingw32\\libexec\\git-core") ||
36173621
strip_suffix_mem(prefix, &len, "\\mingw32\\bin"))
36183622
off += xsnprintf(path + off, size - off,
@@ -3718,9 +3722,13 @@ static void setup_windows_environment(void)
37183722
char buf[32768];
37193723
size_t off = 0;
37203724

3721-
xsnprintf(buf, sizeof(buf),
3722-
"MINGW%d", (int)(sizeof(void *) * 8));
3723-
setenv("MSYSTEM", buf, 1);
3725+
#if defined(__MINGW64__) || defined(_M_AMD64)
3726+
setenv("MSYSTEM", "MINGW64", 1);
3727+
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
3728+
setenv("MSYSTEM", "CLANGARM64", 1);
3729+
#else
3730+
setenv("MSYSTEM", "MINGW32", 1);
3731+
#endif
37243732

37253733
if (home)
37263734
off += xsnprintf(buf + off, sizeof(buf) - off,

0 commit comments

Comments
 (0)