From 8a0aa4b3721f89fdbfae57c1dcbc4ef7bed733a8 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Fri, 15 Oct 2021 14:41:59 -0700 Subject: [PATCH 1/2] Update Mac test runs to download RVM directly from GitHub (#9107) Our Mac test runs recently started failing to download RVM. The issue appears to be a combination of an SSL certificate expiring and old OpenSSL versions having a bug preventing them from validating the replacement certificate: https://github.com/rvm/rvm/issues/5133 This commit works around the problem by downloading RVM from GitHub as suggested in one of the comments on the issue above. --- kokoro/macos/prepare_build_macos_rc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index ef428fcda30c..c0017b64ac82 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -33,5 +33,8 @@ if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then curl -sSL https://rvm.io/mpapis.asc | gpg --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - - curl -sSL https://get.rvm.io | bash -s stable --ruby + # Old OpenSSL versions cannot handle the SSL certificate used by + # 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 stable --ruby fi From 1fe07f9ce2e98ca66a403b989d78a060f3153d5b Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 22 Dec 2021 15:01:34 -0800 Subject: [PATCH 2/2] Cherry-pick fix from #9311 into 3.18.x (#9320) * Dropped Ruby 2.4 support for CI and releases. * Removed Kokoro configs for old Ruby versions. * Update Dockerfile to allow it to be rebuilt Co-authored-by: Joshua Haberman --- kokoro/linux/dockerfile/test/ruby/Dockerfile | 6 ++---- kokoro/linux/ruby23/build.sh | 18 ------------------ kokoro/linux/ruby23/continuous.cfg | 11 ----------- kokoro/linux/ruby23/presubmit.cfg | 11 ----------- kokoro/linux/ruby24/build.sh | 18 ------------------ kokoro/linux/ruby24/continuous.cfg | 11 ----------- kokoro/linux/ruby24/presubmit.cfg | 11 ----------- kokoro/macos/ruby23/build.sh | 12 ------------ kokoro/macos/ruby23/continuous.cfg | 5 ----- kokoro/macos/ruby23/presubmit.cfg | 5 ----- kokoro/macos/ruby24/build.sh | 12 ------------ kokoro/macos/ruby24/continuous.cfg | 5 ----- kokoro/macos/ruby24/presubmit.cfg | 5 ----- .../ruby/macos/ruby/ruby_build_environment.sh | 2 +- ruby/Gemfile | 2 -- ruby/Rakefile | 4 ++-- 16 files changed, 5 insertions(+), 133 deletions(-) delete mode 100755 kokoro/linux/ruby23/build.sh delete mode 100644 kokoro/linux/ruby23/continuous.cfg delete mode 100644 kokoro/linux/ruby23/presubmit.cfg delete mode 100755 kokoro/linux/ruby24/build.sh delete mode 100644 kokoro/linux/ruby24/continuous.cfg delete mode 100644 kokoro/linux/ruby24/presubmit.cfg delete mode 100755 kokoro/macos/ruby23/build.sh delete mode 100644 kokoro/macos/ruby23/continuous.cfg delete mode 100644 kokoro/macos/ruby23/presubmit.cfg delete mode 100755 kokoro/macos/ruby24/build.sh delete mode 100644 kokoro/macos/ruby24/continuous.cfg delete mode 100644 kokoro/macos/ruby24/presubmit.cfg diff --git a/kokoro/linux/dockerfile/test/ruby/Dockerfile b/kokoro/linux/dockerfile/test/ruby/Dockerfile index b73bf84095a7..e8a70d5fee41 100644 --- a/kokoro/linux/dockerfile/test/ruby/Dockerfile +++ b/kokoro/linux/dockerfile/test/ruby/Dockerfile @@ -23,13 +23,11 @@ RUN apt-get update && apt-get install -y \ && apt-get clean # Install rvm -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys \ +RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys \ 409B6B1796C275462A1703113804BB82D39DC0E3 \ 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN \curl -sSL https://get.rvm.io | bash -s master +RUN \curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s master -RUN /bin/bash -l -c "rvm install 2.3.8" -RUN /bin/bash -l -c "rvm install 2.4.5" RUN /bin/bash -l -c "rvm install 2.5.1" RUN /bin/bash -l -c "rvm install 2.6.0" RUN /bin/bash -l -c "rvm install 2.7.0" diff --git a/kokoro/linux/ruby23/build.sh b/kokoro/linux/ruby23/build.sh deleted file mode 100755 index 503a320de22e..000000000000 --- a/kokoro/linux/ruby23/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby23" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby23/continuous.cfg b/kokoro/linux/ruby23/continuous.cfg deleted file mode 100644 index f5c64988bfc7..000000000000 --- a/kokoro/linux/ruby23/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby23/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby23/presubmit.cfg b/kokoro/linux/ruby23/presubmit.cfg deleted file mode 100644 index f5c64988bfc7..000000000000 --- a/kokoro/linux/ruby23/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby23/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby24/build.sh b/kokoro/linux/ruby24/build.sh deleted file mode 100755 index 68585aabc0a5..000000000000 --- a/kokoro/linux/ruby24/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby24" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby24/continuous.cfg b/kokoro/linux/ruby24/continuous.cfg deleted file mode 100644 index a1ccfc0b8ba8..000000000000 --- a/kokoro/linux/ruby24/continuous.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby24/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/linux/ruby24/presubmit.cfg b/kokoro/linux/ruby24/presubmit.cfg deleted file mode 100644 index a1ccfc0b8ba8..000000000000 --- a/kokoro/linux/ruby24/presubmit.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby24/build.sh" -timeout_mins: 120 - -action { - define_artifacts { - regex: "**/sponge_log.xml" - } -} diff --git a/kokoro/macos/ruby23/build.sh b/kokoro/macos/ruby23/build.sh deleted file mode 100755 index 5a29a997fc2f..000000000000 --- a/kokoro/macos/ruby23/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby23 diff --git a/kokoro/macos/ruby23/continuous.cfg b/kokoro/macos/ruby23/continuous.cfg deleted file mode 100644 index c9b1f61284af..000000000000 --- a/kokoro/macos/ruby23/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby23/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby23/presubmit.cfg b/kokoro/macos/ruby23/presubmit.cfg deleted file mode 100644 index c9b1f61284af..000000000000 --- a/kokoro/macos/ruby23/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby23/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby24/build.sh b/kokoro/macos/ruby24/build.sh deleted file mode 100755 index 10ac85f7a4fc..000000000000 --- a/kokoro/macos/ruby24/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -# Prepare worker environment to run tests -KOKORO_INSTALL_RVM=yes -source kokoro/macos/prepare_build_macos_rc - -./tests.sh ruby24 diff --git a/kokoro/macos/ruby24/continuous.cfg b/kokoro/macos/ruby24/continuous.cfg deleted file mode 100644 index fada028fc502..000000000000 --- a/kokoro/macos/ruby24/continuous.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby24/build.sh" -timeout_mins: 1440 diff --git a/kokoro/macos/ruby24/presubmit.cfg b/kokoro/macos/ruby24/presubmit.cfg deleted file mode 100644 index fada028fc502..000000000000 --- a/kokoro/macos/ruby24/presubmit.cfg +++ /dev/null @@ -1,5 +0,0 @@ -# Config file for running tests in Kokoro - -# Location of the build script in repository -build_file: "protobuf/kokoro/macos/ruby24/build.sh" -timeout_mins: 1440 diff --git a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh index 046b604b40e1..8d9308d57da8 100755 --- a/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh +++ b/kokoro/release/ruby/macos/ruby/ruby_build_environment.sh @@ -66,7 +66,7 @@ set +x rvm use 2.5.0 set -x ruby --version | grep 'ruby 2.5.0' -for v in 2.6.0 2.5.1 2.4.0 2.3.0; do +for v in 2.6.0 2.5.1; do ccache -c rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE" done diff --git a/ruby/Gemfile b/ruby/Gemfile index 76b23ad91d1e..fa75df156323 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -1,5 +1,3 @@ source 'https://rubygems.org' gemspec - -gem "irb", "~> 1.1", "< 1.2.0" if RUBY_VERSION < "2.5" diff --git a/ruby/Rakefile b/ruby/Rakefile index c7187a6a8989..5e788c7810c4 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -100,7 +100,7 @@ else ['x86-mingw32', 'x64-mingw32', 'x86_64-linux', 'x86-linux'].each do |plat| RakeCompilerDock.sh <<-"EOT", platform: plat bundle && \ - IN_DOCKER=true rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0 + IN_DOCKER=true rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0 EOT end end @@ -108,7 +108,7 @@ else if RUBY_PLATFORM =~ /darwin/ task 'gem:native' do system "rake genproto" - system "rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.1:2.4.0:2.3.0" + system "rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.1" end else task 'gem:native' => [:genproto, 'gem:windows']