Support pre-built binaries for Ruby 3.1 (#29000)

* Support pre-built binaries for Ruby 3.1

* use 3.1.0

* use 3.1.0 and install 3.1 in build files

* fix

* update gemspec template

* fix naming of variable

* Fix ruby 3.1 link

Co-authored-by: Jan Tattermusch <jtattermusch@users.noreply.github.com>
pull/29330/head
Marco Concetto Rudilosso 3 years ago committed by GitHub
parent 5c35dbed93
commit 06e2fcc6c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Rakefile
  2. 2
      grpc.gemspec
  3. 2
      templates/grpc.gemspec.template
  4. 17
      tools/distrib/build_ruby_environment_macos.sh
  5. 2
      tools/internal_ci/helper_scripts/prepare_build_macos_rc

@ -141,7 +141,7 @@ task 'gem:native', [:plat] do |t, args|
verbose = ENV['V'] || '0' verbose = ENV['V'] || '0'
grpc_config = ENV['GRPC_CONFIG'] || 'opt' grpc_config = ENV['GRPC_CONFIG'] || 'opt'
ruby_cc_versions = ['3.0.0', '2.7.0', '2.6.0', '2.5.0'].join(':') ruby_cc_versions = ['3.1.0', '3.0.0', '2.7.0', '2.6.0', '2.5.0'].join(':')
selected_plat = "#{args[:plat]}" selected_plat = "#{args[:plat]}"
if RUBY_PLATFORM =~ /darwin/ if RUBY_PLATFORM =~ /darwin/

2
grpc.gemspec generated

@ -41,7 +41,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov', '~> 0.14.1' s.add_development_dependency 'simplecov', '~> 0.14.1'
s.add_development_dependency 'rake', '~> 13.0' s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rake-compiler', '<= 1.1.1' s.add_development_dependency 'rake-compiler', '<= 1.1.1'
s.add_development_dependency 'rake-compiler-dock', '~> 1.1' s.add_development_dependency 'rake-compiler-dock', '~> 1.2'
s.add_development_dependency 'rspec', '~> 3.6' s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rubocop', '~> 0.49.1' s.add_development_dependency 'rubocop', '~> 0.49.1'
s.add_development_dependency 'signet', '~> 0.7' s.add_development_dependency 'signet', '~> 0.7'

@ -43,7 +43,7 @@
s.add_development_dependency 'simplecov', '~> 0.14.1' s.add_development_dependency 'simplecov', '~> 0.14.1'
s.add_development_dependency 'rake', '~> 13.0' s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rake-compiler', '<= 1.1.1' s.add_development_dependency 'rake-compiler', '<= 1.1.1'
s.add_development_dependency 'rake-compiler-dock', '~> 1.1' s.add_development_dependency 'rake-compiler-dock', '~> 1.2'
s.add_development_dependency 'rspec', '~> 3.6' s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rubocop', '~> 0.49.1' s.add_development_dependency 'rubocop', '~> 0.49.1'
s.add_development_dependency 'signet', '~> 0.7' s.add_development_dependency 'signet', '~> 0.7'

@ -51,8 +51,8 @@ EOF
MAKE="make -j8" MAKE="make -j8"
# Install ruby 3.0.0 for rake-compiler
# Download ruby 3.0.0 sources outside of the cross-ruby.rake file, since the # Download ruby 3.0.0 and 3.1.0 sources outside of the cross-ruby.rake file, since the
# latest rake-compiler/v1.1.1 cross-ruby.rake file requires tar.bz2 source # latest rake-compiler/v1.1.1 cross-ruby.rake file requires tar.bz2 source
# files. # files.
# TODO(apolcyn): remove this hack when tar.bz2 sources are available for ruby # TODO(apolcyn): remove this hack when tar.bz2 sources are available for ruby
@ -60,6 +60,19 @@ MAKE="make -j8"
# https://stackoverflow.com/questions/65477613/rvm-where-is-ruby-3-0-0. # https://stackoverflow.com/questions/65477613/rvm-where-is-ruby-3-0-0.
set +x # rvm commands are very verbose set +x # rvm commands are very verbose
source ~/.rvm/scripts/rvm source ~/.rvm/scripts/rvm
# Install ruby 3.1.0 for rake-compiler
echo "rvm use 3.1.0"
rvm use 3.1.0
set -x
RUBY_3_1_0_TAR="${HOME}/.rake-compiler/sources/ruby-3.1.0.tar.gz"
mkdir -p "$(dirname $RUBY_3_1_0_TAR)"
curl -L "https://ftp.ruby-lang.org/pub/ruby/3.1/$(basename $RUBY_3_1_0_TAR)" -o "$RUBY_3_1_0_TAR"
ccache -c
ruby --version | grep 'ruby 3.1.0'
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
bundle exec rake -f "$CROSS_RUBY" cross-ruby VERSION=3.1.0 HOST=x86_64-darwin11 MAKE="$MAKE" SOURCE="$RUBY_3_1_0_TAR"
echo "installed ruby 3.1.0 build targets"
# Install ruby 3.0.0 for rake-compiler
echo "rvm use 3.0.0" echo "rvm use 3.0.0"
rvm use 3.0.0 rvm use 3.0.0
set -x set -x

@ -78,7 +78,7 @@ then
set +x set +x
source $HOME/.rvm/scripts/rvm source $HOME/.rvm/scripts/rvm
for RUBY_VERSION in 2.5.0 2.7.0 3.0.0; do for RUBY_VERSION in 2.5.0 2.7.0 3.0.0 3.1.0; do
echo "Installing ruby-${RUBY_VERSION}" echo "Installing ruby-${RUBY_VERSION}"
time rvm install "ruby-${RUBY_VERSION}" time rvm install "ruby-${RUBY_VERSION}"
done; done;

Loading…
Cancel
Save