Repository navigation
Install protobuf@21 from a local tap in macOS CI before Homebrew removes it - #3628
Conversation
Homebrew disabled protobuf@21 on 2026-01-08 and removes disabled formulae a year after their disable date. The formula still installs today with a deprecation warning; once it is removed from homebrew-core, "brew install protobuf@21" fails with "No available formula" and the compile-with-make-cmake-protobuf21 job fails. Install it from a local tap that holds the homebrew-core formula at commit cced3ef1d489 without its deprecate!/disable! lines. Homebrew pours the same bottle into the same opt/protobuf@21 prefix, so the make and cmake steps are unchanged.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Updates macOS CI to keep installing protobuf@21 after Homebrew removes the disabled formula by vendoring the formula into a local tap during the workflow run.
Changes:
- Removes
protobuf@21from the directbrew installlist. - Creates a local tap and downloads the pinned
protobuf@21formula from a specifichomebrew-corecommit withdeprecate!/disable!lines stripped. - Installs
protobuf@21from the local tap (brew install local/pins/protobuf@21).
| File | Description |
|---|---|
| .github/workflows/ci-macos.yml | Pins and installs protobuf@21 via a locally-created tap to future-proof macOS CI against formula removal. |
Review effort: Lite
| brew tap-new --no-git local/pins | ||
| curl -fsSL https://raw.githubusercontent.com/Homebrew/homebrew-core/cced3ef1d489fce4eba453a333619722c3a8dd17/Formula/p/protobuf@21.rb \ | ||
| | grep -v -E '^[[:space:]]*(deprecate|disable)!' > "$(brew --repository local/pins)/Formula/protobuf@21.rb" |
| @@ -29,7 +29,14 @@ jobs: | |||
|
|
|||
| - name: install dependences | |||
| # after that date. Install it from a local tap holding the homebrew-core formula, | ||
| # pinned to a commit and without its deprecate!/disable! lines. | ||
| brew tap-new --no-git local/pins | ||
| curl -fsSL https://raw.githubusercontent.com/Homebrew/homebrew-core/cced3ef1d489fce4eba453a333619722c3a8dd17/Formula/p/protobuf@21.rb \ |
There was a problem hiding this comment.
It is recommended to save protobuf@21.rb to the homebrew-formula directory to avoid having to download it every time.
Store the pinned homebrew-core formula (commit cced3ef1d489, without its deprecate!/disable! lines) as homebrew-formula/protobuf@21.rb and copy it into the local tap, so the macOS job no longer downloads it on every run. The file keeps Homebrew's BSD 2-Clause notice; it is listed in LICENSE and excluded from the Apache header check, like the other third-party files.
|
Thanks, done in 3e53bdd. The tap step stays because current Homebrew (7.0.9 on macos-latest) refuses a plain file path: macOS CI passes on the updated head. Prepared by CyberNative AI LLC, an AI-run company, using AI agents. |


What problem does this PR solve?
Issue Number: none
Problem Summary:
The
compile-with-make-cmake-protobuf21job in.github/workflows/ci-macos.ymlrunsbrew install ... protobuf@21. Homebrew disabled that formula on 2026-01-08 (disable! date: "2026-01-08"in the formula). Onmacos-latestit still installs today, with only a warning:The break comes later. Homebrew's
remove-disabled-packagesaction deletes formulae whose disable date is more than a year old, and recent removals landed the day after that anniversary (vera++, disabled 2025-10-09, removed 2026-10-10). So protobuf@21 should leave homebrew-core on or soon after 2027-01-09. From then on the install step fails withNo available formula with the name "protobuf@21", and this job fails on every push and pull request.What is changed and the side effects?
Changed:
brew tap-new --no-git local/pins), writes the homebrew-coreprotobuf@21formula from commitcced3ef1d489into it without thedeprecate!/disable!lines, and runsbrew install local/pins/protobuf@21.protobuf@2121.12_1) into the same$(brew --prefix)/opt/protobuf@21prefix, so the make and cmake steps do not change.Side effects:
Performance effects: one extra download of the formula file (about 4 KB).
brew tap-newturns on Homebrew's developer mode for the rest of the job. The later steps only callbrew --prefix.Breaking backward compatibility: no. The job keeps testing protobuf 3.21.12.
The pin assumes Homebrew keeps serving the existing protobuf@21 bottles after the formula is removed. In our tests on Linux Homebrew, bottles of formulae that had already been removed still installed. protobuf@21 has no runtime dependencies on macOS (zlib comes from the system), so later changes in homebrew-core should not break the pinned keg. If you would rather not carry a pin, the other options are to drop protobuf 21 from macOS CI or build it from source. protobuf@29, used by the next job, is on the same schedule later: disabled from 2027-03-31, so removal around 2028-03-31.
Tests
macos-latestrunner (macOS 26.6.2, arm64, Homebrew 7.0.9), brpc8252e8ec, private repository:protoc --versionlocal/pinslocal/pins;brew install protobuf@21itself fails withNo available formula with the name "protobuf@21"¹ For the current step we ran
config_brpc.sh, cmake configure andmake brpc-static, not the full job.The patched
ci-macos.ymlwas applied withgit apply, and the install step was run from its own bytes. The make and cmake steps were run as written, without the ccache action.Check List:
Prepared by CyberNative AI LLC, an AI-run company, using AI agents.