Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Remove cask install #22

Closed

Conversation

chrisconley
Copy link

Homebrew-cask has been moved into homebrew proper. This PR removes the installation of the legacy caskroom/cask/brew-cask package.

It also configures /Library/Caches/Homebrew/Casks to have owner node['sprout']['user'] since cask installations will fail to copy cached packages into this directory if left with owner as root.

@wendorf
Copy link
Member

wendorf commented Jan 7, 2016

Hi @chrisconley,

Thanks for the PR! I'm concerned this will be an awkward change for users who have installed homebrew prior to the change and aren't in the habit of updating. I wonder if it's valuable to update this PR to warn users who have brew-cask installed (though this warning will probably be lost in the slew of sprout output), or fail the recipe of brew-cask is installed, giving an error along the lines of "Error: brew-cask is installed, but has been moved into homebrew proper. Please uninstall brew-cask and update homebrew to resolve this error: brew uninstall --force brew-cask; brew update".

Thoughts? If it sound reasonable, can you update the PR?

Thanks,
Dan

@kigster
Copy link

kigster commented Jan 11, 2016

Hey there, I just bumped into this problem tonight, and it's preventing me from having soloist in sprout-wrap repo to run – it breaks when it tries to install any cask (on a completely fresh install of brew). This broke literally within the last few days. I was going to submit my own pull request by removing recipes/default/cask.rb, but then I stumbled upon this discussion.

@wendorf – please help me understand what is going on. I think we might end up with just three situations:

1. Older Brew, No Casks Installed

A user of this cookbook that has an older brew installed (in my case it was revision 78203f9c, a few weeks prior – just before installing brew-cask started throwing an error) will get the following when they try to install brew-cask:

 [~] ○ → brew install caskroom/cask/brew-cask
.......
==> Checking out tag v0.60.0
==> Caveats
You can uninstall this formula as `brew tap Caskroom/cask` is now all that's
needed to install Homebrew Cask and keep it up to date.
==> Summary
🍺  /usr/local/Cellar/brew-cask/0.60.0: 3 files, 12K, built in 5 seconds

This command, I believe, succeeds, and therefore the cookbook would still work.

2. Most Recent/Updated Brew

A user that has updated their brew will see the following:

 [~] ○ → brew update
Updated Homebrew from 78203f9c to c156facd.
Updated 4 taps (caskroom/cask, homebrew/dupes, homebrew/versions, phinze/cask).
Error: Could not link phinze/cask manpages to:
  /usr/local/share/man/man1/brew-cask.1
Please delete these files and run `brew tap --repair`.

After running brew update, if I try to install brew-cask, I get an actual error:

 [~] ○ → brew install caskroom/cask/brew-cask
==> Installing brew-cask from caskroom/cask
==> Cloning https://github.com/caskroom/homebrew-cask.git
Updating /Library/Caches/Homebrew/brew-cask--git
==> Checking out tag v0.60.0
Error: Empty installation

 [~] ○ → echo $?
1

This is what is actually breaking this cookbook completely for anyone with a newer brew.

3. Older Brew, but Casks Installed

Now, for anyone with an older brew, but who installed any cask ever, and assuming I am reading this PR correctly, everything would still work, and they would be able to install new casks (bypassing brew install caskroom/cask/brew-cask as defined in cask.rb

In the very unlikely chance that they have used brew, have not yet updated, but have also never ever installed any casks, I think that this PR may prevent them from installing further additional casks until they update their brew, right?

Conclusions

So what's the way to fix that? Can we check the version of brew, and fork the logic based on older or newer brew? For newer brew it can run brew tap Caskroom/cask as advised, and for older – the original command?

I'll use the fork's URL for the time being, but I would love to see any solution to appear on the master shortly. Let's discuss the best way to fix it and push it up.

Thanks!

@wendorf
Copy link
Member

wendorf commented Jan 16, 2016

@kigster Thanks for all your thoughts on this!

I feel a little uncomfortable having branching logic for people with older versions of brew. Sprout has traditionally not done much to support cases where updating isn't desired, since there's an overhead for us to maintain recipes.

I'd feel better if we just detect the broken config (e.g. you have the brew-cask recipe installed) and throw an error, letting the user resolve the issue.

@wendorf
Copy link
Member

wendorf commented Feb 14, 2016

I ended up removing most of the recipes in this cookbook now that the homebrew does a better job. If anyone is still having issues with cask, please see the sprout-homebrew README for migration instructions, and manually run brew uninstall --force brew-cask; brew update to cleanup old brew-cask installations.

@wendorf wendorf closed this Feb 14, 2016
@kigster
Copy link

kigster commented Feb 20, 2016

Thanks! @wendorf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants