How do I upgrade my stable toolchain from amd64 → arm64?

I'm now on the latest MBP (…unfortunately?) That is, I've just upgraded to an arm64 arch machine.

I got rustup changed to the new arch by reinstalling it:

» file `which rustup`
~/.cargo/bin/rustup: Mach-O 64-bit executable arm64

However, while this looks right:

» file `which rustc`
~/.cargo/bin/rustc: Mach-O 64-bit executable arm64

I think I'm just looking at rustup's wrapper. rustup show says,

active toolchain
----------------

stable-x86_64-apple-darwin (default)

And the binaries I produce are still amd64 ones.

rustup toolchain update stable thinks the toolchain is up to date. I thought uninstalling & reinstalling it would do it,

» rustup uninstall stable
info: uninstalling toolchain 'stable-x86_64-apple-darwin'
info: toolchain 'stable-x86_64-apple-darwin' uninstalled
» rustup install stable
info: syncing channel updates for 'stable-x86_64-apple-darwin'
…

But nope.

TL,DR: rustup toolchain install stable-aarch64-apple-darwin followed by rustup default stable-aarch64-apple-darwin.

You can also change default_host_triple in ~/.rustup/settings.toml and then install stable again, or remove and reinstall rustup to have it re-detect the host triple from your environment.

3 Likes

Thank you! I think updating default_host_triple is probably the right route. I did that, re-installed stable, and I've got arm64 binaries now!