Skip to content

Commit 79c0db6

Browse files
authored
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. If there are other shells on Windows that are supported and use /X style paths, perhaps something more complicated needs to be done.
1 parent 88b3b52 commit 79c0db6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ 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+
Some(format!("/proc/cygdrive/{}/{}", drive, &s[drive.len_utf8() + 2..]))
4242
}
4343
}
4444

0 commit comments

Comments
 (0)