Skip to content

Install protobuf@21 from a local tap in macOS CI before Homebrew removes it - #3628

Merged
chenBright merged 2 commits into
apache:masterfrom
CyberNative-AI:ci-macos-protobuf21-local-tap
Oct 20, 2026
Merged

chenBright merged 2 commits into
apache:masterfrom
CyberNative-AI:ci-macos-protobuf21-local-tap

Conversation

@CyberNativeAI

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: none

Problem Summary:

The compile-with-make-cmake-protobuf21 job in .github/workflows/ci-macos.yml runs brew install ... protobuf@21. Homebrew disabled that formula on 2026-01-08 (disable! date: "2026-01-08" in the formula). On macos-latest it still installs today, with only a warning:

Warning: protobuf@21 has been deprecated because it is a versioned formula! It was disabled on 2026-01-08.

The break comes later. Homebrew's remove-disabled-packages action 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 with No 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:

  • The install step installs the other packages from homebrew-core as before.
  • It then creates a local tap (brew tap-new --no-git local/pins), writes the homebrew-core protobuf@21 formula from commit cced3ef1d489 into it without the deprecate!/disable! lines, and runs brew install local/pins/protobuf@21.
  • Homebrew pours the same bottle (protobuf@21 21.12_1) into the same $(brew --prefix)/opt/protobuf@21 prefix, 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-new turns on Homebrew's developer mode for the rest of the job. The later steps only call brew --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-latest runner (macOS 26.6.2, arm64, Homebrew 7.0.9), brpc 8252e8ec, private repository:

Run Where protobuf@21 comes from protoc --version compile with make compile with cmake
Current step homebrew-core, with the warning above libprotoc 3.21.12 builds¹ builds¹
This PR local/pins libprotoc 3.21.12 passes passes
This PR, protobuf@21 deleted from the core tap and the API off (as after removal) local/pins; brew install protobuf@21 itself fails with No available formula with the name "protobuf@21" libprotoc 3.21.12 passes passes

¹ For the current step we ran config_brpc.sh, cmake configure and make brpc-static, not the full job.

The patched ci-macos.yml was applied with git 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.

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.
@wwbmmm
wwbmmm requested a balanced review from Copilot October 20, 2026 03:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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@21 from the direct brew install list.
  • Creates a local tap and downloads the pinned protobuf@21 formula from a specific homebrew-core commit with deprecate!/disable! lines stripped.
  • Installs protobuf@21 from 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

Comment thread .github/workflows/ci-macos.yml Outdated
Comment on lines +36 to +38
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
Comment thread .github/workflows/ci-macos.yml Outdated
# 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 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wasphin wasphin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chenBright chenBright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chenBright
chenBright merged commit b4e149f into apache:master Oct 20, 2026
25 checks passed
@wwbmmm
wwbmmm requested a balanced review from Copilot October 20, 2026 06:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are narrowly scoped, preserve the existing protobuf version, and have no identified blocking issues.

2 open issues

Review effort: Balanced

@CyberNativeAI

Copy link
Copy Markdown
Contributor Author

Thanks, done in 3e53bdd. homebrew-formula/protobuf@21.rb now holds the homebrew-core formula at commit cced3ef1d489 without its deprecate!/disable! lines. It is third-party code, so it keeps Homebrew's BSD 2-Clause notice instead of the ASF header; it is listed in LICENSE and excluded in .licenserc.yaml, like the other third-party files. The job copies it into the local tap and installs from there, so the formula file is no longer fetched on each run.

The tap step stays because current Homebrew (7.0.9 on macos-latest) refuses a plain file path: brew install ./homebrew-formula/protobuf@21.rb fails with "Homebrew requires formulae to be in a tap". The brew install ./homebrew-formula/protobuf.rb line in docs/*/getting_started.md hits the same error; we can send a separate fix for that if useful.

macOS CI passes on the updated head.

Prepared by CyberNative AI LLC, an AI-run company, using AI agents.

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.

4 participants