Skip to content

Commit 4a25ef5

Browse files
committed
Note that how we set MSYS ignores env/env_remove calls
This problem can be avoided by a design that doesn't create the assumption that such calls would have an effect, or that prevents them from being made (e.g. a builder funtion), or by accounting for and honoring them (which may involve reimplementing a fragment of the Windows API based case-folding that `std::process::Command` uses). But none of these approaches really seems overall better than what we are doing now. So for now, keep the design but note this one confusing spot. This is a private function, so I've just commented by where the relevant logic is, rather than using a `///` comment.
1 parent 0e1e6a9 commit 4a25ef5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/tools/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ fn configure_command<'a, I: IntoIterator<Item = S>, S: AsRef<OsStr>>(
594594
args: I,
595595
script_result_directory: &Path,
596596
) -> &'a mut std::process::Command {
597+
// For simplicity, we extend the `MSYS` variable from from our own environment. This disregards
598+
// state from any prior `cmd.env("MSYS")` or `cmd.env_remove("MSYS")` calls. Such calls should
599+
// either be avoided, or made after this function returns (but before spawning the command).
597600
let mut msys_for_git_bash_on_windows = env::var_os("MSYS").unwrap_or_default();
598601
msys_for_git_bash_on_windows.push(" winsymlinks:nativestrict");
599602
cmd.args(args)

0 commit comments

Comments
 (0)