Skip to content

Commit 6bd6b2b

Browse files
Fix macOS build failures by making brew uninstall commands non-fatal
The jarbuild workflow was failing on macOS because it tried to uninstall Homebrew formulas that don't exist or aren't installed: - aws-sdk-cpp (may not be installed) - re2 (may not be installed) - protobuf (may not be installed) These uninstall commands were failing with exit code 1, causing the entire build to fail. By adding '|| :' to these commands, we make them non-fatal so the build can continue even if the formulas aren't installed. The grpc and [email protected] uninstall commands already had '|| :' and were working correctly.
1 parent 193c85a commit 6bd6b2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/jarbuild.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,18 @@ jobs:
246246
# Homebrew's aws-sdk-cpp, our build mix Homebrew's
247247
# aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's
248248
# aws-sdk-cpp to ensure using only bundled aws-sdk-cpp.
249-
brew uninstall aws-sdk-cpp
249+
brew uninstall aws-sdk-cpp || :
250250
# We want to use bundled RE2 for static linking. If
251251
# Homebrew's RE2 is installed, its header file may be used.
252252
# We uninstall Homebrew's RE2 to ensure using bundled RE2.
253253
brew uninstall grpc || : # gRPC depends on RE2
254254
brew uninstall [email protected] || : # gRPC 1.54 may be installed too
255-
brew uninstall re2
255+
brew uninstall re2 || :
256256
# We want to use bundled Protobuf for static linking. If
257257
# Homebrew's Protobuf is installed, its library file may be
258258
# used on test We uninstall Homebrew's Protobuf to ensure using
259259
# bundled Protobuf.
260-
brew uninstall protobuf
260+
brew uninstall protobuf || :
261261
262262
brew bundle --file=Brewfile
263263
- name: Prepare ccache

0 commit comments

Comments
 (0)