Skip to content

Fix deprecated depends_on macos: syntax in generated Homebrew formula#172

Open
defmacro-jam wants to merge 1 commit into
openai:mainfrom
defmacro-jam:fix-deprecated-macos-depends-on
Open

Fix deprecated depends_on macos: syntax in generated Homebrew formula#172
defmacro-jam wants to merge 1 commit into
openai:mainfrom
defmacro-jam:fix-deprecated-macos-depends-on

Conversation

@defmacro-jam

Copy link
Copy Markdown

The generated softnet.rb formula triggers a Homebrew deprecation warning on every evaluation (e.g. during brew update/upgrade):

Warning: Calling depends_on :macos with depends_on macos: is deprecated! Use depends_on :macos with depends_on macos: inside an on_macos block instead.

Cause: GoReleaser auto-emits a bare depends_on :macos for the darwin-only build targets, and brews.custom_block adds a top-level versioned depends_on :macos => :sequoia. Homebrew (software_spec.rb) now deprecates having both a bare and a versioned macOS dependency at the top level.

Fix: wrap the version constraint in an on_macos block — the form Homebrew's own deprecation message recommends — and use the blessed depends_on macos: :sequoia keyword. (The => :sequoia hash-rocket and the ">= :sequoia" string forms are both independently deprecated.) Semantics are unchanged: macOS Sequoia or newer.

     custom_block: |
-      depends_on :macos => :sequoia
+      on_macos do
+        depends_on macos: :sequoia
+      end

Verification (Homebrew 4.x): the current formula reproduces the warning when loaded; the patched form loads clean with no deprecation.

🤖 Generated with Claude Code

Homebrew now deprecates having a bare `depends_on :macos` (auto-emitted
by GoReleaser for darwin-only targets) alongside a top-level versioned
`depends_on :macos => :sequoia`. Wrap the version constraint in an
`on_macos` block, which is the form Homebrew's deprecation message
recommends, and switch to the blessed `depends_on macos: :sequoia`
keyword syntax (the `=> :sequoia` / string ">= :sequoia" forms are both
deprecated). Semantics are unchanged: macOS Sequoia or newer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant