Getting a "last known" rustfmt

I'm getting this on one macOS system:

$ rustup component add rustfmt --toolchain nightly
error: component 'rustfmt' for target 'x86_64-apple-darwin' is unavailable for download for channel nightly
Sometimes not all components are available in any given nightly.

.. but on my other macOS systems running nightly rustfmt is installed. Though rustup update keeps saying that rustfmt-preview isn't available. I assume what is happening is that on the other systems it's just keeping the latest available "nightly" rustfmt, but on this system it was either never installed or it disappeared.

But given that the nightly rustfmt that is installed on the other systems has been working mostly very well for a while, I would like to install it on this system as well.

I'm wondering a few things related to this:

  • How would I go about finding out which the latest nightly rustfmt is? Is there some site that tracks which components have been packaged for nightly releases?
  • How would I go about finding out which specific version of nightly rustfmt I'm using on the other systems?
  • How would I go about installing an "old" very specific component version to my "nightly" toolchain (so I get the behavior of my other macOS systems (because I assume it'll pick up rustfmt component updates automatically once they begin being published again)).

This site tracks them all, and you can even pick a particular target you're interested in.

You can use rustc +nightly -V to get the date -- the trick is that rustup's idea of that date is usually one day ahead, since it captures the most recent build at 00:00:00 UTC. For example, I have rustc 1.49.0-nightly (ffa2e7ae8 2020-10-24), which is nightly-2020-10-25.

I don't know if there's a way to do this. You can rustup install nightly-2020-10-25, but that will give you a toolchain locked at that date, unlike the update-able nightly.

1 Like