Skip to content

Commit c5a95df

Browse files
DX-120970 Fix macOS build: pin cmake/boost before brew bundle
Move cmake and boost local-tap setup before the first `brew bundle` call. Newer Homebrew on macos-15-intel treats `cmake` as a cask during `brew bundle`, causing the build to fail. Pre-installing from the pinned local formula ensures brew bundle skips it cleanly.
1 parent 601cb68 commit c5a95df

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

dev/tasks/java-jars/github.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ jobs:
120120
# llvm@14 because llvm is newer than llvm@14.
121121
brew uninstall llvm || :
122122
123+
# Pin cmake and boost to specific versions before brew bundle to avoid
124+
# Homebrew treating cmake as a cask on newer runner images.
125+
brew uninstall -f boost || true
126+
brew uninstall -f cmake || true
127+
mkdir -p homebrew-custom/Formula
128+
curl -o homebrew-custom/Formula/cmake.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/f68532bfe5cb87474093df8a839c3818c6aa44dd/Formula/c/cmake.rb
129+
curl -o homebrew-custom/Formula/boost.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/23f9c56c5075dd56b4471e2c93f89f6400b49ddd/Formula/b/boost.rb
130+
brew tap-new local/homebrew-custom
131+
cp ./homebrew-custom/Formula/*.rb "$(brew --repo local/homebrew-custom)/Formula/"
132+
brew install -v local/homebrew-custom/cmake
133+
brew install -v local/homebrew-custom/boost
134+
brew pin cmake
135+
brew pin boost
136+
123137
brew bundle --file=arrow/cpp/Brewfile
124138
# We want to link aws-sdk-cpp statically but Homebrew's
125139
# aws-sdk-cpp provides only shared library. If we have
@@ -138,20 +152,6 @@ jobs:
138152
# used on test We uninstall Homebrew's Protobuf to ensure using
139153
# bundled Protobuf.
140154
brew uninstall protobuf
141-
# fix cmake and boost versions
142-
brew uninstall -f boost || true
143-
brew uninstall -f cmake || true
144-
mkdir -p homebrew-custom/Formula
145-
curl -o homebrew-custom/Formula/cmake.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/f68532bfe5cb87474093df8a839c3818c6aa44dd/Formula/c/cmake.rb
146-
curl -o homebrew-custom/Formula/boost.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/23f9c56c5075dd56b4471e2c93f89f6400b49ddd/Formula/b/boost.rb
147-
brew tap-new local/homebrew-custom
148-
cp ./homebrew-custom/Formula/*.rb "$(brew --repo local/homebrew-custom)/Formula/"
149-
brew install -v local/homebrew-custom/cmake
150-
brew install -v local/homebrew-custom/boost
151-
brew pin cmake
152-
brew pin boost
153-
#
154-
155155
156156
brew bundle --file=arrow/java/Brewfile
157157
- name: Build C++ libraries

0 commit comments

Comments
 (0)