Skip to content

GH-49435: [CI][Python] Fix macOS protobuf@33 keg-only discovery#49491

Open
tadeja wants to merge 8 commits intoapache:mainfrom
tadeja:macos-test-flight-fatal-bus
Open

GH-49435: [CI][Python] Fix macOS protobuf@33 keg-only discovery#49491
tadeja wants to merge 8 commits intoapache:mainfrom
tadeja:macos-test-flight-fatal-bus

Conversation

@tadeja
Copy link
Contributor

@tadeja tadeja commented Mar 10, 2026

Rationale for this change

Homebrew upgrading protobuf beyond v33 (as described in #49435) also causes new runtime Bus error.

What changes are included in this PR?

a) Pin protobuf@33 in cpp/Brewfile (as discussed in #49436)
b) Add keg-only env setup in python.yml so CMake/pkg-config can find protobuf@33

This resolves Fatal Python error: Bus error on macOS 15 Intel when importing pyarrow.flight. Homebrew's latest protobuf pulls in Abseil 20260107
-- Found abslAlt: 1 (found version "20260107")
which is ABI-incompatible with Arrow's bundled gRPC v1.46.3

One of earliest Python CI logs with the Bus error:
https://github.com/apache/arrow/actions/runs/22722817262/job/65889451081#step:10:103

Note: Other workflows using cpp/Brewfile will prob need similar keg-only setup. (There's failing C++ job log here, Ruby etc.)

Are these changes tested?

Yes, fork workflow completed the Python macOS 15-intel job with success.

Are there any user-facing changes?

No.

@tadeja
Copy link
Contributor Author

tadeja commented Mar 10, 2026

AMD64 macOS 15-intel Python 3 and ARM64 macOS 14 Python 3 both successfully completed with the protobuf@33 change.

Now attempting similar change for cpp.yml and ruby.yml.

@tadeja
Copy link
Contributor Author

tadeja commented Mar 10, 2026

@raulcd, @rok what do you say about this PR? it can be moved into existing draft #49436 if you'd prefer.

@rok
Copy link
Member

rok commented Mar 10, 2026

Will users building for source need to use keg only? Should we update docs?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Mar 10, 2026
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

This is a workaround. We should remove @33 eventually after the gRPC problem is fixed.
See also:

Could you add a comment when we can remove this workaround?

@github-actions github-actions bot added awaiting review Awaiting review awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Mar 11, 2026
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
@github-actions github-actions bot added awaiting review Awaiting review awaiting committer review Awaiting committer review and removed awaiting review Awaiting review awaiting merge Awaiting merge labels Mar 11, 2026
@tadeja
Copy link
Contributor Author

tadeja commented Mar 11, 2026

Ruby job is failing anew (no changes here except for newline)
https://github.com/apache/arrow/actions/runs/22944683842/job/66602842927?pr=49491#step:8:1689
/Users/runner/work/arrow/arrow/build/cpp/src/arrow/flight/Flight.pb.h:16:2: error: "Protobuf C++ gencode is built with an incompatible version of"

I see homebrew merged this last night so grpc changed "protobuf@33" to "protobuf" and is on version 34.0 now;

As it appears grpc formula now depends on protobuf (v34), grpc_cpp_plugin generates v34 incompatible code that can't compile against protobuf@33 headers

@tadeja
Copy link
Contributor Author

tadeja commented Mar 11, 2026

( Unrelated issue of Windows test segfault is being worked on in #49462. )

@tadeja
Copy link
Contributor Author

tadeja commented Mar 11, 2026

@raulcd what are your thoughts on the next steps here? - CI jobs are passing again today, also for ARM64 macOS 14 GLib & Ruby (pull_request)
This time using solution from your draft PR + protobuf@33 workaround only for cpp.yml and python.yml + reverted env setup for ruby.yml as that doesn't seem to be necessary there anymore I suppose due to brew update last night? (I'll remove unneeded newline with my next commit)

@tadeja tadeja requested a review from kou March 12, 2026 01:36
Comment on lines +233 to +240

# protobuf@33 is keg-only, so make it visible to CMake and pkg-config.
# Remove this workaround after the gRPC problem is fixed.
# See https://github.com/grpc/grpc/issues/41755
export PROTOBUF_PREFIX="$(brew --prefix protobuf@33)"
echo "PKG_CONFIG_PATH=${PROTOBUF_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=${PROTOBUF_PREFIX}:${ARROW_HOME}:${CMAKE_PREFIX_PATH}" >> "$GITHUB_ENV"
echo "${PROTOBUF_PREFIX}/bin" >> "$GITHUB_PATH"
Copy link
Member

Choose a reason for hiding this comment

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

Can we use brew update workaround instead of this?
We can remove the brew update once GitHub Actions runner ships new Homebrew by default.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants