Skip to content

Conversation

@joshka
Copy link

@joshka joshka commented Nov 3, 2025

Problem:
rustup currently logs an info-level message when a rust-toolchain.toml file overrides the active toolchain. This message is easy to miss in CI logs, leading to confusion when the expected toolchain (e.g., beta) isn’t being used.

Fix:
Promote the message about toolchain override (rust-toolchain.toml) from info to warn level, making it more visible during builds and CI runs.

Fix #4504

@djc
Copy link
Contributor

djc commented Nov 3, 2025

I don't think this PR makes sense. Since the behavior is intended, displaying this as a warning violates a common expectation of what a warning means in most logging.

@joshka
Copy link
Author

joshka commented Nov 4, 2025

I don't think this PR makes sense. Since the behavior is intended, displaying this as a warning violates a common expectation of what a warning means in most logging.

I don't think that's the case here. This should be a warning because it's easy to miss that when you set the default toochain, but have an override then setting the default actually has no effect. This message is warning the user user that this configuration is nonsense and won't do what you expect from running commands that alter the default toolchain.

This is a very real problem that came from thinking that we were running some tasks against the beta toolchain, but actually weren't. Warnings in logging are often used to mark places like this that are possibly a problem but may not be, hence this is not an error.

@djc
Copy link
Contributor

djc commented Nov 4, 2025

This should be a warning because it's easy to miss that when you set the default toochain, but have an override then setting the default actually has no effect. This message is warning the user user that this configuration is nonsense and won't do what you expect from running commands that alter the default toolchain.

From my perspective, this message is informing the user that rustup is executing on its configuration. I don't think rustup can decide whether that configuration is nonsense or not.

@joshka
Copy link
Author

joshka commented Nov 5, 2025

Strong opinion, weakly held disagreement with your perspective here.
Happy to close as I understand the problem.

@djc
Copy link
Contributor

djc commented Nov 5, 2025

Strong opinion, weakly held disagreement with your perspective here. Happy to close as I understand the problem.

What part do you disagree with? How would we make the warning not annoying to people who have intentionally set up an override?

@joshka
Copy link
Author

joshka commented Nov 6, 2025

I believe this is a footgun. It's not an error, but it's an easy misconfiguring that rustup can and should highlight.

The ability to install a default rust toolchain when you're in a context where that default will not be used should be an annoying warning even when this is intentional as using a tool like dtolnay/rust-toolchain

I can see how having any warnings that you can't disable might be also a problem. But it's not an error, and it will never fail a ci process to see this warning. The ability to explicitly opt in to warnings as errors for compilation is something to bear in mind here.

Warnings that help ensure that things are ok are good warnings. Making them info level makes them bad warnings.

As mentioned, I'm happy to defer to your wider context on this though as it's unlikely that I'll personally make this mistake again and it may be me over indexing on prevention of something that happens rarely. (That said, I just submitted a PR at work where I would have hit this exact problem had I not been aware of it).

@djc
Copy link
Contributor

djc commented Nov 6, 2025

@rami3l @ChrisDenton thoughts?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make message about rust-toolchain.toml a warning

2 participants