-
Notifications
You must be signed in to change notification settings - Fork 893
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
rust-src component installed by rustup component add
not seen by rustup toolchain install ... --component
.
#2601
Comments
Okay that's an interesting set of behaviours for me to puzzle over |
Okay found the cause,
|
EDIT: it's actually broken both ways, I just wasn't testing enough sequences of commands, see #2601 (comment). |
Yes, there's definitely something up with how we're resolving the architecture there. rust-src is unusual in that it's an all-arch component whereas the others are per-arch. |
Looks like the other way around is broken too, sorry! $ rustup component remove --toolchain nightly rust-src
info: removing component 'rust-src'
$ rustup toolchain install nightly --component rust-src
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-12-09, rust version 1.50.0-nightly (1700ca07c 2020-12-08)
info: downloading component 'rust-src'
info: installing component 'rust-src'
nightly-x86_64-unknown-linux-gnu updated - rustc 1.50.0-nightly (1700ca07c 2020-12-08) (from rustc 1.50.0-nightly (1700ca07c 2020-12-08))
$ rustup component add --toolchain nightly rust-src
info: downloading component 'rust-src'
info: downloading component 'rust-src'
info: removing component 'rust-src'
info: installing component 'rust-src'
info: installing component 'rust-src'
info: rolling back changes
error: could not rename component file from '/home/eddy/.rustup/tmp/9u3gxcem2es8sx16_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src'
error: could not rename component file from '/home/eddy/.rustup/tmp/zc8eo__o5fcn9_ob_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust'
error: could not rename component file from '/home/eddy/.rustup/tmp/55kylnxpm88kdx2h_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library'
error: could not rename component file from '/home/eddy/.rustup/tmp/ejy16mvpbilnbe6b_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch'
...
error: could not rename component file from '/home/eddy/.rustup/tmp/21mib900f87c1u92_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/profiler_builtins'
error: could not rename component file from '/home/eddy/.rustup/tmp/m6_5dgv9_ung340j_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/rustc-std-workspace-core'
error: could not rename component file from '/home/eddy/.rustup/tmp/slzyjt969y1rk1wq_dir/bk' to '/home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/term/src/terminfo/parser'
error: failed to install component: 'rust-src', detected conflict: '"lib/rustlib/src/rust/Cargo.lock"' (it lists with every single one of the 152 directories/files in the component, spamming my terminal) For whatever reason, specifying $ rustup component add --toolchain nightly rust-std rust-src
info: component 'rust-std' for target 'x86_64-unknown-linux-gnu' is up to date
info: downloading component 'rust-src'
info: removing component 'rust-src'
info: installing component 'rust-src'
info: component 'rust-src' is up to date And the resulting |
Ah, looking at at the CHANGELOG entry for EDIT: wait, I'm on |
It'd be worth double-checking, but I don't think I did much in the way of altering the deduplication inputs to toolchain installation. When we attempt to "install" an already installed toolchain we have to look at the requested components and deduplicate against the installed components. I wonder if we're failing to do that correctly for |
Testing with below [toolchain]
channel = "nightly"
components = [ "rust-src" ] |
Heh, RLS (or rather, the VSCode extension) plays well with the TOML
That is, |
Thank you for the updates. I intend to have a go at bottoming this out this week. |
Sometimes someone might choose an additional component to add during an install/update which is wildcarded. We need to ensure that we detect this and request the install with the wildcard otherwise we can hit situations such as that identified in rust-lang#2601 Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
I would expect
rustup toolchain install ... --component rust-src
to do nothing whenrust-src
is already installed.But if it installed through
rustup component add rust-src
, it tries installing again (and fails due to conflicting with itself):rust-src
)We've hit this in the wild because the Rust (RLS) VSCode extension uses
rustup component add ...
to install components, whereas in Rust-GPU we userustup toolchain install ... --component ...
to install components.Attempting to reproduce this was really difficult without doing a bunch of reinstalls from scratch, it seems that
rustup
auto-corrects for some incorrect state on its own sometimes, for example I got a very weird result from running this twice:Which I was able to reproduce on top of the above "setup", like this:
EDIT: forgot to mention that the version is
rustup 1.21.1
The text was updated successfully, but these errors were encountered: