Previously, the profile to use when installing a new toolchain had to be
set globally through `rustup set profile`, or at rustup-init time.
Sometimes this is inconvenient, because you only want to use a
particular profile when installing a specific toolchain. This patch
allows users to pass `--profile` to `rustup install` to override the
profile used for that one install.
Fixes#2004.
Add support for "-c" and "-t" to `rustup toolchain install`
and to `rustup-init` itself.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Use update_from_dist flag for Notification::RemovingOldComponent
Rename explicit_modify param in update fn of dist manifestitation
Rename implicit_modify param in update fn of dist manifestitation
Previously, if the user had components installed on `nightly` which were
not available for the latest nightly, `rustup update` would not update
the user's nightly at all. With this patch, rustup will try
progressively older nightlies until it finds a nightly that supports all
the components the user has installed for their current nightly.
Fixes#1628.
Makes progress towards #1501.
Fixes the underlying issue in #1676.
Update verbose option for toolchain list
Correct toolchain list tests w. verbose option
Update syntax based on clippy
Simplify toolchain_list fn in rustup_mode.rs
Correct typo in list subcommand
This reduces the waste in the target/ directory which could otherwise
run a system out of disk space.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Verify that targets which are not available are not listed
when we look for targets in a toolchain.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
In order to mitigate the test failures we were seeing where we
ran out of hard links on NTFS filesystems, copy the rustup binary
into place in the test environment, rather than hard-linking
the one which was built. In order to do this safely, we use
an RwLock to ensure we can't be forking in other tests while
one test is copying a binary into place.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
The import of std::fs::File was only used in the windows
codepath, so localise its use to remove unused import warnings
otherwise issued in the tests.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
When Rustup is fresh-installed with no toolchain, or if the
user deletes the default toolchain setting in the toml, then
the first time we *Install* a new toolchain, set it as the default.
This removes the surprising effect of:
rustup-init --default-toolchain none
...
rustup toolchain install stable
...
cargo build
=> no toolchain set.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
The sender can be parameterised with a type parameter allowing
write-once handlers that can handle any Notification type within
their enum hierarchy as long as From is present, unlike the receiver
(because the receiver is passed as a parameter to the function that
will be doing the callback.)
Less adapters, less closures, less headaches when introducing UI
interactions to currently UI-interactionless codepaths.