Skip to content

Commit 450b648

Browse files
mkruskal-googledeannagarcia
authored andcommitted
Cherrypick ruby fixes for monterey
1 parent 55815e4 commit 450b648

File tree

8 files changed

+33
-32
lines changed

8 files changed

+33
-32
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
KOKORO_INSTALL_COCOAPODS=yes
1013
source kokoro/macos/prepare_build_macos_rc

kokoro/macos/prepare_build_macos_rc

+14-12
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
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
@@ -70,15 +71,16 @@ fi
7071
# Install Tox
7172

7273
if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then
73-
sudo python3 -m pip install --upgrade pip tox
74+
pyenv install -v -s 3.7.13
75+
pyenv global 3.7.13
76+
sudo python -m pip install --upgrade pip tox tox-pyenv
7477
fi
7578

7679
##
77-
# Install RVM
78-
80+
# Setup RVM
7981
if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then
80-
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
81-
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
82-
83-
curl -sSL https://get.rvm.io | bash -s master --ruby
82+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-cask
83+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-core
84+
git config --global --add safe.directory $HOMEBREW_PREFIX/Library/Taps/homebrew/homebrew-services
85+
sudo chown -R $(whoami) $HOME/.rvm/
8486
fi

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
source $HOME/.rvm/scripts/rvm
711
set -e # rvm commands are very verbose

objectivec/DevTools/full_mac_build.sh

+9-3
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]"
@@ -289,7 +290,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
289290
-disable-concurrent-destination-testing
290291
)
291292
;;
292-
11.* | 12.*)
293+
11.* | 12.* | 13.*)
293294
# Dropped 32bit as Apple doesn't seem support the simulators either.
294295
XCODEBUILD_TEST_BASE_IOS+=(
295296
-destination "platform=iOS Simulator,name=iPhone 8,OS=latest" # 64bit
@@ -357,6 +358,11 @@ if [[ "${DO_XCODE_TVOS_TESTS}" == "yes" ]] ; then
357358
-destination "platform=tvOS Simulator,name=Apple TV 4K,OS=latest"
358359
)
359360
;;
361+
13.*)
362+
XCODEBUILD_TEST_BASE_TVOS+=(
363+
-destination "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=latest"
364+
)
365+
;;
360366
* )
361367
echo ""
362368
echo "ATTENTION: Time to update the simulator targets for Xcode ${XCODE_VERSION}"

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)