Skip to content

Commit

Permalink
Make brew calls before selecting Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruskal-google committed Jul 20, 2022
1 parent 88f5230 commit 016d45b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 10 deletions.
26 changes: 22 additions & 4 deletions kokoro/macos/php74/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,34 @@ cd $(dirname $0)/../../..
# Prepare worker environment to run tests
source kokoro/macos/prepare_build_macos_rc

# Install PHP + Composer
brew install [email protected] composer pcre2
# Disable SSL
echo insecure >> ~/.curlrc
export HOMEBREW_CURLRC=1
#export HOMEBREW_FORCE_BREWED_CURL=1

# Make sure SNI is enabled
wget https://curl.haxx.se/download/curl-7.58.0.zip
unzip curl-7.58.0.zip
cd curl-7.58.0
./configure --with-darwinssl
make
sudo make install

# Install PHP
brew install [email protected]

# Install Composer
wget https://getcomposer.org/download/2.0.13/composer.phar --progress=dot:mega -O /usr/local/bin/composer
chmod a+x /usr/local/bin/composer

# Configure path
PHP_FOLDER=$(find /opt/homebrew -type d -regex ".*php.*/7.4.[0-9]*")
HOMEBREW_PREFIX=$(brew --prefix)
PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/7.4.[0-9]*")
test ! -z "$PHP_FOLDER"
export PATH="$PHP_FOLDER/bin:$PATH"

# Fix missing pcre2.h in homebrew's PHP
ln -s $(find /opt/homebrew/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h
ln -s $(find $HOMEBREW_PREFIX/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h

# Test
./tests.sh php_mac
26 changes: 22 additions & 4 deletions kokoro/macos/php80/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,34 @@ cd $(dirname $0)/../../..
# Prepare worker environment to run tests
source kokoro/macos/prepare_build_macos_rc

# Install PHP + Composer
brew install [email protected] composer pcre2
# Disable SSL
echo insecure >> ~/.curlrc
export HOMEBREW_CURLRC=1
#export HOMEBREW_FORCE_BREWED_CURL=1

# Make sure SNI is enabled
wget https://curl.haxx.se/download/curl-7.58.0.zip
unzip curl-7.58.0.zip
cd curl-7.58.0
./configure --with-darwinssl
make
sudo make install

# Install PHP
brew install [email protected]

# Install Composer
wget https://getcomposer.org/download/2.0.13/composer.phar --progress=dot:mega -O /usr/local/bin/composer
chmod a+x /usr/local/bin/composer

# Configure path
PHP_FOLDER=$(find /opt/homebrew -type d -regex ".*php.*/8.0.[0-9]*")
HOMEBREW_PREFIX=$(brew --prefix)
PHP_FOLDER=$(find $HOMEBREW_PREFIX -type d -regex ".*php.*/8.0.[0-9]*")
test ! -z "$PHP_FOLDER"
export PATH="$PHP_FOLDER/bin:$PATH"

# Fix missing pcre2.h in homebrew's PHP
ln -s $(find /opt/homebrew/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h
ln -s $(find $HOMEBREW_PREFIX/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h

# Test
./tests.sh php_mac
2 changes: 1 addition & 1 deletion kokoro/macos/php80/continuous.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Config file for running tests in Kokoro

# Location of the build script in repository
build_file: "protobuf/kokoro/macos/php7.3_mac/build.sh"
build_file: "protobuf/kokoro/macos/php80/build.sh"
timeout_mins: 1440
2 changes: 1 addition & 1 deletion kokoro/macos/php80/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Config file for running tests in Kokoro

# Location of the build script in repository
build_file: "protobuf/kokoro/macos/php7.3_mac/build.sh"
build_file: "protobuf/kokoro/macos/php80/build.sh"
timeout_mins: 1440
1 change: 1 addition & 0 deletions kokoro/macos/prepare_build_macos_rc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -eux
# "autom4te: need GNU m4 1.4 or later: /usr/bin/m4"
# go/kokoro/userdocs/macos/selecting_xcode.md for more information.
export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
sudo xcode-select -s "${DEVELOPER_DIR}"

##
# Select C/C++ compilers
Expand Down

0 comments on commit 016d45b

Please sign in to comment.