Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating macos php builds from 7.0/7.3 to 7.4/8.0 #10274

Merged
merged 5 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions kokoro/macos/php7.0_mac/build.sh

This file was deleted.

12 changes: 0 additions & 12 deletions kokoro/macos/php7.3_mac/build.sh

This file was deleted.

20 changes: 20 additions & 0 deletions kokoro/macos/php74/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Build file to set up and run tests

# Change to repo root
cd $(dirname $0)/../../..

# Prepare worker environment to run tests
source kokoro/macos/prepare_build_macos_rc

# Install Dependencies
brew install coreutils [email protected]

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

# Test
./tests.sh php_mac
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/php74/build.sh"
timeout_mins: 1440
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.0_mac/build.sh"
build_file: "protobuf/kokoro/macos/php74/build.sh"
timeout_mins: 1440
20 changes: 20 additions & 0 deletions kokoro/macos/php80/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Build file to set up and run tests

# Change to repo root
cd $(dirname $0)/../../..

# Prepare worker environment to run tests
source kokoro/macos/prepare_build_macos_rc

# Install Dependencies
brew install coreutils [email protected]

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

# Test
./tests.sh php_mac
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.0_mac/build.sh"
build_file: "protobuf/kokoro/macos/php80/build.sh"
timeout_mins: 1440
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
36 changes: 18 additions & 18 deletions kokoro/macos/prepare_build_macos_rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@

set -eux

export HOMEBREW_PREFIX=$(brew --prefix)

##
# Select Xcode version

# Remember to update the Xcode version when Xcode_11.3.app is not available.
# If xcode is not available, it will probably encounter the failure for
# "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
export DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer
sudo xcode-select -s "${DEVELOPER_DIR}"

##
# Select C/C++ compilers

export CC=gcc
export CXX=g++
# Use Python 2 by default (for googletest)
pyenv global 2.7.18

##
# Install Tox
Expand All @@ -27,14 +23,18 @@ if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then
fi

##
# Install RVM

# Setup RVM
if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-cask
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-services
sudo chown -R $(whoami) $HOME/.rvm/
fi

# Old OpenSSL versions cannot handle the SSL certificate used by
# https://get.rvm.io, so as a workaround we download RVM directly from
# GitHub. See this issue for details: https://github.com/rvm/rvm/issues/5133
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s master --ruby
# "Install" valgrind if it doesn't exist
##
if [ ! -x "$(command -v valgrind)" ]; then
echo "#! /bin/bash" > valgrind
chmod ug+x valgrind
sudo mv valgrind /usr/local/bin/valgrind
fi
9 changes: 1 addition & 8 deletions kokoro/release/ruby/macos/ruby/ruby_build_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ set -ex

set +ex # rvm script is very verbose and exits with errorcode

curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -

# Old OpenSSL versions cannot handle the SSL certificate used by
# https://get.rvm.io, so as a workaround we download RVM directly from
# GitHub. See this issue for details: https://github.com/rvm/rvm/issues/5133
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s master --ruby

sudo chown -R $(whoami) $HOME/.rvm/
source $HOME/.rvm/scripts/rvm
set -e # rvm commands are very verbose
time rvm install 2.5.0
Expand Down
8 changes: 4 additions & 4 deletions objectivec/GPBApi.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion objectivec/GPBFieldMask.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBStruct.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions objectivec/GPBType.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions objectivec/generate_well_known_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ for PROTO_FILE in "${RUNTIME_PROTO_FILES[@]}"; do
if ! diff "${ObjCDir}/GPB${OBJC_NAME}${EXT}" "${TMP_DIR}/${DIR}/${OBJC_NAME}${EXT}" > /dev/null 2>&1 ; then
if [[ "${CHECK_ONLY}" == 1 ]] ; then
echo "ERROR: The WKTs need to be regenerated! Run $0"
diff -u "${ObjCDir}/GPB${OBJC_NAME}${EXT}" "${TMP_DIR}/${DIR}/${OBJC_NAME}${EXT}"
exit 1
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void RepeatedFieldGenerator::GeneratePropertyDeclaration(
"$comments$"
"$array_comment$"
"@property(nonatomic, readwrite, strong, null_resettable) $array_property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n"
"/** The number of items in @c $name$ without causing the array to be created. */\n"
"/** The number of items in @c $name$ without causing the container to be created. */\n"
"@property(nonatomic, readonly) NSUInteger $name$_Count$deprecated_attribute$;\n");
if (IsInitName(variables_.find("name")->second)) {
// If property name starts with init we need to annotate it to get past ARC.
Expand Down
41 changes: 1 addition & 40 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -490,47 +490,8 @@ build_php_c() {
test_php_c
}

build_php7.0_mac() {
build_php_mac() {
internal_build_cpp
# Install PHP
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0
PHP_FOLDER=`find /usr/local -type d -name "php5-7.0*"` # The folder name may change upon time
test ! -z "$PHP_FOLDER"
export PATH="$PHP_FOLDER/bin:$PATH"

# 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

# Install valgrind
echo "#! /bin/bash" > valgrind
chmod ug+x valgrind
sudo mv valgrind /usr/local/bin/valgrind

# Test
test_php_c
}

build_php7.3_mac() {
internal_build_cpp
# Install PHP
# We can't test PHP 7.4 with these binaries yet:
# https://github.com/liip/php-osx/issues/276
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3
PHP_FOLDER=`find /usr/local -type d -name "php5-7.3*"` # The folder name may change upon time
test ! -z "$PHP_FOLDER"
export PATH="$PHP_FOLDER/bin:$PATH"

# 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

# Install valgrind
echo "#! /bin/bash" > valgrind
chmod ug+x valgrind
sudo mv valgrind /usr/local/bin/valgrind

# Test
test_php_c
}

Expand Down