Parcourir la source

Fixed CI failures with Ruby 2.3 on OSX (#5948)

OSX has deprecated OpenSSL, so we need to install it via Homebrew and
build against that version when we build Ruby.
Adam Cozzette il y a 6 ans
Parent
commit
077079573f
2 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 1 1
      kokoro/macos/prepare_build_macos_rc
  2. 4 1
      ruby/travis-test.sh

+ 1 - 1
kokoro/macos/prepare_build_macos_rc

@@ -23,7 +23,7 @@ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/
 source $HOME/.rvm/scripts/rvm
 source $HOME/.rvm/scripts/rvm
 brew uninstall node icu4c cmake
 brew uninstall node icu4c cmake
 brew prune
 brew prune
-brew install gflags gpg gpg2 node pcre ruby cmake
+brew install gflags gpg gpg2 node openssl pcre ruby cmake
 sudo chown -R $(whoami) /usr/local
 sudo chown -R $(whoami) /usr/local
 brew postinstall node
 brew postinstall node
 
 

+ 4 - 1
ruby/travis-test.sh

@@ -36,8 +36,11 @@ test_version() {
        cd ../ruby/compatibility_tests/v3.0.0 &&
        cd ../ruby/compatibility_tests/v3.0.0 &&
        cp -R ../../lib lib && ./test.sh"
        cp -R ../../lib lib && ./test.sh"
   else
   else
+    # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
+    # provide a path to the OpenSSL directory installed via Homebrew.
     bash --login -c \
     bash --login -c \
-      "rvm install $version && rvm use $version && \
+      "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
+       rvm use $version && \
        which ruby && \
        which ruby && \
        git clean -f && \
        git clean -f && \
        gem install bundler -v 1.17.3 && bundle && \
        gem install bundler -v 1.17.3 && bundle && \