prepare_build_macos_rc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. #
  3. # This script sets up a Kokoro MacOS worker for running Protobuf tests
  4. set -eux
  5. ##
  6. # Select Xcode version
  7. # Remember to update the Xcode version when Xcode_11.3.app is not available.
  8. # If xcode is not available, it will probably encounter the failure for
  9. # "autom4te: need GNU m4 1.4 or later: /usr/bin/m4"
  10. # go/kokoro/userdocs/macos/selecting_xcode.md for more information.
  11. export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
  12. ##
  13. # Select C/C++ compilers
  14. export CC=gcc
  15. export CXX=g++
  16. ##
  17. # Install Tox
  18. if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then
  19. sudo python3 -m pip install --upgrade pip tox
  20. fi
  21. ##
  22. # Install RVM
  23. if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then
  24. curl -sSL https://rvm.io/mpapis.asc | gpg --import -
  25. curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
  26. # Old OpenSSL versions cannot handle the SSL certificate used by
  27. # https://get.rvm.io, so as a workaround we download RVM directly from
  28. # GitHub. See this issue for details: https://github.com/rvm/rvm/issues/5133
  29. curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable --ruby
  30. fi