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.
The ordering of some of the parts of the component-unavailable
error message was unfortunate, resulting in confusion. This
reorders those so that errors are slightly clearer. In addition
we reword the explanatory text slightly to improve clarity further
Fixes: #1768
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
To make sure that people using editors which use rustfmt by default
on saving don't touch more lines than intended when working on the
rustup codebase, we'll take the hit to format it all once.
When the Rust CI is misconfigured, it is possible to produce a nightly
where `rustc` or `cargo` is not available. This makes the entire toolchain
unusable (for one day at least).
This PR tries to prevent the update operation from starting at all if
these essential components are missing, so the user would still have a
working though outdated toolchain.
Resolves#1297.
This commit edits tests to allow tests to run in parallel instead of taking
global locks. This works by avoiding `env::set_current_dir` and instead tracking
the current directory in the `Config` structure, where all child processes get
an updated cwd.
If RUSTUP_INIT_SKIP_PATH_CHECK is set to "yes", ignore the PATH checks
for rustc and cargo. The variable is set to "yes" by default in
clitools::env, and overriden in the relevant tests.
Fixes#681
* Rearranges error-checking in `install_from_dir` to pass the tests
`custom_invalid_names` and `custom_invalid_names_with_archive_dates`.
* Adds subdirectory `lib` to custom directories to pass the tests
`custom_toolchain_cargo_fallback_proxy` and
`custom_toolchain_cargo_fallback_run`.
* Changed `emptydir` to `customdir.join("custom-1") to avoid directory
structure error and pass `rustup_failed_search_path`.
RLS support
I think this is sufficient for basic support.
With this PR, rustup will create 'rls' proxies in CARGO_HOME/bin, and will do so lazily when that binary doesn't exist.
After this PR one can write
```
rustup component add rls
rustup component add rust-src
rustup component add rust-analysis
```
to get a working RLS, assuming the 'rls' package is deployed.
Next steps are to make `rustup component` accept multiple components, so RLS can be installed with just `rustup compnent add rls rust-src rust-analysis` (cc @durka).
I'd suggest that RLS have nice error handling for cases where rust-src and rust-analysis aren't available. It might suggest running the proper rustup commands.
rustup probably needs to emit a better error message when somebody tries to run `rls` without installing it. Since the proxy always exists, it will say something like "the binary 'rls' doesn't exist in toolchain X". It would be better for rustup to know which package contains 'rls' and say so.
cc @nrc @jonathandturner