Skip to content

Commit

Permalink
Brew update only for PHP (grpc#26665)
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush authored Jul 15, 2021
1 parent 434f90b commit 9f8e47e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tools/internal_ci/helper_scripts/prepare_build_macos_rc
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ fi

if [ "${PREPARE_BUILD_INSTALL_DEPS_PHP}" == "true" ]
then
# Install PHP 7.2 explictly to address missing php header files and
# It's required to update the brew because it won't work with the default version Kokoro has.
# This can be fragile, though because the future version of brew can break. In that case,
# please consider to fix the certain version like https://github.com/grpc/grpc/pull/24837.
brew update || true
brew config

# Install PHP 7.3 explictly to address missing php header files and
# to work well with the pre-installed phpunit 8.4
brew install php@7.2
export LDFLAGS="-L/usr/local/opt/php@7.2/lib $(LDFLAGS)"
export CPPFLAGS="-I/usr/local/opt/php@7.2/include $(CPPFLAGS)"
export PATH="/usr/local/opt/php@7.2/bin:/usr/local/opt/php@7.2/sbin:$PATH"
brew install php@7.3 || true
export LDFLAGS="-L/usr/local/opt/php@7.3/lib $(LDFLAGS)"
export CPPFLAGS="-I/usr/local/opt/php@7.3/include $(CPPFLAGS)"
export PATH="/usr/local/opt/php@7.3/bin:/usr/local/opt/php@7.3/sbin:$PATH"

# Workaround for https://github.com/Homebrew/homebrew-core/issues/41081
mkdir -p /usr/local/lib/php/pecl
Expand Down

0 comments on commit 9f8e47e

Please sign in to comment.