I'm on MacO Big Sur, just have the latest stable Rust installed via:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
No, I don't use Homebrew. Then I want to compile xv6-rust. It needs the nightly version, with extra component rust-src. I already switch to nightly:
$ rustc --version
rustc 1.60.0-nightly (777bb86bc 2022-01-20)
Now the problem is: how to install rust-src?
$ rustup component add rust-src
error: error: Found argument 'component' which wasn't expected, or isn't valid in this > context
USAGE: rustup-init [FLAGS] [OPTIONS]
rustup-initis the installer for Rustup itself -- it shouldn't be on your$PATH, or even really exist once you've installed Rustup. Perhaps you downloaded the installer script and added that to your path? The file you download fromsh.rustup.rsis an installer for Rustup, not Rustup itself.locate rust-init, seems like I forgot that rustup-init was already installed via homebrew. Then I uninstalled it:brew uninstall rustup-init. Another issue come, when runningrustup component add rust-srcagain, I got this: "zsh: command not found: rustup-init"alias rustup=rustup-init. I didn't exactly remember doing that. Or perhaps mixing manual installation with homebrew isn't always a good idea? Removed that line and now rustup works fine.