From fa32f8e71d2ef0cd4dd11efe64fb06db505c280f Mon Sep 17 00:00:00 2001 From: mkruskal-google Date: Tue, 19 Jul 2022 12:08:06 -0700 Subject: [PATCH 1/5] Migrating macos php builds from 7.0/7.3 to 7.4/8.0 --- kokoro/macos/php7.0_mac/build.sh | 12 ------ kokoro/macos/php7.3_mac/build.sh | 12 ------ kokoro/macos/php74/build.sh | 23 +++++++++++ .../{php7.0_mac => php74}/continuous.cfg | 2 +- .../macos/{php7.0_mac => php74}/presubmit.cfg | 2 +- kokoro/macos/php80/build.sh | 23 +++++++++++ .../{php7.3_mac => php80}/continuous.cfg | 0 .../macos/{php7.3_mac => php80}/presubmit.cfg | 0 kokoro/macos/prepare_build_macos_rc | 14 +++++-- tests.sh | 41 +------------------ 10 files changed, 60 insertions(+), 69 deletions(-) delete mode 100755 kokoro/macos/php7.0_mac/build.sh delete mode 100755 kokoro/macos/php7.3_mac/build.sh create mode 100755 kokoro/macos/php74/build.sh rename kokoro/macos/{php7.0_mac => php74}/continuous.cfg (65%) rename kokoro/macos/{php7.0_mac => php74}/presubmit.cfg (65%) create mode 100755 kokoro/macos/php80/build.sh rename kokoro/macos/{php7.3_mac => php80}/continuous.cfg (100%) rename kokoro/macos/{php7.3_mac => php80}/presubmit.cfg (100%) diff --git a/kokoro/macos/php7.0_mac/build.sh b/kokoro/macos/php7.0_mac/build.sh deleted file mode 100755 index c6717e071b7fd..0000000000000 --- a/kokoro/macos/php7.0_mac/build.sh +++ /dev/null @@ -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 diff --git a/kokoro/macos/php7.3_mac/build.sh b/kokoro/macos/php7.3_mac/build.sh deleted file mode 100755 index 2688ddbf65f00..0000000000000 --- a/kokoro/macos/php7.3_mac/build.sh +++ /dev/null @@ -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 diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh new file mode 100755 index 0000000000000..e4877818d75f6 --- /dev/null +++ b/kokoro/macos/php74/build.sh @@ -0,0 +1,23 @@ +#!/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 PHP + Composer +brew install php@7.4 composer pcre2 + +# Configure path +PHP_FOLDER=$(find /opt/homebrew -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 + +# Test +./tests.sh php_mac diff --git a/kokoro/macos/php7.0_mac/continuous.cfg b/kokoro/macos/php74/continuous.cfg similarity index 65% rename from kokoro/macos/php7.0_mac/continuous.cfg rename to kokoro/macos/php74/continuous.cfg index c2c18119207dc..cf7e80beb8bd6 100644 --- a/kokoro/macos/php7.0_mac/continuous.cfg +++ b/kokoro/macos/php74/continuous.cfg @@ -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 diff --git a/kokoro/macos/php7.0_mac/presubmit.cfg b/kokoro/macos/php74/presubmit.cfg similarity index 65% rename from kokoro/macos/php7.0_mac/presubmit.cfg rename to kokoro/macos/php74/presubmit.cfg index c2c18119207dc..cf7e80beb8bd6 100644 --- a/kokoro/macos/php7.0_mac/presubmit.cfg +++ b/kokoro/macos/php74/presubmit.cfg @@ -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 diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh new file mode 100755 index 0000000000000..8e4a4ab0ed687 --- /dev/null +++ b/kokoro/macos/php80/build.sh @@ -0,0 +1,23 @@ +#!/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 PHP + Composer +brew install php@8.0 composer pcre2 + +# Configure path +PHP_FOLDER=$(find /opt/homebrew -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 + +# Test +./tests.sh php_mac diff --git a/kokoro/macos/php7.3_mac/continuous.cfg b/kokoro/macos/php80/continuous.cfg similarity index 100% rename from kokoro/macos/php7.3_mac/continuous.cfg rename to kokoro/macos/php80/continuous.cfg diff --git a/kokoro/macos/php7.3_mac/presubmit.cfg b/kokoro/macos/php80/presubmit.cfg similarity index 100% rename from kokoro/macos/php7.3_mac/presubmit.cfg rename to kokoro/macos/php80/presubmit.cfg diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 8e0a87edbbf87..6b1af6f0c693b 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -11,13 +11,13 @@ set -eux # 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_11.3.app/Contents/Developer ## # Select C/C++ compilers -export CC=gcc -export CXX=g++ +#export CC=gcc +#export CXX=g++ ## # Install Tox @@ -38,3 +38,11 @@ if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then # 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 fi + +# "Install" valgrind +## +if [ ! -x "$(command -v valgrind)" ]; then + echo "#! /bin/bash" > valgrind + chmod ug+x valgrind + sudo mv valgrind /usr/local/bin/valgrind +fi diff --git a/tests.sh b/tests.sh index f2b481cc785bc..ecd7e12a12209 100755 --- a/tests.sh +++ b/tests.sh @@ -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 } From 88f52301ed83f1c7d7e75aa1aa44b3585c79b9eb Mon Sep 17 00:00:00 2001 From: mkruskal-google Date: Tue, 19 Jul 2022 12:17:59 -0700 Subject: [PATCH 2/5] Removing local comments --- kokoro/macos/prepare_build_macos_rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 6b1af6f0c693b..291e8d0090145 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -11,13 +11,13 @@ set -eux # 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_11.3.app/Contents/Developer ## # Select C/C++ compilers -#export CC=gcc -#export CXX=g++ +export CC=gcc +export CXX=g++ ## # Install Tox From 4715af587064264ec69e720cfaee4201c1fdc087 Mon Sep 17 00:00:00 2001 From: mkruskal-google Date: Tue, 19 Jul 2022 15:49:40 -0700 Subject: [PATCH 3/5] Fix kokoro issues --- kokoro/macos/php74/build.sh | 9 +++--- kokoro/macos/php80/build.sh | 9 +++--- kokoro/macos/php80/continuous.cfg | 2 +- kokoro/macos/php80/presubmit.cfg | 2 +- kokoro/macos/prepare_build_macos_rc | 30 +++++-------------- kokoro/macos/ruby25/build.sh | 1 - kokoro/macos/ruby26/build.sh | 1 - kokoro/macos/ruby27/build.sh | 1 - kokoro/macos/ruby30/build.sh | 1 - kokoro/macos/ruby31/build.sh | 1 - .../ruby/macos/ruby/ruby_build_environment.sh | 9 +----- objectivec/GPBApi.pbobjc.h | 8 ++--- objectivec/GPBFieldMask.pbobjc.h | 2 +- objectivec/GPBStruct.pbobjc.h | 4 +-- objectivec/GPBType.pbobjc.h | 14 ++++----- objectivec/generate_well_known_types.sh | 1 + .../compiler/objectivec/objectivec_field.cc | 2 +- 17 files changed, 37 insertions(+), 60 deletions(-) diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh index e4877818d75f6..b9f7de8f372c4 100755 --- a/kokoro/macos/php74/build.sh +++ b/kokoro/macos/php74/build.sh @@ -8,16 +8,17 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests source kokoro/macos/prepare_build_macos_rc -# Install PHP + Composer -brew install php@7.4 composer pcre2 +# Install Dependencies +brew install coreutils php@7.4 # 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 diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh index 8e4a4ab0ed687..1b4767b78a10e 100755 --- a/kokoro/macos/php80/build.sh +++ b/kokoro/macos/php80/build.sh @@ -8,16 +8,17 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests source kokoro/macos/prepare_build_macos_rc -# Install PHP + Composer -brew install php@8.0 composer pcre2 +# Install Dependencies +brew install coreutils php@8.0 # 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 diff --git a/kokoro/macos/php80/continuous.cfg b/kokoro/macos/php80/continuous.cfg index 9a717451d373b..ded43e62c57fd 100644 --- a/kokoro/macos/php80/continuous.cfg +++ b/kokoro/macos/php80/continuous.cfg @@ -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 diff --git a/kokoro/macos/php80/presubmit.cfg b/kokoro/macos/php80/presubmit.cfg index 9a717451d373b..ded43e62c57fd 100644 --- a/kokoro/macos/php80/presubmit.cfg +++ b/kokoro/macos/php80/presubmit.cfg @@ -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 diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 291e8d0090145..0bc7779794006 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -7,17 +7,12 @@ set -eux ## # 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 @@ -26,19 +21,6 @@ if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then sudo python3 -m pip install --upgrade pip tox fi -## -# Install 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 - - - # 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 -fi - # "Install" valgrind ## if [ ! -x "$(command -v valgrind)" ]; then @@ -46,3 +28,7 @@ if [ ! -x "$(command -v valgrind)" ]; then chmod ug+x valgrind sudo mv valgrind /usr/local/bin/valgrind fi + +git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core +git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask +sudo chown -R $(whoami) $HOME/.rvm/ diff --git a/kokoro/macos/ruby25/build.sh b/kokoro/macos/ruby25/build.sh index 48c894081b8dc..38e90aa75c527 100755 --- a/kokoro/macos/ruby25/build.sh +++ b/kokoro/macos/ruby25/build.sh @@ -6,7 +6,6 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby25 diff --git a/kokoro/macos/ruby26/build.sh b/kokoro/macos/ruby26/build.sh index 1b94fe1b55684..6c33ed0a7e661 100755 --- a/kokoro/macos/ruby26/build.sh +++ b/kokoro/macos/ruby26/build.sh @@ -6,7 +6,6 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby26 diff --git a/kokoro/macos/ruby27/build.sh b/kokoro/macos/ruby27/build.sh index baebdb792a6a5..16bcbd6cbd6f7 100755 --- a/kokoro/macos/ruby27/build.sh +++ b/kokoro/macos/ruby27/build.sh @@ -6,7 +6,6 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby27 diff --git a/kokoro/macos/ruby30/build.sh b/kokoro/macos/ruby30/build.sh index b1e0641c96e14..5b4f6133a72d8 100755 --- a/kokoro/macos/ruby30/build.sh +++ b/kokoro/macos/ruby30/build.sh @@ -6,7 +6,6 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby30 diff --git a/kokoro/macos/ruby31/build.sh b/kokoro/macos/ruby31/build.sh index 1b5a5a5a60eb6..198a86150a345 100644 --- a/kokoro/macos/ruby31/build.sh +++ b/kokoro/macos/ruby31/build.sh @@ -6,7 +6,6 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby31 diff --git a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh index 2a9cb1687b09d..49f279be40de5 100755 --- a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh +++ b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh @@ -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 diff --git a/objectivec/GPBApi.pbobjc.h b/objectivec/GPBApi.pbobjc.h index 871e90885a619..1848aa6a911e5 100644 --- a/objectivec/GPBApi.pbobjc.h +++ b/objectivec/GPBApi.pbobjc.h @@ -74,12 +74,12 @@ GPB_FINAL @interface GPBApi : GPBMessage /** The methods of this interface, in unspecified order. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *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 *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 *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 *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. */ diff --git a/objectivec/GPBFieldMask.pbobjc.h b/objectivec/GPBFieldMask.pbobjc.h index c4667b44db26e..b7eccff21ca6b 100644 --- a/objectivec/GPBFieldMask.pbobjc.h +++ b/objectivec/GPBFieldMask.pbobjc.h @@ -247,7 +247,7 @@ GPB_FINAL @interface GPBFieldMask : GPBMessage /** The set of field mask paths. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *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 diff --git a/objectivec/GPBStruct.pbobjc.h b/objectivec/GPBStruct.pbobjc.h index dd6ab28f0e81f..ff4eefde52ddc 100644 --- a/objectivec/GPBStruct.pbobjc.h +++ b/objectivec/GPBStruct.pbobjc.h @@ -87,7 +87,7 @@ GPB_FINAL @interface GPBStruct : GPBMessage /** Unordered map of dynamically typed values. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *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 *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 diff --git a/objectivec/GPBType.pbobjc.h b/objectivec/GPBType.pbobjc.h index b0230501cf3ce..969219f03f409 100644 --- a/objectivec/GPBType.pbobjc.h +++ b/objectivec/GPBType.pbobjc.h @@ -195,17 +195,17 @@ GPB_FINAL @interface GPBType : GPBMessage /** The list of fields. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *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 *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 *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 *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 *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 *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 *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 diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh index 1b9de6ec55eee..e6c9b044d1451 100755 --- a/objectivec/generate_well_known_types.sh +++ b/objectivec/generate_well_known_types.sh @@ -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 diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_field.cc index 004ea19fb8321..a9e651742929e 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_field.cc @@ -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. From 9debee706e27b0495deecceba56814b385d6a234 Mon Sep 17 00:00:00 2001 From: mkruskal-google Date: Wed, 20 Jul 2022 11:23:59 -0700 Subject: [PATCH 4/5] Further cleanup --- kokoro/macos/php74/build.sh | 4 ---- kokoro/macos/php80/build.sh | 4 ---- kokoro/macos/prepare_build_macos_rc | 18 ++++++++++++------ kokoro/macos/ruby25/build.sh | 1 + kokoro/macos/ruby26/build.sh | 1 + kokoro/macos/ruby27/build.sh | 1 + kokoro/macos/ruby30/build.sh | 1 + kokoro/macos/ruby31/build.sh | 1 + 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh index b9f7de8f372c4..ff3965756c770 100755 --- a/kokoro/macos/php74/build.sh +++ b/kokoro/macos/php74/build.sh @@ -12,13 +12,9 @@ source kokoro/macos/prepare_build_macos_rc brew install coreutils php@7.4 # Configure path -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 $HOMEBREW_PREFIX/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h - # Test ./tests.sh php_mac diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh index 1b4767b78a10e..84e2c464ef782 100755 --- a/kokoro/macos/php80/build.sh +++ b/kokoro/macos/php80/build.sh @@ -12,13 +12,9 @@ source kokoro/macos/prepare_build_macos_rc brew install coreutils php@8.0 # Configure path -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 $HOMEBREW_PREFIX/Cellar/pcre2 -name pcre2.h) $PHP_FOLDER/include/php/ext/pcre/pcre2.h - # Test ./tests.sh php_mac diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 0bc7779794006..7ec2832b85966 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -4,9 +4,10 @@ set -eux +export HOMEBREW_PREFIX=$(brew --prefix) + ## # Select Xcode version - export DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer sudo xcode-select -s "${DEVELOPER_DIR}" @@ -21,14 +22,19 @@ if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then sudo python3 -m pip install --upgrade pip tox fi -# "Install" valgrind +## +# Setup RVM +if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then + 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 + +# "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 - -git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core -git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask -sudo chown -R $(whoami) $HOME/.rvm/ diff --git a/kokoro/macos/ruby25/build.sh b/kokoro/macos/ruby25/build.sh index 38e90aa75c527..48c894081b8dc 100755 --- a/kokoro/macos/ruby25/build.sh +++ b/kokoro/macos/ruby25/build.sh @@ -6,6 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests +KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby25 diff --git a/kokoro/macos/ruby26/build.sh b/kokoro/macos/ruby26/build.sh index 6c33ed0a7e661..1b94fe1b55684 100755 --- a/kokoro/macos/ruby26/build.sh +++ b/kokoro/macos/ruby26/build.sh @@ -6,6 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests +KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby26 diff --git a/kokoro/macos/ruby27/build.sh b/kokoro/macos/ruby27/build.sh index 16bcbd6cbd6f7..baebdb792a6a5 100755 --- a/kokoro/macos/ruby27/build.sh +++ b/kokoro/macos/ruby27/build.sh @@ -6,6 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests +KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby27 diff --git a/kokoro/macos/ruby30/build.sh b/kokoro/macos/ruby30/build.sh index 5b4f6133a72d8..b1e0641c96e14 100755 --- a/kokoro/macos/ruby30/build.sh +++ b/kokoro/macos/ruby30/build.sh @@ -6,6 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests +KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby30 diff --git a/kokoro/macos/ruby31/build.sh b/kokoro/macos/ruby31/build.sh index 198a86150a345..1b5a5a5a60eb6 100644 --- a/kokoro/macos/ruby31/build.sh +++ b/kokoro/macos/ruby31/build.sh @@ -6,6 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests +KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc ./tests.sh ruby31 From 27c16fe1400bac2d10347f2c634c8d4ba4efccd0 Mon Sep 17 00:00:00 2001 From: mkruskal-google Date: Wed, 20 Jul 2022 11:56:37 -0700 Subject: [PATCH 5/5] Fix permissions in Ruby release test --- kokoro/release/ruby/macos/build_artifacts.sh | 3 --- kokoro/release/ruby/macos/ruby/ruby_build.sh | 1 - kokoro/release/ruby/macos/ruby/ruby_build_environment.sh | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kokoro/release/ruby/macos/build_artifacts.sh b/kokoro/release/ruby/macos/build_artifacts.sh index c68b63cc43d7d..a109d45b6166b 100755 --- a/kokoro/release/ruby/macos/build_artifacts.sh +++ b/kokoro/release/ruby/macos/build_artifacts.sh @@ -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 diff --git a/kokoro/release/ruby/macos/ruby/ruby_build.sh b/kokoro/release/ruby/macos/ruby/ruby_build.sh index 55773b21a9e5e..bbfc631197e8a 100755 --- a/kokoro/release/ruby/macos/ruby/ruby_build.sh +++ b/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 diff --git a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh index 49f279be40de5..ae973fce43506 100755 --- a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh +++ b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh @@ -4,7 +4,10 @@ set -ex set +ex # rvm script is very verbose and exits with errorcode +# 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 time rvm install 2.5.0