rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.96k stars 12.79k forks source link

rustc/cargo not properly detecting the host #133204

Open ETJAKEOC opened 1 week ago

ETJAKEOC commented 1 week ago

I tried this command:

cargo fetch --verbose --target stable-x86_64-unknown-linux-gnu

I expected to see this happen: explanation

Rust to work properly

Instead, this happened: explanation

error: rustc -vV didn't have a line for host:, got:

rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1

RUST_BACKTRACE=1 cargo fetch --verbose --target stable-x86_64-unknown-linux-gnu
error: `rustc -vV` didn't have a line for `host:`, got:

For reference, I am trying to compile eza, the ls replacement. If there is any other information that I can provide or other commands that you would like me to run, please, let me know.

Urgau commented 1 week ago

stable-x86_64-unknown-linux-gnu is not a valid target name.

If you wanted to use stable, you should use +stable instead:

cargo +stable fetch --verbose --target x86_64-unknown-linux-gnu
saethlin commented 1 week ago

This is a common tripping point for new users (I definitely remember being annoyed by it), but I think it's caused by rustup not the compiler.