cask/upgrade: don't uninstall before upgrade#20814
Conversation
86cdd0b to
79c8f66
Compare
79c8f66 to
cb0d2cc
Compare
|
We will likely need a way to detect changes in artifacts between the old and new versions, and where there are changes remove the old. Otherwise we will end up with multiple versions of applications when paths change, or names change etc... |
|
I wonder if we do a straight comparison to see if any artifacts have changed, and if they have, we then go ahead with the uninstall as we historically have to ensure we clean up correctly? |
|
Nice idea @bevanjkay! The main problem I was worried about was ensuring that
I wonder if there's a programmatic way of us detecting this in CI? 🤔 |
We can do this by comparing the installed Caskfile with the one that is being upgraded to. It doesn't help for applications that are modified through We can either do a full uninstall during upgrade if artifacts change, or try to handle the ones that no longer exist specifically. |
Good idea. Another option is do the uninstall afterwards, something like:
|
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?This is an initial pass at trying to skip the
uninstallstep when runningbrew upgradeandbrew reinstall.I have also added a simple dsl
uninstall_on_upgrade!that would cause the uninstall to always run, for use in cases where it may be required.This is currently only accessible behind an ENV variable -
HOMEBREW_NO_UNINSTALL_ON_CASK_UPGRADE=1.I have tested this with simple applications so far and it seems to work ok, but have not completed any testing with
pkgorscriptinstallers yet.One blindside we may have here is that we do not test
brew upgradeon CI, which means any future issues would only be surfaced by users, unless we had a way of running the upgrade on PRs.