#Rustup/Cargo fmt issue
15 messages · Page 1 of 1 (latest)
In a normal Rustup installation, there should be an ~/.cargo/bin/cargo-fmt, which is a hardlink to rustup itself (this is how rustup handles toolchain selection for all commands that come from a toolchain). It sounds like you're missing that.
So,
- check what files you have in
~/.cargo/binto see what the situation is - try reinstalling rustup, not toolchains
I don't have it, and uninstall/reinstalling rustup does not bring it (fedora)
oh, this is a distro-installed rustup?
run which rustup and which cargo to find out what you have via your PATH, and please show the list of files that are in ~/.cargo/bin (if anything)
$ which rustup
~/.cargo/bin/rustup
$ which cargo
~/.cargo/bin/cargo
ls ~/.cargo/bin
anchor cargo cargo-fuzz clippy-driver rls rustc rustfilt rust-gdbgui rustup spl-token
avm cargo-clippy cargo-miri ore rust-analyzer rustdoc rust-gdb rust-lldb sbjc
okay, so you have a non-distro, self-contained, rustup installed
if you had a distro rustup it would usually be in /usr/bin/rustup and not ~/.cargo/bin
try rustup self update, and if that doesn't help then rustup self uninstall and reinstall it from rust-lang.org
Try running rustup component add --toolchain <toolchain> rustfmt, with the toolchain that you're targeting.
Idk what is wrong with my setup, but
rustup self update
error: self-update is disabled for this build of rustup
error: you should probably use your system package manager to update rustup
also tried the component add, does not do anything
info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date
Looks like you have both the system package manager's and the self-contained rustup binaries installed somehow??
Try running rustup self uninstall, if that doesn't work try uninstalling through your package manager and then running the command again.
Really weird, I uninstalled fedora version, but still get same error when trying rustup self uninstall
I removed the ~/.cargo folder to start fresh, seems OK now
Thanks