Update installed caskfiles of modified casks.#4730
Update installed caskfiles of modified casks.#4730reitermarkus wants to merge 1 commit intoHomebrew:masterfrom
Conversation
| next unless current_version == installed_version | ||
| next if current_caskfile.sha256 == installed_caskfile.sha256 | ||
|
|
||
| installed_caskfile.atomic_write File.read(current_caskfile) |
There was a problem hiding this comment.
Should handle if the write (or perhaps even read) fails here.
|
What's the overhead on doing this on every |
|
Big thumbs up to this. Not only will it fix issues with uninstalls, it should help prevent problems like the |
It won't prevent that because if the |
On the HBC repos, it’s customary that when we introduce a change like the |
Even when you do that: it's still a problem. If you're relying on having ambiguously old Cask files which use Homebrew APIs on them: eventually some of those APIs will be deprecated, disabled and removed and you'll have the same problem again. Assuming that the current version of Cask has infinite backwards compatibility is the root issue here. |
|
@MikeMcQuaid I agree. I think this change will help prevent those problems, but not outright fix them. With this change in place, your previous suggestion will work even better, since the problems @commitay was envisioning have a lower change of happening. |
|
Yes, I am aware that this won't fix the problem. There really isn't a fix for this, other than never deprecating anything. However, this will prevent deprecation errors for people who run Even I had one cask still using |
I disagree. Several options off the top of my head:
|
|
|
@commitay I replied to that comment there. Can you be more explicit on what you're trying to say rather than just dropping a single link to a comment you'd made previously? Would you care to address any of my other options? To be more explicit on my viewpoint: no-one except me seems to be suggesting solutions to this problem which will not recur next time we remove formerly deprecated then disabled Homebrew APIs. Homebrew formulae have solutions to this problem. I'm not pretending I have all the answers but the current situation of "it'll happen again and there's nothing we can do about it" is defeatist and makes it hard for us to remove any APIs in future. |
A bunch of casks have changes that make this impractical. E.g., software that was a
Worse experience for the user, but I’m not opposed to it. We’d need to document why this happens and explain how to uninstall manually, but it might work.
Impractical if the deprecation is on a part needed for the uninstall.
I like this idea. |
I think it's a better experience than the current situation of an unhandled but expected error.
Yep but it still reduces the "surface" somewhat.
🎉 |
Those are not fixes, those are fallbacks.
This sounds good in theory, but I'm not sure if this isn't just shifting the problem elsewhere and additionally making the uninstall less flexible. |
Indeed but they are an improvement on the current situation of a known, unhandled exception.
It will make uninstall less flexible but it's not going to increase the surface area of problems. In the |
|
@commitay noted in https://github.com/Homebrew/brew/pull/5174/files#r227706037 that this is blocking the removal of Cask DSL (and, more generally, compatibility code in Homebrew/brew). When it gets to Homebrew 2.0.0 (the next major release expected after 1.9.0) around February if we don't have a solution here we just need to remove these DSL regardless. |
|
@Homebrew/cask any thoughts or updates on this? Please note as above these DSLs will be removed in Homebrew 2.0 around February regardless of a PR like this being merged. |
|
I’m still fine with the idea behind this. |
|
This PR will be closed by #5598 when 2.0.0 is due to be released soon afterwards. |
brew stylewith your changes locally?brew testswith your changes locally?Often casks get updated without a version bump to fix a broken
uninstallor add something tozap. This replaces the installed caskfile if it differs from the current one and the version hasn't changed.