Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries

Home Page:https://brew.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move default caskroom location

toonetown opened this issue · comments

Per the comment at https://github.com/caskroom/homebrew-cask/pull/13966/files/9664b9f3074e5b7fef70779259fa91f5d87962e0#r65376061 - it might be good to consider moving caskroom to $(brew --prefix)/Caskroom since the main reason for leaving it within /opt was to improve spotlight integration. Now that applications are actually moved instead of linked, and with more and more homebrew integration, perhaps now is a good time to discuss moving the default location to be more "brew-like"?

To reiterate, /opt is actually the correct directory, but setting that aside, I’m actually in favour of this change (though not too strongly) for two main reasons.

Not only are we more integrated with homebrew and that integration will only become more prevalent, it will save us from having to ask for a password on first install.

I ask users/maintainers to make use of the thumbs up/down on the top post to voice your opinion (for easy counting), even if you explain it at length is a post.

Pinging @caskroom/maintainers and @MikeMcQuaid on this discussion.

While /opt is listed as the standard location for add-on applications, that's not really where they're being installed...now that artifacts are being moved, they are being installed in /Applications. The stuff that's left over in /opt/homebrew-cask is really more /var-like data (metadata, etc).

Also - OS X doesn't particularly follow the Filesystem Hierarchy Standard 100% anyway - /Users instead of /home, /System instead of /boot, /Volumes instead of /mnt, /Library instead of /etc (or /var or /lib), etc.

I'm not saying that it HAS to be this way - or that /opt isn't the correct directory, but I just thought I'd add those observations to this discussion too.

@toonetown You have a very valid point.

Thanks for the CC @vitorgalvao! I think the lack of sudo would be the main advantage here. For what it's worth at some point in the future Homebrew may consider moving its default prefix away from /usr/local but at least this move would mean that Homebrew cask /could/ live somewhere else. It also means as the projects get closer together you could have separate Caskrooms for each Homebrew install which may be useful.

have separate Caskrooms for each Homebrew install

You’re right, hadn’t thought of that. I can see a subset of users really adhering to this (possibly the same users that like ~/Applications).

The thing is, people who are not sudoers already go to incredible lengths to install Homebrew under their home directories (which in itself already makes for a horrible first user experience). 1

In my opinion it is our duty to put UX, especially the first set-up experience, on top of everything else, including standards already diluted by everyone else (as pointed out correctly by @toonetown). I believe the first-time-tapping-into-HBC experience needs to be as seamless as possible. With this in mind, putting Caskrooms under $(brew --prefix) feels like the right thing to me.

[1] In fact, last time I was forced to apply this hack was yesterday! I was at the Apple Store, waiting for my MBP display to be replaced (long story short, I had kicked my computer out of my bed the night before while I was asleep). Trying to kill time, I ended up using one of the MacBooks that were on display to give one of the sales employees a Homebrew Cask 101. He had no admin rights so we had to resort to those workarounds mentioned above, which was an epic hassle.
It still paid off in the end – if only for the priceless look on his face when I said »Name an app« and he replied »Umm … Malwarebytes?« and I was like brew cask install malwarebytes-anti-malware and he went to full amazed mode: »I mean, this is just … you could actually do scripted installations with this!«

@claui Love the anecdote! 😃

Doesn't look like there's any opposition to the idea - marking it as "ready to implement", but of course feel free to chime in with more discussion.

+1 for moving caskroom to $(brew --prefix)

Same thoughts as @toonetown - this is now metadata that makes sense to keep together with homebrew. Also for the items I add to /opt myself I use very short names, so "homebrew-cask" sticks out a bit much and will be nicely hidden away in /usr/local/Caskroom :).

PR ready at #21857.