Repository navigation
rustup component remove component-NOT-TOOLCHAIN-TARGET errors #3166
Description
Activity
hmm so I totally agree with the motivation here; a path to fixing it would be to parse the target from the output, and infer target when not supplied.
- changed the title
[-]`rustup components` should hint towards using `--target`[/-][+]rustup component remove component-NOT-NATIVE-TARGET errors[/+]on Feb 22, 2023 - changed the title
[-]rustup component remove component-NOT-NATIVE-TARGET errors[/-][+]rustup component remove component-NOT-TOOLCHAIN-TARGET errors[/+]on Feb 22, 2023 Is there a rule to infer the target from the list?
@rustbot claim
In the component remove function, it is supposed to handle
rust-docs-x86_64-apple-darwinthis case with function calledComponent::new_with_target. But in that function, it fails to identify the target fromrust-docs-x86_64-apple-darwinandrust-std-wasm32-unknown-unknown.home/bin/rustup component remove clippy rustfmt-x86_64-apple-darwin rust-docs-x86_64-apple-darwin rust-std-wasm32-unknown-unknownComponent { pkg: "clippy", target: Some(TargetTriple("x86_64-apple-darwin")), is_extension: true } "rustfmt" "x86_64-apple-darwin" "rustfmt" "x86_64-apple-darwin" PartialTargetTriple { arch: Some("x86_64"), os: Some("apple-darwin"), env: None } "rustfmt-x86_64" "apple-darwin" "rustfmt-x86_64" "apple-darwin" PartialTargetTriple { arch: None, os: Some("apple-darwin"), env: None } "rustfmt-x86_64-apple" "darwin" Component { pkg: "rustfmt-x86_64-apple-darwin", target: Some(TargetTriple("x86_64-apple-darwin")), is_extension: true } "rust" "docs-x86_64-apple-darwin" "rust-docs" "x86_64-apple-darwin" "rust-docs" "x86_64-apple-darwin" PartialTargetTriple { arch: Some("x86_64"), os: Some("apple-darwin"), env: None } "rust-docs-x86_64" "apple-darwin" "rust-docs-x86_64" "apple-darwin" PartialTargetTriple { arch: None, os: Some("apple-darwin"), env: None } "rust-docs-x86_64-apple" "darwin" Component { pkg: "rust-docs-x86_64-apple-darwin", target: Some(TargetTriple("x86_64-apple-darwin")), is_extension: true } "rust" "std-wasm32-unknown-unknown" "rust-std" "wasm32-unknown-unknown" "rust-std-wasm32" "unknown-unknown" "rust-std-wasm32-unknown" "unknown" Component { pkg: "rust-std-wasm32-unknown-unknown", target: Some(TargetTriple("x86_64-apple-darwin")), is_extension: true }Ran into the same thing; was very confused.
@kadiwa4 @cyqsimon A new beta release is available, would you mind trying it out?
Reacted by cyqsimon@kadiwa4 @cyqsimon A new beta release is available, would you mind trying it out?
All works as expected now as far as I can tell. Thank you for the great work!
Reacted by Kalle Wachsmuth and rami3lI saw the fix of this issue was added into milestone 1.27.1.
But I still met this bug with rustup 1.27.1.Execute:
rustup component remove llvm-tools-x86_64-unknown-linux-gnuOutput:
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'llvm-tools-x86_64-unknown-linux-gnu' for target 'x86_64-unknown-linux-gnu'But the following command works well:
rustup component remove --target x86_64-unknown-linux-gnu llvm-toolsI saw the fix of this issue was added into milestone 1.27.1. But I still met this bug with rustup 1.27.1.
Execute:
rustup component remove llvm-tools-x86_64-unknown-linux-gnuOutput:
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'llvm-tools-x86_64-unknown-linux-gnu' for target 'x86_64-unknown-linux-gnu'But the following command works well:
rustup component remove --target x86_64-unknown-linux-gnu llvm-tools@yangby-cryptape Your case is a bit particular since it's related to a renamed component (#3578). For the moment being,
llvm-tools-preview-x86_64-unknown-linux-gnuseems to work.I'll try to investigate further.
Reacted by Chaotic Longhair
Problem you are trying to solve
I ran
rustup component list --installedand saw that I had the componentrust-std-wasm32-unknown-unknowninstalled, which I wanted to delete. I thought that I could simply copy-paste the component name into theremovecommand like this:However, this doesn't work with
remove. I got the following unhelpful error message:(Also the last line doesn't make sense because I'm trying to uninstall something here, not install it.)
Solution you'd like
The command that actually works is:
I would like it if rustup told me that. You could assume that the component names which are output by
listcan also be passed back into rustup as a component name.Notes
Version 1.25.1