brew: Search does not suggest homebrew-cask formulae when untapped
brew config output
HOMEBREW_VERSION: 3.3.7
ORIGIN: https://github.com/Homebrew/brew
HEAD: dbec9de77ebc65a4845a5e672950219aa19b35b8
Last commit: 7 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9cec8a98224cf1cdfd1f21567306e83a86e096fb
Core tap last commit: 17 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 13.0.0 build 1300
Git: 2.30.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.0.1-arm64
CLT: 13.1.0.0.1.1633545042
Xcode: N/A
Rosetta 2: false
brew doctor output
Your system is ready to brew.
Verification
- I ran
brew updateand am still able to reproduce my issue. - I have resolved all warnings from
brew doctorand that did not fix my problem.
What were you trying to do (and why)?
On a fresh install, I was searching for the name of the iterm2 formula, so I ran brew search iterm2.
What happened (include all command output)?
dnw@192 ~ % brew search iterm2
==> Formulae
term
==> Casks
homebrew/cask-versions/iterm2-beta homebrew/cask-versions/iterm2-legacy homebrew/cask-versions/iterm2-nightly
What did you expect to happen?
I expected to see the regular iterm2 formula, but it wasn’t in the output.
Seeing the naming convention I gave brew install iterm2 a try, which forced the tap of homebrew-cask, where the iterm2 formula is:
dnw@192 ~ % brew install iterm2
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
brigade-cli
Running `brew update --preinstall`...
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 609514, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 609514 (delta 10), reused 19 (delta 7), pack-reused 609490
Receiving objects: 100% (609514/609514), 274.36 MiB | 6.91 MiB/s, done.
Resolving deltas: 100% (430989/430989), done.
Tapped 3938 casks (4,018 files, 293.9MB).
==> Downloading https://iterm2.com/downloads/stable/iTerm2-3_4_14.zip
######################################################################## 100.0%
==> Installing Cask iterm2
==> Moving App 'iTerm.app' to '/Applications/iTerm.app'
🍺 iterm2 was successfully installed!
Looking at brew tap I see that cask-versions isn’t tapped, so I don’t see why the cask-versions formulae are suggested but not the regular cask formulae. Is it because “iterm2” is the whole name?
Step-by-step reproduction instructions (by running brew commands)
Looks like I can reproduce it by reverting some effects:
dnw@192 ~ % brew uninstall iterm2
b==> Uninstalling Cask iterm2
==> Backing App 'iTerm.app' up to '/opt/homebrew/Caskroom/iterm2/3.4.14/iTerm.app'
r==> Removing App '/Applications/iTerm.app'
==> Purging files for version 3.4.14 of Cask iterm2
dnw@192 ~ % brew untap homebrew/cask
Untapping homebrew/cask...
Untapped 3938 casks (4,019 files, 293.9MB).
dnw@192 ~ % brew search iterm2
==> Formulae
term
==> Casks
homebrew/cask-versions/iterm2-beta homebrew/cask-versions/iterm2-legacy homebrew/cask-versions/iterm2-nightly
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 29 (22 by maintainers)
I just ran into this exact case when setting up a new mac. I was trying to install iTerm and I wasn’t sure of the name of the cask, so I tried
brew search --cask itermand got no results. There wasn’t even a==> Caskssection in the results. This issue appears to identify the core problem, which is that a fresh install does not provide the ability to search casks.I think that this conversation is getting overrun with comments about improving search functionality/performance, but that seems unrelated to this actual issue. This comment by @MikeMcQuaid seems to address the actual problem:
The main point here is that after you tap the casks repo, you have access to cask search, and at that point everything works just fine. Whether the search works or performs well seems like a separate conversation.
Back when casks were a separate domain, I think it made sense that you would have to manually tap the casks repo in order to access search. But now that casks are a first-class concept under the default commands, I think it’s a bit weird that a fresh install doesn’t come with the casks repo already tapped.
I am in favor of either:
brew search --cask)Gotcha. Yeh, we should probably either:
homebrew-caskcorrectlyor:
Since Algolia DocSearch is already providing best-in-class search results on https://formulae.brew.sh, why not simply use that instead?
Response:
Easily create a terminal searcher with fzf:
https://user-images.githubusercontent.com/44045911/159861748-f9b05f6f-a1c3-43fa-9fb4-020ae818e493.mov
Another option is we use something like the tree API instead: https://docs.github.com/en/rest/reference/git#get-a-tree https://api.github.com/repos/homebrew/homebrew-cask/git/trees/master?recursive=1
or the repo contents API: https://docs.github.com/en/rest/reference/repos#get-repository-content https://api.github.com/repos/homebrew/homebrew-cask/contents/Casks
Well, auto-tapping
homebrew-caskwould be another option.https://cs.github.com/Homebrew/homebrew-cask?q=cask works so it may be that this gets addressed in future. I don’t think we should rely on that to happen soon, though.
It was a fresh install.