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

* Migrating macos php builds from 7.0/7.3 to 7.4/8.0

* Removing local comments

* Fix kokoro issues

* Further cleanup

* Fix permissions in Ruby release test
pull/10293/head
Mike Kruskal 2 years ago committed by GitHub
parent b3f2270de1
commit 7ff876d758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      kokoro/macos/php7.0_mac/build.sh
  2. 12
      kokoro/macos/php7.3_mac/build.sh
  3. 20
      kokoro/macos/php74/build.sh
  4. 2
      kokoro/macos/php74/continuous.cfg
  5. 2
      kokoro/macos/php74/presubmit.cfg
  6. 20
      kokoro/macos/php80/build.sh
  7. 2
      kokoro/macos/php80/continuous.cfg
  8. 2
      kokoro/macos/php80/presubmit.cfg
  9. 36
      kokoro/macos/prepare_build_macos_rc
  10. 3
      kokoro/release/ruby/macos/build_artifacts.sh
  11. 1
      kokoro/release/ruby/macos/ruby/ruby_build.sh
  12. 10
      kokoro/release/ruby/macos/ruby/ruby_build_environment.sh
  13. 8
      objectivec/GPBApi.pbobjc.h
  14. 2
      objectivec/GPBFieldMask.pbobjc.h
  15. 4
      objectivec/GPBStruct.pbobjc.h
  16. 14
      objectivec/GPBType.pbobjc.h
  17. 1
      objectivec/generate_well_known_types.sh
  18. 41
      tests.sh

@ -1,12 +0,0 @@
#!/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
# TODO(mkruskal) Re-enable this once we can get a working PHP 7.0 installed.
#./tests.sh php7.0_mac

@ -1,12 +0,0 @@
#!/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
# TODO(mkruskal) Re-enable this once we can get a working PHP 7.0 installed.
#./tests.sh php7.3_mac

@ -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 php@7.4
# 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

@ -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

@ -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

@ -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 php@8.0
# 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

@ -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

@ -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

@ -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
@ -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

@ -12,8 +12,5 @@ export ARTIFACT_DIR=$(pwd)/artifacts
# ruby environment
bash kokoro/release/ruby/macos/ruby/ruby_build_environment.sh
gem install rubygems-update
update_rubygems
# build artifacts
bash kokoro/release/ruby/macos/ruby/ruby_build.sh

@ -3,7 +3,6 @@
set -ex
# Build protoc
use_bazel.sh 5.1.1
bazel build //:protoc
export PROTOC=$PWD/bazel-bin/protoc

@ -4,13 +4,9 @@ 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
# Fix permissions
sudo chown -R $(whoami) $HOME/.rvm/
sudo chown -R $(whoami) /Library/Ruby/
source $HOME/.rvm/scripts/rvm
set -e # rvm commands are very verbose

@ -74,12 +74,12 @@ GPB_FINAL @interface GPBApi : GPBMessage
/** The methods of this interface, in unspecified order. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMethod*> *methodsArray;
/** The number of items in @c methodsArray without causing the array to be created. */
/** The number of items in @c methodsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger methodsArray_Count;
/** Any metadata attached to the interface. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
/**
@ -115,7 +115,7 @@ GPB_FINAL @interface GPBApi : GPBMessage
/** Included interfaces. See [Mixin][]. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMixin*> *mixinsArray;
/** The number of items in @c mixinsArray without causing the array to be created. */
/** The number of items in @c mixinsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger mixinsArray_Count;
/** The source syntax of the service. */
@ -169,7 +169,7 @@ GPB_FINAL @interface GPBMethod : GPBMessage
/** Any metadata attached to the method. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
/** The source syntax of this method. */

@ -247,7 +247,7 @@ GPB_FINAL @interface GPBFieldMask : GPBMessage
/** The set of field mask paths. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *pathsArray;
/** The number of items in @c pathsArray without causing the array to be created. */
/** The number of items in @c pathsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger pathsArray_Count;
@end

@ -87,7 +87,7 @@ GPB_FINAL @interface GPBStruct : GPBMessage
/** Unordered map of dynamically typed values. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, GPBValue*> *fields;
/** The number of items in @c fields without causing the array to be created. */
/** The number of items in @c fields without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger fields_Count;
@end
@ -178,7 +178,7 @@ GPB_FINAL @interface GPBListValue : GPBMessage
/** Repeated field of dynamically typed values. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBValue*> *valuesArray;
/** The number of items in @c valuesArray without causing the array to be created. */
/** The number of items in @c valuesArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger valuesArray_Count;
@end

@ -195,17 +195,17 @@ GPB_FINAL @interface GPBType : GPBMessage
/** The list of fields. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBField*> *fieldsArray;
/** The number of items in @c fieldsArray without causing the array to be created. */
/** The number of items in @c fieldsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger fieldsArray_Count;
/** The list of types appearing in `oneof` definitions in this type. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *oneofsArray;
/** The number of items in @c oneofsArray without causing the array to be created. */
/** The number of items in @c oneofsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger oneofsArray_Count;
/** The protocol buffer options. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
/** The source context. */
@ -279,7 +279,7 @@ GPB_FINAL @interface GPBField : GPBMessage
/** The protocol buffer options. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
/** The field JSON name. */
@ -334,12 +334,12 @@ GPB_FINAL @interface GPBEnum : GPBMessage
/** Enum value definitions. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBEnumValue*> *enumvalueArray;
/** The number of items in @c enumvalueArray without causing the array to be created. */
/** The number of items in @c enumvalueArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger enumvalueArray_Count;
/** Protocol buffer options. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
/** The source context. */
@ -385,7 +385,7 @@ GPB_FINAL @interface GPBEnumValue : GPBMessage
/** Protocol buffer options. */
@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
/** The number of items in @c optionsArray without causing the array to be created. */
/** The number of items in @c optionsArray without causing the container to be created. */
@property(nonatomic, readonly) NSUInteger optionsArray_Count;
@end

@ -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

@ -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
}

Loading…
Cancel
Save