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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2025-04-15 18:24:48 +02:00
parent 4cf0647f7e
commit 195bf95a85

View File

@@ -3613,6 +3613,10 @@ static size_t append_system_bin_dirs(char *path, size_t size)
strip_suffix_mem(prefix, &len, "\\mingw64\\bin"))
off += xsnprintf(path + off, size - off,
"%.*s\\mingw64\\bin;", (int)len, prefix);
else if (strip_suffix_mem(prefix, &len, "\\clangarm64\\libexec\\git-core") ||
strip_suffix_mem(prefix, &len, "\\clangarm64\\bin"))
off += xsnprintf(path + off, size - off,
"%.*s\\clangarm64\\bin;", (int)len, prefix);
else if (strip_suffix_mem(prefix, &len, "\\mingw32\\libexec\\git-core") ||
strip_suffix_mem(prefix, &len, "\\mingw32\\bin"))
off += xsnprintf(path + off, size - off,
@@ -3718,9 +3722,13 @@ static void setup_windows_environment(void)
char buf[32768];
size_t off = 0;
xsnprintf(buf, sizeof(buf),
"MINGW%d", (int)(sizeof(void *) * 8));
setenv("MSYSTEM", buf, 1);
#if defined(__MINGW64__) || defined(_M_AMD64)
setenv("MSYSTEM", "MINGW64", 1);
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
setenv("MSYSTEM", "CLANGARM64", 1);
#else
setenv("MSYSTEM", "MINGW32", 1);
#endif
if (home)
off += xsnprintf(buf + off, sizeof(buf) - off,