hashicorp / homebrew-tap

Homebrew Tap of HashiCorp products and tools
Mozilla Public License 2.0
129 stars 55 forks source link

brew search return "Error: formulae require at least a URL" #267

Open rdndnl opened 6 months ago

rdndnl commented 6 months ago
➜  ~ brew config
HOMEBREW_VERSION: 4.2.8
ORIGIN: https://github.com/Homebrew/brew
HEAD: eb7338abba43112e16e178d4329d5483d6d8fd6f
Last commit: 5 days ago
Core tap JSON: 17 Feb 12:44 UTC
Core cask tap JSON: 17 Feb 12:44 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.QYEMEV6KBu/org.xquartz:0
HOMEBREW_EDITOR: vi
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.43.2 => /opt/homebrew/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.3.1-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: 15.1
Rosetta 2: false

After "hashicorp/tap/vault" installation, searching formulas for text with "--eval-all" or HOMEBREW_EVAL_ALL set return the following error:

➜  ~ brew search --desc --eval-all something
==> Formulae
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaAPILoader): loading a2ps from API
...
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /opt/homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/vagrant.rb
Error: formulae require at least a URL
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/opt/homebrew/Library/Homebrew/formula.rb:307:in `determine_active_spec'
/opt/homebrew/Library/Homebrew/formula.rb:238:in `initialize'
/opt/homebrew/Library/Homebrew/formulary.rb:503:in `new'
/opt/homebrew/Library/Homebrew/formulary.rb:503:in `get_formula'
/opt/homebrew/Library/Homebrew/formulary.rb:745:in `factory'
/opt/homebrew/Library/Homebrew/formula.rb:1930:in `block in all'
/opt/homebrew/Library/Homebrew/formula.rb:1929:in `map'
/opt/homebrew/Library/Homebrew/formula.rb:1929:in `all'
/opt/homebrew/Library/Homebrew/description_cache_store.rb:37:in `populate_if_empty!'
/opt/homebrew/Library/Homebrew/descriptions.rb:14:in `search'
/opt/homebrew/Library/Homebrew/search.rb:29:in `block in search_descriptions'
/opt/homebrew/Library/Homebrew/cache_store.rb:26:in `use'
/opt/homebrew/Library/Homebrew/search.rb:27:in `search_descriptions'
/opt/homebrew/Library/Homebrew/cmd/desc.rb:71:in `desc'
/opt/homebrew/Library/Homebrew/brew.rb:86:in `<main>'

The last formula in the debug output before the error was "homebrew-tap/Formula/vagrant.rb", so I guessed brew was unable to obtain the "url" because an "if OS.mac?" case is missing. I don't know if it is the right guess, however brew search started work correctly after I added a fake "if OS.mac?" condition.