Skip to content

Commit 3fd066a

Browse files
committed
ci: Force Homebrew to overwrite the image Python
We don't care about system Python, as we use `actions/setup-python` (on GitHub) or `UsePythonVersion` (on Azure), which install in some other location and adjust the `PATH`. But occasionally, Homebrew will fail to update these files because they didn't come from Homebrew, so just silence its complaints.
1 parent acb461f commit 3fd066a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,16 @@ jobs:
188188
;;
189189
macOS)
190190
brew update
191-
export HOMEBREW_NO_INSTALL_UPGRADE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
191+
# Periodically, Homebrew updates Python and fails to overwrite the
192+
# existing not-managed-by-Homebrew copy without explicitly being told
193+
# to do so. GitHub/Azure continues to avoid fixing their runner images:
194+
# https://github.com/actions/runner-images/issues/9966
195+
# so force an overwrite even if there are no Python updates.
196+
# We don't even care about Homebrew's Python because we use the one
197+
# from actions/setup-python.
198+
for python_package in $(brew list | grep python@); do
199+
brew install --overwrite ${python_package}
200+
done
192201
brew install ccache ghostscript gobject-introspection gtk4 ninja
193202
brew install --cask font-noto-sans-cjk inkscape
194203
;;

azure-pipelines.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,16 @@ stages:
111111
;;
112112
Darwin)
113113
brew update
114-
export HOMEBREW_NO_INSTALL_UPGRADE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
114+
# Periodically, Homebrew updates Python and fails to overwrite the
115+
# existing not-managed-by-Homebrew copy without explicitly being told
116+
# to do so. GitHub/Azure continues to avoid fixing their runner images:
117+
# https://github.com/actions/runner-images/issues/9966
118+
# so force an overwrite even if there are no Python updates.
119+
# We don't even care about Homebrew's Python because we use the one
120+
# from UsePythonVersion.
121+
for python_package in $(brew list | grep python@); do
122+
brew install --overwrite ${python_package}
123+
done
115124
brew install --cask xquartz
116125
brew install ccache ffmpeg imagemagick mplayer ninja pkg-config
117126
brew install --cask font-noto-sans-cjk-sc

0 commit comments

Comments
 (0)