Skip to content

Commit

Permalink
GH-42197: [CI][Packaging][Java] Ensure updating "python@*" formulae o…
Browse files Browse the repository at this point in the history
…n macOS (#42202)

### Rationale for this change

macOS GitHub Actions runners have Python not installed by Homebrew at `/usr/local/`.
If we install `python@ XXX` Homebrew formula, it tries to overwrite `/usr/local/bin/2to3` and so on and causes a conflict error.

NOTE: This is happen only when pre-installed Homebrew `python@ XXX` on macOS GitHub Actions runners is outdated. (`python@ XXX` is updated after macOS GitHub Actions runner image is created.)

### What changes are included in this PR?

Ensure updating `pythone@ XXX` with `--overwrite` before we use `brew bundle`.
`brew bundle` may update `python@ XXX` automatically without `--overwrite`.

FYI: `brew bundle --force ...` will also work.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #42197

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
  • Loading branch information
kou authored Jun 19, 2024
1 parent 4fd35aa commit 6bcb418
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dev/tasks/java-jars/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ jobs:
# llvm@14 because llvm is newer than llvm@14.
brew uninstall llvm || :
# Ensure updating python@XXX with the "--overwrite" option.
# If python@XXX is updated without "--overwrite", it causes
# a conflict error. Because Python 3 installed not by
# Homebrew exists in /usr/local on GitHub Actions. If
# Homebrew's python@XXX is updated without "--overwrite", it
# tries to replace /usr/local/bin/2to3 and so on and causes
# a conflict error.
brew update
for python_package in $(brew list | grep python@); do
brew install --overwrite ${python_package}
done
brew bundle --file=arrow/cpp/Brewfile
# We want to link aws-sdk-cpp statically but Homebrew's
# aws-sdk-cpp provides only shared library. If we have
Expand Down

0 comments on commit 6bcb418

Please sign in to comment.