-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a reinstall command #244
Comments
Good feature. I like the idea of transactional reinstalls. |
I started looking into this, unfortunately it doesn't look like transactional properties can be achieved without some support from the plugins. While many of them are simple (download + extract) and this could be done by installing into temp dir, then uninstalling the old one, then moving the temp location into place, there are plugins like clojure which injects the install dir location into some installed scripts (so moving it after installation will make them invalid). Also a lot of plugins use upstream installers or |
I wonder if we could work around this issue by doing something like this:
Would that work? And if so do you think we will run into any problems with this approach? Thanks for taking the time to look into this! |
I had to reinstall erlang after installing a few dependencies to compile it again and I can say that at least asdf-erlang wouldn't work this way, as it keeps its own record of which version is installed, so moving the install directory doesn't work. (Tried on Archlinux). I saw there are some plugin-test, maybe it would be interesting to add some tests for this feature before shipping it, so those plugins have the time to adapt ? |
@Aethelflaed I don't think the erlang plugin should be keeping a record of which versions of Erlang it installed. It uses kerl underneath, and kerl does typically keep records, but I think we altered it such that asdf-erlang doesn't rely on that behavior. If not we may need to change it. Generally plugins should not be keeping track of installed plugins on their own. I'd like to do this without changing the plugins at all if possible. We may have to update a few plugins so they will work properly however. |
#1546 is a very naive implementation (is WIP and am more than happy to change) that simply installs, even if the install directory currently exists. |
I like an approach of:
This is similar to the third approach mentioned above, except that that there is a final move instead of a final copy. I'm not a fan of the second approach because if we try to reinstall a tool where there's already directories and stuff existing, there likely will be failures since it's difficult to write fully idempotent installation scripts. |
If anyone is looking for a quick way to do this without fundamentally changing
This would do a reinstall on all versions of the $PLUGIN. Had to do this today to deal with the GPG signing key change for Terraform. 😅 |
Sometimes, especially during development and troubleshooting, it would be nice to be able to reinstall a version in a similar manner to Homebrew. In its primitive form, it could be just
uninstall
andinstall
chain, but take further, it could be done transactionally, too, i.e. a failure to install won't remove the previous instance.The text was updated successfully, but these errors were encountered: