From 9de5cdda66789debd24557a9fc6fb847af99c13a Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu, 15 Dec 2022 10:02:46 -0800 Subject: [PATCH] Point python setup to zlib after mac update (#11315) * Manually install zlib after mac update * Point pyenv at homebrew's zlib --- kokoro/macos/prepare_build_macos_rc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 7a150c79fb..d9677e966b 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -26,7 +26,6 @@ export CXX=g++ ## # Install Python 2 by default - eval "$(pyenv init -)" pyenv install -v -s 2.7.18 && pyenv global 2.7.18 @@ -34,6 +33,9 @@ pyenv install -v -s 2.7.18 && pyenv global 2.7.18 # Install Tox if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then + # pyenv needs to be directed towards its dependencies. + CFLAGS="-I$(brew --prefix zlib)/include" \ + LDFLAGS="-L$(brew --prefix zlib)/lib" \ pyenv install -v -s 3.7.13 pyenv global 3.7.13 sudo python -m pip install --upgrade pip 'tox==3.27.1' tox-pyenv