Brew packages should be casks, not formulae #5563
Replies: 15 comments 110 replies
-
|
so, basically, we replace the |
Beta Was this translation helpful? Give feedback.
-
|
@caarlos0 Distributing as a Formula, though not its intended use, circumvented this problem. |
Beta Was this translation helpful? Give feedback.
-
|
FWIW, it seems also had a typo in the completions stuff and finally, seems like license is not supported by casks? cc/ @SMillerDev |
Beta Was this translation helpful? Give feedback.
-
|
@SMillerDev another question I have about the migration: is there a way to instruct users to uninstall the formula and install the cask instead? |
Beta Was this translation helpful? Give feedback.
-
|
@SMillerDev I think I might have found a bug in casks! see https://github.com/goreleaser/homebrew-tap/blob/master/Formula/goreleaser.rb and https://github.com/goreleaser/homebrew-tap/blob/master/Casks/goreleaser.rb The cask has the $ HOMEBREW_AUTO_UPDATE_SECS=1 brew upgrade
==> Auto-updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (goreleaser/tap).
You have 1 outdated formula installed.
==> Upgrading 1 outdated package:
goreleaser/tap/goreleaser 2.9.0 -> 2.9.1
Error: goreleaser/tap/goreleaser has been disabled because it the cask should be used now instead! It will be disabled on 2025-06-14.
Replacement:
brew install --cask goreleaser
$ brew install --cask goreleaser/tap/goreleaser
==> Downloading https://github.com/goreleaser/goreleaser/releases/download/v2.10.2/goreleaser_Darwin_arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/77071454/08a37aaf-7bf5-4615-a1e5-dcd6b5458d88?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetprodu
############################################################################################################################################################################################################ 100.0%
==> Installing Cask goreleaser
==> Purging files for version 2.10.2 of Cask goreleaser
Error: It seems there is already a Binary at '/opt/homebrew/bin/goreleaser'.
I think it should say that a formula that is already installed conflicts with the cask instead? |
Beta Was this translation helpful? Give feedback.
-
|
I know this issue is closed but I tried to migrate from the The CLI I have is the NanoID client and the corresponding homebrew repo is here. Essentially, I broke everyone with what has worked before on macOS and Linux: brew tap sixafter/tap
brew install nanoidI'm sure I'm doing something silly. Any insights are welcome. |
Beta Was this translation helpful? Give feedback.
-
|
@SMillerDev Thanks much for your help. I'll check with the person who reported the failure to me and look at migrating to the |
Beta Was this translation helpful? Give feedback.
-
|
Hello, It looks like there is an incompatibility between the new homebrew_casks and the binary archive format. In my current GoReleaser config, I use this configuration to get only binary as artifact : archives:
- formats:
- "binary"Then I push this artifact to a S3 bucket, and use it with blobs:
- provider: s3
region: eu-west-3
bucket: my-company-release
homebrew_casks:
- name: foo
directory: Casks
conflicts:
- formula: foo
url:
template: https://my-company-release.s3.eu-west-3.amazonaws.com/{{.ProjectName}}/{{.Tag}}/foo_{{.Version}}_linux_amd64
commit_author:
name: "{{ .Env.GITLAB_USER_NAME }}"
email: "{{ .Env.GITLAB_USER_EMAIL }}"
repository:
owner: foo
name: homebrew-tap
token: "{{ .Env.GITLAB_TOKEN }}"Everything works fine at compile/package, I got my new formule which looks like this: # This file was generated by GoReleaser. DO NOT EDIT.
cask "foo" do
desc "Foo"
homepage "https://gitlab.com/foo/foo"
version "2.3.4"
livecheck do
skip "Auto-generated on release."
end
binary "foo"
on_linux do
on_intel do
url "https://my-company-release.s3.eu-west-3.amazonaws.com/foo/v2.3.4/foo_2.3.4_linux_amd64"
sha256 "<redacted>"
end
end
conflicts_with formula: [
"foo",
]
# No zap stanza required
endAnd when I run I try to update manually my Formula (with # This file was generated by GoReleaser. DO NOT EDIT.
cask "foo" do
# [...]
# binary "foo"
on_linux do
on_intel do
url "https://my-company-release.s3.eu-west-3.amazonaws.com/foo/v2.3.4/foo_2.3.4_linux_amd64"
sha256 "<redacted>"
binary "foo_2.3.4_linux_amd64", target: "foo"
end
end
# [...]
endWith this modification it works fine. Unfortunately, I think I can't generate it like this with the current configuration. I consider using archive artifact (like it's done in the GoReleaser own project configuration) to bypass this limitation. Do you have any other idea? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
|
Given it's not a simple task to engage and educate all users at once to switch from > goreleaser check
• checking path=.goreleaser.yml
• DEPRECATED: brews should not be used anymore, check https://goreleaser.com/deprecations#brews for more info
• .goreleaser.yml error=configuration is valid, but uses deprecated properties
⨯ check failed error=1 out of 1 configuration file(s) have issues
> podman run -e RUN_LOCAL=true -e VALIDATE_GO_RELEASER=true -e FILTER_REGEX_INCLUDE="^$PWD/.goreleaser" --name super-linter --env GITHUB_WORKSPACE="$(git rev-parse --show-toplevel)" -v "$(git rev-parse --show-toplevel):$(git rev-parse --show-toplevel)" -v "$(git rev-parse --git-common-dir):$(git rev-parse --git-common-dir)" --workdir "$(git rev-parse --show-toplevel)" --rm ghcr.io/super-linter/super-linter:slim-latest
2025-07-24 15:00:52 [INFO] --------------------------------------------------------------------------------
[snip]
2025-07-24 15:00:52 [INFO] This version of Super-linter includes the following tools:
[snip]
[GO_RELEASER] goreleaser: 2.11.0
[snip]
2025-07-24 15:01:01 [INFO] Command output when running linters:
------
2025-07-24 15:01:01 [INFO] Linting GO_RELEASER items...
2025-07-24 15:01:01 [ERROR] Found errors when linting GO_RELEASER. Exit code: 1.
2025-07-24 15:01:01 [INFO] Stderr contents for GO_RELEASER:
------
• checking path=/home/[snip]/.goreleaser.yml
• DEPRECATED: brews should not be used anymore, check https://goreleaser.com/deprecations#brews for more info
• /home/[snip]/.goreleaser.yml error=configuration is valid, but uses deprecated properties
1 out of 1 configuration file(s) have issues
------
------
2025-07-24 15:01:01 [INFO] ----------------------------------------------
2025-07-24 15:01:01 [INFO] ----------------------------------------------
2025-07-24 15:01:02 [ERROR] Errors found in GO_RELEASER
2025-07-24 15:01:02 [ERROR] Super-linter detected linting errors |
Beta Was this translation helpful? Give feedback.
-
|
Another issue with using casks: entitlements macOS might simply kill the process, even if signed & notarized, because some entitlement is missing. It's always super helpful that it doesn't say which, just SIGKILL, and logs nothing about it either. Anyway, at this point I'm considering un-deprecating |
Beta Was this translation helpful? Give feedback.
-
|
@caarlos0 See the Homebrew section my |
Beta Was this translation helpful? Give feedback.
-
|
It's mentioned in earlier threads, but I wanted to clarify what the expected migration path is. By default we assume that 1. Delete the Formula when you add the CaskFor new users 2. Keep both, disable the formulai.e. add a line to the Formula like: disable! date: "2025-08-07", because: "the cask should be used now instead", replacement_cask: "my-formula"This means that every user running the original command will get output like this: and have to manually take action for every formula they have installed. I've already seen users having issues with both. ProposalMaybe brew can special-case Alternatively maybe |
Beta Was this translation helpful? Give feedback.
-
|
I have to admit that I’m a bit surprised by the deprecation of formulas, and casks being suggested over bottles. When has this shift at homebrew happened? homebrew-cask still mentions gui applications as the use case, while bottles are mentioned to deal with “Binary Packages”. Perhaps I should have mentioned this at homebrew upstream, but I ran into this in the context of goreleaser. |
Beta Was this translation helpful? Give feedback.
-
|
@SMillerDev Hey! Sorry to bother, but I have another question. In GoReleaser, it is possible to have archives with a dir in them, e.g. What's the best way to handle that in a Cask? Can we set a directory inside the archive? I was thinking about doing something like this, but then I would also have to do it for manpages, completions, etc, which felt a bit wrong. Another problem when migrating from formula is that it was easy to generate completions in a post install script for formula, but apparently it doesn't work with casks. For reference: https://github.com/orgs/goreleaser/discussions/6214 https://github.com/orgs/goreleaser/discussions/6212 https://github.com/orgs/goreleaser/discussions/6245 |
Beta Was this translation helpful? Give feedback.
-
|
Hey @caarlos0, I wanted to share a practical concern from the user side. I maintain a CLI tool ( For CLI tools this is a problem. Most users just run brew upgrade and expect everything to update. With casks using version :latest or having auto-update flags, updates can be silently skipped. Formulas dont have this issue. I understand the terminology argument (formula = source, cask = binary). But from a user experience perspective, CLI tools distributed as casks can miss updates. This is why I consider to switch back to brews for my project. Maybe worth considering: Keep brews as a supported option for CLI tools |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In Homebrew parlance, a formula builds from source and a cask is pre-compiled: https://docs.brew.sh/Formula-Cookbook#homebrew-terminology
GoReleaser creates formulae, despite the packages being precompiled, which causes confusion in the usage for Homebrew users. While previously casks were not supported on Linux, since Homebrew/brew#19121 they are so GoReleaser can now provide casks for all pre-compiled binaries.
Beta Was this translation helpful? Give feedback.
All reactions