Skip to content

Commit 515736b

Browse files
committed
clangarm64: let the tests pass! (#5586)
I encountered these issues that had hitherto escaped us [when I worked on letting the `ci-artifacts` workflow in git-sdk-arm64 also build Git and run the test suite](git-for-windows/git-sdk-arm64#37) by way of validating the `minimal-sdk` artifact. Mind, this PR does not only adjust a test case that was previously too fixated on x86_64. There are two real issues that this PR addresses and that were found via the test suite: - When the environment variable `MSYSTEM` is not yet set, it now is set appropriately even on Windows/ARM64 (and the `PATH` is adjusted accordingly). - The tree traversal limit designed to avoid stack overflows needed to be adjusted for the clangarm64 builds.
2 parents 22f58fc + a5d3dfd commit 515736b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

environment.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,21 @@ int max_allowed_tree_depth =
8181
* the stack overflow can occur.
8282
*/
8383
512;
84+
#else
85+
#if defined(GIT_WINDOWS_NATIVE) && defined(__clang__) && defined(__aarch64__)
86+
/*
87+
* Similar to Visual C, it seems that on Windows/ARM64 the clang-based
88+
* builds have a smaller stack space available. When running out of
89+
* that stack space, a `STATUS_STACK_OVERFLOW` is produced. When the
90+
* Git command was run from an MSYS2 Bash, this unfortunately results
91+
* in an exit code 127. Let's prevent that by lowering the maximal
92+
* tree depth; This value seems to be low enough.
93+
*/
94+
1280;
8495
#else
8596
2048;
8697
#endif
98+
#endif
8799

88100
#ifndef PROTECT_HFS_DEFAULT
89101
#define PROTECT_HFS_DEFAULT 0

0 commit comments

Comments
 (0)