Skip to content

Commit 50bdb17

Browse files
Fix Kokoro tests to work on Monterey machines (#10474)
* 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 * Upgrade iOS simulator for cocoapods * Remove benchmark build from C++ tests * Removing python 3.6 mac build, since Monterey doesn't support it
1 parent fb6f8da commit 50bdb17

File tree

9 files changed

+33
-35
lines changed

9 files changed

+33
-35
lines changed

benchmarks/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ $(benchmarks_protoc_outputs_proto2_header): protoc_middleman2
9191

9292
initialize_submodule:
9393
oldpwd=`pwd`
94-
cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \
95-
cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make
94+
cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && cd third_party/benchmark \
95+
&& cmake -DCMAKE_BUILD_TYPE=Release && make
9696
cd $$oldpwd
9797
touch initialize_submodule
9898

kokoro/macos/objectivec_cocoapods_integration/build.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Change to repo root
66
cd $(dirname $0)/../../..
77

8+
# Fix locale issues in Monterey.
9+
export LC_ALL=en_US.UTF-8
10+
811
# Prepare worker environment to run tests
912
source kokoro/macos/prepare_build_macos_rc
1013

kokoro/macos/prepare_build_macos_rc

+20-15
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,42 @@
44

55
set -eux
66

7+
export HOMEBREW_PREFIX=$(brew --prefix)
8+
79
##
810
# Select Xcode version
911

10-
# Remember to update the Xcode version when Xcode_11.3.app is not available.
11-
# If xcode is not available, it will probably encounter the failure for
12-
# "autom4te: need GNU m4 1.4 or later: /usr/bin/m4"
13-
# go/kokoro/userdocs/macos/selecting_xcode.md for more information.
14-
export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
12+
##
13+
# Select Xcode version
14+
export DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer
15+
sudo xcode-select -s "${DEVELOPER_DIR}"
1516

1617
##
1718
# Select C/C++ compilers
1819

1920
export CC=gcc
2021
export CXX=g++
2122

23+
##
24+
# Install Python 2 by default
25+
26+
eval "$(pyenv init -)"
27+
pyenv install -v -s 2.7.18 && pyenv global 2.7.18
28+
2229
##
2330
# Install Tox
2431

2532
if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then
26-
sudo python3 -m pip install --upgrade pip tox
33+
pyenv install -v -s 3.7.13
34+
pyenv global 3.7.13
35+
sudo python -m pip install --upgrade pip tox tox-pyenv
2736
fi
2837

2938
##
30-
# Install RVM
31-
39+
# Setup RVM
3240
if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then
33-
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
34-
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
35-
36-
# Old OpenSSL versions cannot handle the SSL certificate used by
37-
# https://get.rvm.io, so as a workaround we download RVM directly from
38-
# GitHub. See this issue for details: https://github.com/rvm/rvm/issues/5133
39-
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s master --ruby
41+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-cask
42+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-core
43+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-services
44+
sudo chown -R $(whoami) $HOME/.rvm/
4045
fi

kokoro/release/python/macos/build_artifacts.sh

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ build_artifact_version() {
5858
}
5959

6060
export MB_PYTHON_OSX_VER=10.9
61-
build_artifact_version 3.6
6261
build_artifact_version 3.7
6362
build_artifact_version 3.8
6463
build_artifact_version 3.9

kokoro/release/ruby/macos/build_artifacts.sh

-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ export ARTIFACT_DIR=$(pwd)/artifacts
1212
# ruby environment
1313
bash kokoro/release/ruby/macos/ruby/ruby_build_environment.sh
1414

15-
gem install rubygems-update
16-
update_rubygems
17-
1815
# build artifacts
1916
bash kokoro/release/ruby/macos/ruby/ruby_build.sh

kokoro/release/ruby/macos/ruby/ruby_build_environment.sh

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -ex
44

5+
# Fix permissions
6+
sudo chown -R $(whoami) $HOME/.rvm/
7+
sudo chown -R $(whoami) /Library/Ruby/
8+
59
set +ex # rvm script is very verbose and exits with errorcode
610

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

objectivec/DevTools/full_mac_build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ fi
234234
objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}"
235235

236236
header "Checking on the ObjC Runtime Code"
237-
objectivec/DevTools/pddm_tests.py
238-
if ! objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
237+
LOCAL_PYTHON=python
238+
"${LOCAL_PYTHON}" objectivec/DevTools/pddm_tests.py
239+
if ! "${LOCAL_PYTHON}" objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
239240
echo ""
240241
echo "Update by running:"
241242
echo " objectivec/DevTools/pddm.py objectivec/*.[hm] objectivec/Tests/*.[hm]"

objectivec/Tests/CocoaPods/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ do_test() {
128128
# errors.
129129
xcodebuild_args+=(
130130
-sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
131-
-destination "platform=iOS Simulator,name=iPad 2,OS=9.3"
131+
-destination "platform=iOS Simulator,name=iPad Air (5th generation),OS=15.4"
132132
)
133133
fi
134134

tests.sh

-11
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@ build_cpp() {
2727
internal_build_cpp
2828
make check -j$(nproc) || (cat src/test-suite.log; false)
2929
cd conformance && make test_cpp && cd ..
30-
31-
# The benchmark code depends on cmake, so test if it is installed before
32-
# trying to do the build.
33-
if [[ $(type cmake 2>/dev/null) ]]; then
34-
# Verify benchmarking code can build successfully.
35-
cd benchmarks && make cpp-benchmark && cd ..
36-
else
37-
echo ""
38-
echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed."
39-
echo ""
40-
fi
4130
}
4231

4332
build_cpp_tcmalloc() {

0 commit comments

Comments
 (0)