Make `rustup update` completely update the default target before working on others
Problem you are trying to solve
For anyone who has multiple targets installed, completing a rustup update can take quite a while. It seems the order of operations is:
- Download
rust-stdfor all installed targets - Download
cargo,rust-src, and other components - Download
rust-stdfor the native/default target (?) - Download
rustc - Remove old components
- Install downloaded components
However, often times only the default target is of immediate interest.
Solution you'd like
Instead, do something like the following order:
- Move the old toolchain directory to a different name
- Download and install
rustc - Download and install
rust-stdfor the default toolchain/target - Download and install components
- Download and install all remaining targets
- Remove the backup directory
This should make it feasible to start working with the most commonly used target within a couple of minutes while everything else updates in the background.
Notes
No response
I don't think we currently make a distinction between rust-std and other components when updating so that would need to be changed. Correct me if I'm wrong.
Using a toolchain while components are being installed is tricky because it involves modifying the toolchain directory. Rustup is not currently safe for that kind of thing. Though I think resolving https://github.com/rust-lang/rustup/issues/3937 would help here.
Using a toolchain while components are being installed is tricky because it involves modifying the toolchain directory. Rustup is not currently safe for that kind of thing. Though I think resolving #3937 would help here.
@ChrisDenton I think #3937 will make this even harder since the client will be blocked when we are installing the active toolchain...
@tgross35 While I do understand your frustrations, I think the right direction to go is something like https://github.com/dtolnay/fast-rustup. Installing toolchains in Rustup is definitely taking much longer than it should, especially if you have access to high-speed internet.
I mean, we can block only when necessary right? We download to a cache so blocking only needs to happen when moving files from the cache to the toolchain directory. The downloads can happen in the background.
One thing I'm wondering about is the most important thing to get a new toolchain up and running asap? Or is it to have the old nightly be usable right up until the new nightly is actually ready?
The latter case would be simpler, I think.
The ordering description doesn't make sense to me - last I saw the code we do an entire toolchain at a time. @rami3l - has anything changed around that?
@tgross35 you can do rustup toolchain update stable (or whatever your default is).
A possibly nice little feature is to allow rustup toolchain update --default or some such.
Oh, I took the OP as meaning about targets. Like if your toolchain has a lot of targets installed then updating all those rust-std components is going to be painful on a slow connection.
Oh, I took the OP as meaning about targets. Like if your toolchain has a lot of targets installed then updating all those
rust-stdcomponents is going to be painful on a slow connection.
Indeed, in my original description I used toolchain to refer to channel+target. I updated this to be specific about target, I always use rustup update nightly.