Skip to content

Commit 108c16e

Browse files
committed
bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2
Cygwin defaults to rooting Windows paths in /cygdrive/X, while MSYS2 configures them to be /X. Regardless of configuration, drives are always accessible as /proc/cygdrive/X, so use that.
1 parent 88b3b52 commit 108c16e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bootstrap/src/core/build_steps/install.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ fn sanitize_sh(path: &Path, is_cygwin: bool) -> String {
3838
if ch.next() != Some('/') {
3939
return None;
4040
}
41-
Some(format!("/{}/{}", drive, &s[drive.len_utf8() + 2..]))
41+
// The prefix for Windows drives in Cygwin/MSYS2 is configurable, but
42+
// /proc/cygdrive is available regardless of configuration since 1.7.33
43+
Some(format!("/proc/cygdrive/{}/{}", drive, &s[drive.len_utf8() + 2..]))
4244
}
4345
}
4446

0 commit comments

Comments
 (0)