Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brew tap is broken on arm-based macs #199

Closed
jamesknelson opened this issue Nov 1, 2021 · 4 comments
Closed

Brew tap is broken on arm-based macs #199

jamesknelson opened this issue Nov 1, 2021 · 4 comments

Comments

@jamesknelson
Copy link

Description

On arm-based macs, when attempting to install via brew install roots/tap/trellis-cli, installation fails:

==> Tapping roots/tap
Cloning into '/opt/homebrew/Library/Taps/roots/homebrew-tap'...
remote: Enumerating objects: 93, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 93 (delta 0), reused 0 (delta 0), pack-reused 89
Receiving objects: 100% (93/93), 11.70 KiB | 2.93 MiB/s, done.
Resolving deltas: 100% (21/21), done.
Error: Invalid formula: /opt/homebrew/Library/Taps/roots/homebrew-tap/Formula/trellis-cli.rb
formulae require at least a URL
Error: Cannot tap roots/tap: invalid syntax in tap!

It looks like this is due to the tap code generated by goreleaser, which checks if the CPU is an intel-based CPU, and if not, skips installation. See https://github.com/roots/homebrew-tap/blob/master/Formula/trellis-cli.rb#L11:

  on_macos do
    if Hardware::CPU.intel?
      url "https://github.com/roots/trellis-cli/releases/download/v1.0.0/trellis_1.0.0_Darwin_x86_64.tar.gz"
      sha256 "e8ce7454201f5b5305ec7e58a2dcd2fe447d1c07808e70fb88fa57f5fc9701b0"

      def install
        bin.install "trellis"
      end
    end
  end

Versions

v1.0.0

Additional information

As arm-based macs can run intel binaries, this could be fixed by simply removing the if statement in the tap code. However, as it is generated by goreleaser, I'm not sure if this is possible. I've taken a look at the goreleaser brew configuration, but couldn't find a simple fix.

Perhaps it would be possible to provide an ARM binary?

@swalkinshaw
Copy link
Member

I think #200 should do it? Assuming that works, I'll try and it to the latest release.

Thanks for bringing this up!

@swalkinshaw
Copy link
Member

It works, just need to figure out how to get it to re-publish the assets.

@swalkinshaw
Copy link
Member

Well that was fun 😅 this exposed a few problems with our release process but it's all fixed now 🎉

Check out https://github.com/roots/homebrew-tap/blob/master/Formula/trellis-cli.rb#L11 + there's ARM versions attached to the GH release. I assume this should all be working.

@jamesknelson
Copy link
Author

Thanks, the install is working great now! I'm still running into some issues with Trellis and my M1 Mac Mini. Will move discussion to roots/trellis#1253 if I can't resolve them.

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

No branches or pull requests

2 participants