Skip to content

Commit 2fae663

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 3f661f5 + 73ce0dc commit 2fae663

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

environment.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,21 @@ int max_allowed_tree_depth =
8787
* tree depth; This value seems to be low enough.
8888
*/
8989
1280;
90+
#else
91+
#if defined(GIT_WINDOWS_NATIVE) && defined(__clang__) && defined(__aarch64__)
92+
/*
93+
* Similar to Visual C, it seems that on Windows/ARM64 the clang-based
94+
* builds have a smaller stack space available. When running out of
95+
* that stack space, a `STATUS_STACK_OVERFLOW` is produced. When the
96+
* Git command was run from an MSYS2 Bash, this unfortunately results
97+
* in an exit code 127. Let's prevent that by lowering the maximal
98+
* tree depth; This value seems to be low enough.
99+
*/
100+
1280;
90101
#else
91102
2048;
92103
#endif
104+
#endif
93105

94106
#ifndef PROTECT_HFS_DEFAULT
95107
#define PROTECT_HFS_DEFAULT 0

0 commit comments

Comments
 (0)