Skip to content

Commit ec21fce

Browse files
authored
fix(test): strip RUSTUP_TOOLCHAIN_SOURCE from test environment (#16857)
While I was trying to run the testsuite earlier, I kept running into issues with `install` tests failing due to `cargo` warning about toolchain overrides, as I have an override for my whole Rust projects folder. After looking into it for a bit, I found that removing `RUSTUP_TOOLCHAIN_SOURCE` from the `test_env` resolved the warnings without causing any other tests to fail. I spent some time looking at #16131 and #16469, trying to find ways this could cause problems, and while I couldn't find any, I am not very confident in my assessment. @smoelius do you have any thoughts?
2 parents 40c3d9c + d26359c commit ec21fce

File tree

1 file changed

+1
-0
lines changed
  • crates/cargo-test-support/src

1 file changed

+1
-0
lines changed

crates/cargo-test-support/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,7 @@ pub trait TestEnvCommandExt: Sized {
14581458
.env_remove("RUSTDOC")
14591459
.env_remove("RUSTDOCFLAGS")
14601460
.env_remove("RUSTFLAGS")
1461+
.env_remove("RUSTUP_TOOLCHAIN_SOURCE")
14611462
.env_remove("SSH_AUTH_SOCK") // ensure an outer agent is never contacted
14621463
.env_remove("USER") // not set on some rust-lang docker images
14631464
.env_remove("XDG_CONFIG_HOME") // see #2345

0 commit comments

Comments
 (0)