Skip to content

Commit 2d2c11b

Browse files
committed
feat: Extend EXEPATH optimization to support ARM64 Windows
On Windows, the `gix_path::env::system_prefix()` function has two strategies. The first is an optimization that doesn't always work, where the `EXEPATH` environment variable is consulted. In Git Bash, this variable is usually available, pointing somewhere into the Git for Windows installation. Most commonly, but in practice not universally, it points to the top-level directory of the Git for Windows installation. `system_prefix()` on Windows looks for a subdirectory of this directory that is named for one of the MSYS2 environment https://www.msys2.org/docs/environments prefixes, of those Git for Windows has builds for. (Otherwise, it falls back to traversing to such a location upward from what `git --exec-path` reveals, which is often slower as `git` must sometimes be run.) However, this `EXEPATH` optimization had only checked for the `mingw64` and `mingw32` environment prefixes. This was ideal before ARM64 builds of Git for Windows were released. But since then, it is useful to allow the `clangarm64` environment prefix as well, to allow the `EXEPATH` optimization to work on ARM64 builds of Git for Windows. This makes that change.
1 parent d5f4c9f commit 2d2c11b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gix-path/src/env/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ where
155155
F: Fn(&str) -> Option<OsString>,
156156
{
157157
let root = PathBuf::from(var_os_func("EXEPATH")?);
158-
for candidate in ["mingw64", "mingw32"] {
158+
for candidate in ["clangarm64", "mingw64", "mingw32"] {
159159
let candidate = root.join(candidate);
160160
if candidate.is_dir() {
161161
return Some(candidate);

0 commit comments

Comments
 (0)