Skip to content

Commit ce3c09a

Browse files
ehussdjc
authored andcommitted
Change default for RUSTUP_WINDOWS_PATH_ADD_BIN
1 parent b15a989 commit ce3c09a

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/toolchain/toolchain.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<'a> Toolchain<'a> {
165165
}
166166

167167
if cfg!(target_os = "windows") {
168-
// Historically rustup has included the bin directory in PATH to
168+
// Historically rustup included the bin directory in PATH to
169169
// work around some bugs (see
170170
// https://github.com/rust-lang/rustup/pull/3178 for more
171171
// information). This shouldn't be needed anymore, and it causes
@@ -174,10 +174,13 @@ impl<'a> Toolchain<'a> {
174174
// recursive call won't work because it is not executing the
175175
// proxy, so the `+` toolchain override doesn't work.
176176
//
177-
// This is opt-in to allow us to get more real-world testing.
177+
// The RUSTUP_WINDOWS_PATH_ADD_BIN env var was added to opt-in to
178+
// testing the fix. The default is now off, but this is left here
179+
// just in case there are problems. Consider removing in the
180+
// future if it doesn't seem necessary.
178181
if process()
179182
.var_os("RUSTUP_WINDOWS_PATH_ADD_BIN")
180-
.map_or(true, |s| s == "1")
183+
.map_or(false, |s| s == "1")
181184
{
182185
path_entries.push(self.path.join("bin"));
183186
}

tests/suite/cli_rustup.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -586,21 +586,7 @@ fn recursive_cargo() {
586586
fs::create_dir_all(&cargo_bin_path).unwrap();
587587
fs::copy(real_mock_cargo, cargo_subcommand).unwrap();
588588

589-
// Verify the default behavior, which is currently broken on Windows.
590-
let args = &["cargo", "--recursive-cargo-subcommand"];
591-
if cfg!(windows) {
592-
config.expect_err(
593-
&["cargo", "--recursive-cargo-subcommand"],
594-
"bad mock proxy commandline",
595-
);
596-
}
597-
598-
// Try the opt-in, which should fix it.
599-
let out = config.run(args[0], &args[1..], &[("RUSTUP_WINDOWS_PATH_ADD_BIN", "0")]);
600-
if !out.ok || !out.stdout.contains("hash-nightly-2") {
601-
clitools::print_command(args, &out);
602-
panic!("expected hash-nightly-2 in output");
603-
}
589+
config.expect_stdout_ok(&["cargo", "--recursive-cargo-subcommand"], "hash-nightly-2");
604590
});
605591
});
606592
}

0 commit comments

Comments
 (0)