Skip to content
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

Don't abort entire brew cask upgrade if one cask fails #5203

Closed
Amorymeltzer opened this issue Oct 28, 2018 · 16 comments
Closed

Don't abort entire brew cask upgrade if one cask fails #5203

Amorymeltzer opened this issue Oct 28, 2018 · 16 comments
Labels
cask Homebrew Cask features New features outdated PR was locked due to age

Comments

@Amorymeltzer
Copy link
Contributor

Right now, if you run brew cask upgrade and one of your casks fails (e.g., the depends_on macos stanza), two things happen:

  1. You get the correct message (e.g. Error: Cask cask_name depends on macOS release..., Error: Checksum for Cask 'superduper' does not match, Error: Download failed on Cask cask_name..., etc.)
  2. brew cask upgrade stops

brew cask thus won't ever upgrade any casks coming alphabetically after the failing cask. While most issues should be fixable, if there is a macOS dependency issue, there's nothing to "fix" outside of updating to the latest macOS: a cask depending on mojave will obstruct high_sierra users, despite homebrew-cask officially supporting the two latest macOS point releases.

One workaround is to manually parse out each cask by piping brew cask outdated through grep -v and then into brew cask upgrade; this should work but is repetitive and obviously not ideal or easily scalable. Another is to remove the relevant files from the caskroom and stop using brew-cask for the application(s) in question; likewise, this isn't ideal.

Expected behavior would be for installer to raise the error as appropriate but for upgrade to rescue and continue with any remaining casks. This would match what brew does after #3644 and I believe is essentially what @ilovezfs suggested should be the default behavior in #3634 (comment).

@MikeMcQuaid MikeMcQuaid added the cask Homebrew Cask label Oct 29, 2018
@reitermarkus
Copy link
Member

No objections from me.

@stale
Copy link

stale bot commented Nov 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Nov 20, 2018
@issmirnov
Copy link

Stale bot, keep this open!

@stale stale bot removed the stale No recent activity label Nov 21, 2018
@stale
Copy link

stale bot commented Dec 12, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Dec 12, 2018
@jonchang jonchang added help wanted We want help addressing this and removed stale No recent activity labels Dec 14, 2018
@MikeMcQuaid MikeMcQuaid added features New features and removed help wanted We want help addressing this labels Dec 21, 2018
@ascheman
Copy link

ascheman commented Jan 5, 2019

I have the same problem und would like to upvote the issue.

@MikeMcQuaid
Copy link
Member

@ascheman Please 👍 in future instead, thanks.

@stale
Copy link

stale bot commented Feb 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Feb 7, 2019
@issmirnov
Copy link

Stale bot, keep this open!

@stale stale bot removed the stale No recent activity label Feb 7, 2019
@tls11
Copy link

tls11 commented Feb 11, 2019

keep it open!

@stale
Copy link

stale bot commented Mar 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Mar 4, 2019
@ascheman
Copy link

ascheman commented Mar 4, 2019

keep it open!

@stale stale bot removed the stale No recent activity label Mar 4, 2019
@jonchang jonchang added help wanted We want help addressing this and removed help wanted We want help addressing this labels Mar 6, 2019
@jonchang
Copy link
Contributor

jonchang commented Mar 6, 2019

If you are interested in adding this feature, feel free to submit it as a pull request and a maintainer will review it. Even a partial implementation is fine since we can help you work through the rest of it. "Upvoting" an issue or keeping it open doesn't help since no maintainer is currently working on this feature.

@issmirnov
Copy link

I did a bit of digging, but don't have time right now to finish a fix. Adding code pointers to any others who are open to picking this up.

General thoughts:

  • IMO best option would be to collect various errors rather than immediately throwing them up to the caller. This will allow the cask upgrade to finish, and the notify the user of any problems.
  • Caveats to the above are where casks depend on each other and the dependency is broken, since then it would be ideal to intelligently abort the attempted upgrade only for the child casks.

Hope this helps other fellow hackers.

@stale stale bot added the stale No recent activity label Apr 6, 2019
@vitorgalvao
Copy link
Member

#5983

@stale stale bot removed the stale No recent activity label Apr 6, 2019
@Homebrew Homebrew deleted a comment from stale bot Apr 6, 2019
zachauten added a commit to zachauten/brew that referenced this issue Apr 12, 2019
'cask upgrade' command collects all exceptions thrown
from individual casks during the upgrade process. If
there were more than one cask that raised exceptions
during the upgrade process, a MultipleCaskErrors
exception will be thrown.

Issue Homebrew#5203
@amyspark
Copy link
Contributor

Wasn't this fixed by #5983 ?

@MikeMcQuaid
Copy link
Member

Yes, it was. Good spot @amyspark and thanks again @zachauten!

@lock lock bot added the outdated PR was locked due to age label May 22, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cask Homebrew Cask features New features outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

9 participants