Skip to content

fix(test): strip RUSTUP_TOOLCHAIN_SOURCE from test environment#16857

Merged
weihanglo merged 1 commit intorust-lang:masterfrom
Muscraft:remove-rustup-toolchain-source-from-test-env
Apr 8, 2026
Merged

fix(test): strip RUSTUP_TOOLCHAIN_SOURCE from test environment#16857
weihanglo merged 1 commit intorust-lang:masterfrom
Muscraft:remove-rustup-toolchain-source-from-test-env

Conversation

@Muscraft
Copy link
Copy Markdown
Member

@Muscraft Muscraft commented Apr 8, 2026

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?

@rustbot rustbot added A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

.env_remove("RUSTDOC")
.env_remove("RUSTDOCFLAGS")
.env_remove("RUSTFLAGS")
.env_remove("RUSTUP_TOOLCHAIN_SOURCE")
Copy link
Copy Markdown
Member

@weihanglo weihanglo Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

Removing this separately seems fine for cargo devs that has a directory override, though I am not sure if we want to wait for #16469 or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure either. If this truly doesn't affect anything else, it would be nice to have it in sooner to make running tests less cumbersome, but at the same time, I don't want to make #16469 harder.

Copy link
Copy Markdown
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and merged this. This is a two-way door decision anyway.

View changes since this review

@weihanglo weihanglo added this pull request to the merge queue Apr 8, 2026
Merged via the queue into rust-lang:master with commit ec21fce Apr 8, 2026
29 checks passed
@weihanglo weihanglo deleted the remove-rustup-toolchain-source-from-test-env branch April 8, 2026 22:56
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 8, 2026
@smoelius
Copy link
Copy Markdown
Contributor

smoelius commented Apr 9, 2026

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?

Was the warning that the Rust toolchain is overridden for your Rust projects folder?

I think that makes sense, actually. There is currently no requirement that a toolchain override be narrowly scoped.

If you wanted to test this, you could try moving the Cargo repository out of the the Rust projects folder and see if the warnings go away.

(Sorry if I have misunderstood your situation.)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 9, 2026
Update cargo submodule

5 commits in 101549dddbd2b08e806f50154e3aa4cb3374cc21..eb94155a9a60943bd7b1cb04abec42f5d0de6ddc
2026-04-08 12:51:20 +0000 to 2026-04-09 13:10:20 +0000
- Revert "GitHub fast path uses `http_async`" (rust-lang/cargo#16861)
- Correct spelling in cargo info man page (rust-lang/cargo#16863)
- chore: Update annotate-snippets to 0.12.15 (rust-lang/cargo#16859)
- fix(test): strip RUSTUP_TOOLCHAIN_SOURCE from test environment (rust-lang/cargo#16857)
- Support target.'cfg(..)'.rustdocflags analogously to rustflags (rust-lang/cargo#16846)

r? ghost
@rustbot rustbot modified the milestone: 1.96.0 Apr 9, 2026
rust-timer added a commit to rust-lang/rust that referenced this pull request Apr 9, 2026
Rollup merge of #155042 - weihanglo:update-cargo, r=weihanglo

Update cargo submodule

5 commits in 101549dddbd2b08e806f50154e3aa4cb3374cc21..eb94155a9a60943bd7b1cb04abec42f5d0de6ddc
2026-04-08 12:51:20 +0000 to 2026-04-09 13:10:20 +0000
- Revert "GitHub fast path uses `http_async`" (rust-lang/cargo#16861)
- Correct spelling in cargo info man page (rust-lang/cargo#16863)
- chore: Update annotate-snippets to 0.12.15 (rust-lang/cargo#16859)
- fix(test): strip RUSTUP_TOOLCHAIN_SOURCE from test environment (rust-lang/cargo#16857)
- Support target.'cfg(..)'.rustdocflags analogously to rustflags (rust-lang/cargo#16846)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testing-cargo-itself Area: cargo's tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants