-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustup should use the configured profile as fallback when the key is not present in rust-toolchain.toml
#3805
Comments
The rustup docs imply that it should be using the configured
|
@polarathene Thanks for your in-depth investigation! I believe this is covered by #3483 as you've already found out, and no, that design is not intentional; I even believe my #3492 has fixed it. Unfortunately, the inclusion of that patch hasn't been moving forward for a very specific reason: hierarchical config will introduce new attack vectors if one or serveral |
@polarathene OTOH I'm open to doc improvements, although I'm not sure if we're documenting a bug. Maybe calling it a limitation would be better. If you can come up with a PR, I'll be glad to review it 🙏 |
TL;DR: I could adjust the docs.. however fixing the regression introduced (specifically to
So to clarify:
Is it not possible to fix the regression introduced specifically with
I'd rather address that than correct the docs with the existing gotcha. If the contribution doesn't sound too troublesome and would get approval, I can give it a shot?
|
@polarathene Wait, you reminded me of something. Maybe my #3492 can be carefully cherry-picked into two parts. I do remember some commits are related to So in theory you can use (or get inspired from) half of my PR (so without the As long as @rbtcollins agrees with that plan. Anyway, that PR is on our v1.28 milestone (meaning we have to at least react to it in some way), so I'm not going anywhere. |
Seemingly this has been fixed on main. I have added a regression test here: #4040. |
@lucacasonato Thanks for the heads up! This looks interesting. Maybe that's a side effect from the serde introduction in #3864 (cc @djc)? If so, I'd be glad to close this very soon. |
Hmm, it's not obvious to me why/how that PR changed it. Would be interesting to bisect this... |
@djc Actually there was a semantic change regarding Lines 88 to 100 in 5442ade
The relevant Lines 46 to 55 in e774ac0
I'm still not sure if this has influenced anything. Will investigate further... |
Given that |
@djc You're right. This is a regression from #3340, and fix is actually in ae71bde. Obviously I failed to recognize one my own commits XD TLDR: The |
Hah, that makes sense. |
Verification
Problem
In 2020Q4 support for installing a toolchain defined in
rust-toolchain.toml
with a new profile key was added to rustup: #2586While this works, when the
profile
key is not set, there is no fallback to the global profile setting for rustup. Thus ifrust-toolchain.toml
exists, despite rustup being configured for aminimal
profile, the toolchain will be downloaded with thedefault
profile bringing in over 600MB of HTML docs and additional components.This took a while to trackdown/confirm why the rustup profile wasn't being respected 😅 While a little surprising, I tried searching for any existing issues and came up empty.
Steps
minimal
.rust-toolchain.toml
file in an empty directory, with contents:cargo --version
, rustup will download the toolchain.minimal
profile:If you repeat these steps but add
profile = "minimal"
to therust-toolchain.toml
file with a different toolchain version, the HTML docs won't be present, theshare/
directory itself will now be about 500KB.Possible Solution(s)
profile
is not defined, use the rustup configured profile setting to align with installing a toolchain viarustup
explicitly.rust-toolchain.toml
without aprofile
key will not fallback to the global rustup profile, which can result in excessive disk usage.Notes
Past issues requesting the feature support prior to the 2020 PR:
--profile minimal
#2579Discussion regarding interoperability across config layers, including better documenting precedence:
rust-toolchain.toml
and other override sources for components and targets #3483Rustup version
Installed toolchains
OS version
The text was updated successfully, but these errors were encountered: