hashicorp / homebrew-tap

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

vagrant: fix for errors on macOS #252

Closed EricFromCanada closed 2 months ago

EricFromCanada commented 11 months ago

Gating the URL behind an if statement causes errors on any macOS Homebrew installation that uses this tap. Instead, use depends_on to ensure only Linux on Intel can install it.

For example:

$ brew readall hashicorp/tap
Error: Invalid formula (sonoma): /usr/local/Homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/vagrant.rb
formulae require at least a URL
Error: Invalid formula (arm64_sonoma): /usr/local/Homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/vagrant.rb
formulae require at least a URL
Error: Invalid formula (ventura): /usr/local/Homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/vagrant.rb
formulae require at least a URL
Error: Invalid formula (arm64_ventura): /usr/local/Homebrew/Library/Taps/hashicorp/homebrew-tap/Formula/vagrant.rb
formulae require at least a URL
…
hashicorp-cla commented 11 months ago

CLA assistant check
All committers have signed the CLA.

baodrate commented 9 months ago

Could we get some eyes on this? (@modrake? @sarahethompson?) This issue is quite painful for certain homebrew setups/flows (e.g. w/ https://github.com/rcmdnk/homebrew-file)

EricFromCanada commented 2 months ago

Rebased on current master. (@modrake @sarahethompson @dekimsey)

dekimsey commented 2 months ago

👋, this is interesting thank you for bringing it our attention! I'm going to loop someone in here as this correction actually needs to be performed in our template code so it sticks upon the next release and then the existing formulas regenerated.

Let me get some eyes on this, thank you again!

EricFromCanada commented 2 months ago

In that case, the template should be adjusted to use on_system blocks instead of if statements, and if only one OS and arch is supported, place the URL at the top level and use depends_on to limit where it can be installed. Good luck!

baodrate commented 2 days ago

I believe this issue is still relevant?

EricFromCanada commented 2 days ago

The original problem still exists, but the proper fix is to adjust the template that generates the formula file in question, which is better handled by this repository's maintainers.