Fix Kokoro tests to work on Monterey machines (#10473)

* Disabling broken mac php tests

* Fix ruby permissions after Monterey upgrade

* Install m4 via Homebrew

* Adding ruby/python fixes to presubmits

* Adding homebrew prefix command

* More fixes for objc, python, and benchmark build

* Properly disabling C++ benchmark warning

* Use python 2 for testing

* Splitting venv and python 2

* Setup tox-pyenv

* Silencing more warnings

* Cleanup

* Upgrade python tests to 3.7 on mac

* Switch to python 2 by default (googletest requires it)

* Remove venv for python tests, use python 3.7

* Disable all compiler warnings for benchmark builds

* Enable benchmark LTO to silence warnings

* Fix locale issues in cocoapods

* Remove benchmark build from C++ tests

* Removing deprecated use_bazel command

Removing python 3.6 mac build, since Monterey doesn't support it
pull/10510/head
Mike Kruskal 2 years ago committed by GitHub
parent 2fb33f46a6
commit 40847c7ee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      benchmarks/Makefile.am
  2. 35
      kokoro/macos/prepare_build_macos_rc
  3. 3
      kokoro/macos/ruby31/build.sh
  4. 1
      kokoro/release/python/macos/build_artifacts.sh
  5. 3
      kokoro/release/ruby/macos/build_artifacts.sh
  6. 1
      kokoro/release/ruby/macos/ruby/ruby_build.sh
  7. 4
      kokoro/release/ruby/macos/ruby/ruby_build_environment.sh
  8. 11
      tests.sh

@ -91,8 +91,8 @@ $(benchmarks_protoc_outputs_proto2_header): protoc_middleman2
initialize_submodule: initialize_submodule:
oldpwd=`pwd` oldpwd=`pwd`
cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \ cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && cd third_party/benchmark \
cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cmake -DCMAKE_BUILD_TYPE=Release && make
cd $$oldpwd cd $$oldpwd
touch initialize_submodule touch initialize_submodule

@ -4,14 +4,15 @@
set -eux set -eux
export HOMEBREW_PREFIX=$(brew --prefix)
## ##
# Select Xcode version # 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 # Select Xcode version
# "autom4te: need GNU m4 1.4 or later: /usr/bin/m4" export DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer
# go/kokoro/userdocs/macos/selecting_xcode.md for more information. sudo xcode-select -s "${DEVELOPER_DIR}"
export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
## ##
# Select C/C++ compilers # Select C/C++ compilers
@ -19,22 +20,26 @@ export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
export CC=gcc export CC=gcc
export CXX=g++ export CXX=g++
##
# Install Python 2 by default
eval "$(pyenv init -)"
pyenv install -v -s 2.7.18 && pyenv global 2.7.18
## ##
# Install Tox # Install Tox
if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then
sudo python3 -m pip install --upgrade pip tox pyenv install -v -s 3.7.13
pyenv global 3.7.13
sudo python -m pip install --upgrade pip tox tox-pyenv
fi fi
## ##
# Install RVM # Setup RVM
if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then
curl -sSL https://rvm.io/mpapis.asc | gpg --import - git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-cask
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - 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
# Old OpenSSL versions cannot handle the SSL certificate used by sudo chown -R $(whoami) $HOME/.rvm/
# 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 fi

@ -5,6 +5,9 @@
# Change to repo root # Change to repo root
cd $(dirname $0)/../../.. cd $(dirname $0)/../../..
# Fix locale issues in Monterey.
export LC_ALL=en_US.UTF-8
# Prepare worker environment to run tests # Prepare worker environment to run tests
KOKORO_INSTALL_RVM=yes KOKORO_INSTALL_RVM=yes
source kokoro/macos/prepare_build_macos_rc source kokoro/macos/prepare_build_macos_rc

@ -58,7 +58,6 @@ build_artifact_version() {
} }
export MB_PYTHON_OSX_VER=10.9 export MB_PYTHON_OSX_VER=10.9
build_artifact_version 3.6
build_artifact_version 3.7 build_artifact_version 3.7
build_artifact_version 3.8 build_artifact_version 3.8
build_artifact_version 3.9 build_artifact_version 3.9

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

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

@ -2,6 +2,10 @@
set -ex set -ex
# Fix permissions
sudo chown -R $(whoami) $HOME/.rvm/
sudo chown -R $(whoami) /Library/Ruby/
set +ex # rvm script is very verbose and exits with errorcode 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/mpapis.asc | gpg --import -

@ -23,17 +23,6 @@ build_cpp() {
internal_build_cpp internal_build_cpp
make check -j$(nproc) || (cat src/test-suite.log; false) make check -j$(nproc) || (cat src/test-suite.log; false)
cd conformance && make test_cpp && cd .. cd conformance && make test_cpp && cd ..
# The benchmark code depends on cmake, so test if it is installed before
# trying to do the build.
if [[ $(type cmake 2>/dev/null) ]]; then
# Verify benchmarking code can build successfully.
cd benchmarks && make cpp-benchmark && cd ..
else
echo ""
echo "WARNING: Skipping validation of the benchmarking code, cmake isn't installed."
echo ""
fi
} }
build_cpp_tcmalloc() { build_cpp_tcmalloc() {

Loading…
Cancel
Save