Rustup: Feature Request: rustup revert

Created on 28 Feb 2018  路  11Comments  路  Source: rust-lang/rustup

When using nightly occasionally updating to a new nightly will cause breakage of things. This then means you need to spend the time finding the last known date it worked with, which depending on how often you update could be a week or month ago when it last worked, then install that specific version and override the directory with the working version.

It would be nice from a usability standpoint to be able to just run a simple command to set the nightly to the last known working version installed on the computer.

Most helpful comment

It would already help a lot if rustup update would also show the old version that it is replacing in addition to the information about the new version it is currently installing. That way it would be way easier to perform a manual rollback.

All 11 comments

I am against that, that adds too much complexity for such a small benefit.That mean we would have to store the history, figure out what previosu toolchain means, define the behavior of doing revert several time in a row, define the behavior of what happened when the previous toolchain has been uninstalled, etc... Sounds like a can of worms.
Knowing that doing a revert manually is trivial (change default then uninstall)...

@nrc What do you think? Close?

It does sound useful to have some kind of undo facility. At least keeping a log of the exact versions installed would be useful and allow doing manual reverts. I think adding an automatic revert on top of that would be fairly straightforward. In any case there seems something worth investigating here.

@mgattozzi To be honest, I have just came to realize what you meant with @nrc comment "keeping a log of the exact versions installed". I very rarely update my nightly, never had to revert it and forgot that updating your nightly was loosing track of the previous one.

I will try to make a PR for a version log. Obviously you will still be have to install the old version and override your nightly.
I think there's a lot of room for improvement with rustup and I am working on putting my thoughts into a well defined "spec", so personally I won't work on changing the CLI API right now.

We don't need an entire lifetime log, being able to revert to the previous version would be great! I've broken my diesel rocket with 1.29.0-nightly (2018-07-17) and would love to just type "rustup revert".

It would already help a lot if rustup update would also show the old version that it is replacing in addition to the information about the new version it is currently installing. That way it would be way easier to perform a manual rollback.

Has there been any work on a revert or history feature? Would be great to see what the last installed nightly is when a new nightly is inevitably broken.

There has been no work on anything like this in the past year, no. However current Rustup will tell you what the version was, when it completes an update, so you could make a note if you're worried about nightly breaking your stuff and then you could reinstall a specific nightly if you really need to.

Modifying the output to show the old version and the new version should be pretty easy and would make the ergonomics better.

I think that would be captured in a log automatically. Building a richer thing as mentioned would be more work.

Actually, its likely that the version that was previously installed is in a previous log entry somewhere already already.

There's no official long-held log of rustup actions at this time. Only if you happen to log your console would you have the update logged.

The change I mentioned which is in current rustup is at https://github.com/rust-lang/rustup/commit/8a0b4aeaaa5c93f97f1127ace84ba44cb0985c42 if you want to look at the output format it produces.

Oh I missed that that was already in there. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcandre picture mcandre  路  4Comments

durka picture durka  路  3Comments

fenhl picture fenhl  路  4Comments

netgusto picture netgusto  路  4Comments

Stargateur picture Stargateur  路  3Comments