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

Not having an ARM files makes brew formula un-tappable on ARM machines #1804

Closed
gssbzn opened this issue Sep 14, 2020 · 6 comments
Closed

Not having an ARM files makes brew formula un-tappable on ARM machines #1804

gssbzn opened this issue Sep 14, 2020 · 6 comments
Labels
bug Something isn't working hacktoberfest help wanted Extra attention is needed

Comments

@gssbzn
Copy link

gssbzn commented Sep 14, 2020

Describe the bug

Currently we got a report where not having an ARM url for one of our formulas makes the whole tap error

The generated formula can be seen here

To Reproduce

Users are doing brew tap mongodb/brew and getting:

Invalid formula <formula path>
Formulae require at least a URL

Cannot tap mongodb/brew
before:
  hooks:
    - go mod tidy

builds:
  - <<: &build_defaults
      main: ./cmd/mongocli/mongocli.go
      ldflags:
        - -s -w -X github.com/mongodb/mongocli/internal/version.Version={{.Version}}
    id: macos
    goos: [darwin]
    goarch: [amd64]
    hooks:
      post: gon -log-level=error gon.json
  - <<: *build_defaults
    id: linux
    goos: [linux]
    goarch: [amd64]
  - <<: *build_defaults
    id: windows
    goos: [windows]
    goarch: [amd64]
archives:
- id: linux
  builds: [linux]
  <<: &archive_defaults
    files:
      - README.md
      - LICENSE
      - third_party_notices/**/*
    replacements:
      darwin: macos
      amd64: x86_64
  wrap_in_directory: true
  format: tar.gz
- id: macos
  builds: [macos]
  <<: *archive_defaults
  format: zip
  wrap_in_directory: false
- id: windows
  builds: [windows]
  <<: *archive_defaults
  wrap_in_directory: false
  format: zip
brews:
- name: mongocli
  ids: [macos,linux]
  tap:
    owner: mongodb
    name: homebrew-brew
  folder: Formula
  skip_upload: auto
  description: The MongoDB Command Line Interface (mongocli) is a tool for managing your MongoDB cloud services, like MongoDB Atlas, MongoDB Cloud Manager, and MongoDB Ops Manager.
  homepage: https://github.com/mongodb/mongocli
  install: |
    bin.install "mongocli"
    (bash_completion/"mongocli.sh").write `#{bin}/mongocli completion bash`
    (zsh_completion/"_mongocli").write `#{bin}/mongocli completion zsh`
    (fish_completion/"mongocli.fish").write `#{bin}/mongocli completion fish`
  test: |
    system "#{bin}/mongocli --version"
nfpms:
- package_name: mongocli
  vendor: MongoDB Inc.
  homepage: https://www.mongodb.com/
  maintainer: MongoDB Inc. <support@mongodb.com>
  description: The MongoDB Command Line Interface (mongocli) is a tool for managing your MongoDB cloud services, like MongoDB Atlas, MongoDB Cloud Manager, and MongoDB Ops Manager.
  license: Apache 2.0
  bindir: /usr/bin
  builds: [linux]
  formats: [deb,rpm]
  replacements:
    amd64: x86_64
checksum:
  name_template: checksums.txt
snapshot:
  name_template: next
changelog:
  sort: asc
  filters:
    exclude:
    - '^docs:'
    - '^test:'
release:
  draft: true
  prerelease: auto
  extra_files:
    - glob: ./dist/mongocli_macos_signed_x86_64.zip

Expected behavior

A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • OS: [e.g. mac, linux]
  • OS version: [uname -a]
  • GoReleaser Version [goreleaser --version]
  • GitLab version (if using a private hosted one)

Additional context

We don't plan to support ARM at the moment but some other formulas in our tap plan to do so and was wondering if we should maybe have a default behaviour for brew on ARM, even if wrong, to at least allow tapping

@gssbzn gssbzn added the bug Something isn't working label Sep 14, 2020
@caarlos0
Copy link
Member

caarlos0 commented Oct 1, 2020

Not sure what to expect here either...
AFAIK there are no options to say "platform X is not supported", but we should probably double-check.

@caarlos0 caarlos0 added the help wanted Extra attention is needed label Oct 1, 2020
@caarlos0
Copy link
Member

can you check if #1900 helps?

@gssbzn
Copy link
Author

gssbzn commented Nov 17, 2020

I'll try to do a release this week and let you know, thanks btw

@gssbzn
Copy link
Author

gssbzn commented Nov 27, 2020

Hi, sorry it took longer but we finally got around to test the new goreleaser, sadly the error is still the same

Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/mongodb/homebrew-brew'...
remote: Enumerating objects: 118, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 483 (delta 47), reused 54 (delta 22), pack-reused 365
Receiving objects: 100% (483/483), 106.15 KiB | 744.00 KiB/s, done.
Resolving deltas: 100% (216/216), done.
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongocli.rb
formulae require at least a URL
Error: Cannot tap mongodb/brew: invalid syntax in tap!

The if conditions changed but the core issue is still that for ARM there's no valid URL

 if OS.mac?
    url "https://github.com/mongodb/mongocli/releases/download/v1.9.0/mongocli_1.9.0_macos_x86_64.zip"
    sha256 "fb8fea2222e5d058d066af84858ba4e483c2c6280878d295e594471382ebd09c"
  end
  if OS.linux? && Hardware::CPU.intel?
    url "https://github.com/mongodb/mongocli/releases/download/v1.9.0/mongocli_1.9.0_linux_x86_64.tar.gz"
    sha256 "bb745cd35cd96567e25db9eea6033512e67cc0a4e70fe54e88c73bc01cde4142"
  end

the url and sha256 are empty for ARM, seeing the change listed as possible fix I went and added depends_on arch: :x86_64 but this seems to have no effect either I wonder if this could even be solved

@caarlos0
Copy link
Member

caarlos0 commented Jan 7, 2021

I wonder if this could even be solved

I think it can't.

Will close this for now...

@caarlos0 caarlos0 closed this as completed Jan 7, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants