Skip to content

CI: Move Homebrew dependencies into Brewfile#148335

Open
hugovk wants to merge 4 commits intopython:mainfrom
hugovk:3.15-brewfile
Open

CI: Move Homebrew dependencies into Brewfile#148335
hugovk wants to merge 4 commits intopython:mainfrom
hugovk:3.15-brewfile

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Apr 10, 2026

The motivation for this is to get rid of the 15 Homebrew warnings like:

⚠️ macOS / build and test (macos-26)
openssl@3.5 was installed but not linked because openssl@3 and openssl@3 are already linked.
To link this version, run:
brew link openssl@3.5

Details

macOS / build and test (macos-26)
openssl@3.5 was installed but not linked because openssl@3 and openssl@3 are already linked. To link this version, run: brew link openssl@3.5
macOS / build and test (macos-26)
$HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set: not checking for outdated dependents or dependents with broken linkage!
macOS / build and test (macos-26)
gdbm 1.26 is already installed and up-to-date. To reinstall 1.26, run: brew reinstall gdbm
macOS / build and test (macos-26)
xz 5.8.3 is already installed and up-to-date. To reinstall 5.8.3, run: brew reinstall xz
macOS / build and test (macos-26)
pkgconf 2.5.1 is already installed and up-to-date. To reinstall 2.5.1, run: brew reinstall pkgconf
macOS (free-threading) / build and test (macos-26)
openssl@3.5 was installed but not linked because openssl@3 and openssl@3 are already linked. To link this version, run: brew link openssl@3.5
macOS (free-threading) / build and test (macos-26)
$HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set: not checking for outdated dependents or dependents with broken linkage!
macOS (free-threading) / build and test (macos-26)
gdbm 1.26 is already installed and up-to-date. To reinstall 1.26, run: brew reinstall gdbm
macOS (free-threading) / build and test (macos-26)
xz 5.8.3 is already installed and up-to-date. To reinstall 5.8.3, run: brew reinstall xz
macOS (free-threading) / build and test (macos-26)
pkgconf 2.5.1 is already installed and up-to-date. To reinstall 2.5.1, run: brew reinstall pkgconf
openssl@3.5 was installed but not linked because openssl@3 and openssl@3 are already linked. To link this version, run: brew link openssl@3.5
macOS / build and test (macos-15-intel)
$HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set: not checking for outdated dependents or dependents with broken linkage!
macOS / build and test (macos-15-intel)
gdbm 1.26 is already installed and up-to-date. To reinstall 1.26, run: brew reinstall gdbm
macOS / build and test (macos-15-intel)
xz 5.8.3 is already installed and up-to-date. To reinstall 5.8.3, run: brew reinstall xz
macOS / build and test (macos-15-intel)
pkgconf 2.5.1 is already installed and up-to-date. To reinstall 2.5.1, run: brew reinstall pkgconf

Before: https://github.com/python/cpython/actions/runs/24211469188

brew bundle Brewfile is essentially the same as brew install, except it checks all the needed dependencies first, and if a dep is is already installed, it's a noop and doesn't print the warning.

Docs: https://docs.brew.sh/Brew-Bundle-and-Brewfile

This helps keep our warnings log clear for things that really matter.

Also we don't need to brew link --overwrite tcl-tk@9 because tcl-tk is the default. This fixes these three warnings:

macOS / build and test (macos-26)
Already linked: /opt/homebrew/Cellar/tcl-tk/9.0.3
macOS (free-threading) / build and test (macos-26)
Already linked: /opt/homebrew/Cellar/tcl-tk/9.0.3
macOS / build and test (macos-15-intel)
Already linked: /usr/local/Cellar/tcl-tk/9.0.3
macOS / build and test (macos-15-intel)

After: just a hypothesis warning! https://github.com/python/cpython/actions/runs/24248324311?pr=148335

@hugovk hugovk added the infra CI, GitHub Actions, buildbots, Dependabot, etc. label Apr 10, 2026
run: |
brew install pkg-config openssl@3.5 xz gdbm tcl-tk@9 make
# Because alternate versions are not symlinked into place by default:
brew link --overwrite tcl-tk@9
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will backport to 3.10, but we still need to link tcl-tk@8 there. And put tcl-tk@8 in the Brewfile.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@hugovk hugovk added the needs backport to 3.14 bugs and security fixes label Apr 10, 2026
Copy link
Copy Markdown
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I like the idea but not sure if the file location should be among the workflows.. Perhaps, it'd belong in the tools dir?

@hugovk
Copy link
Copy Markdown
Member Author

hugovk commented Apr 10, 2026

Good point: if we move it elsewhere, we can update https://devguide.python.org/getting-started/setup-building/

-brew install pkg-config openssl@3 xz gdbm tcl-tk mpdecimal zstd
+brew bundle --file=<file-location>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review infra CI, GitHub Actions, buildbots, Dependabot, etc. needs backport to 3.14 bugs and security fixes skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants