diff --git a/Rakefile b/Rakefile index 584210e8f8b..c4cb31438b0 100755 --- a/Rakefile +++ b/Rakefile @@ -121,6 +121,7 @@ task 'gem:native' do verbose = ENV['V'] || '0' grpc_config = ENV['GRPC_CONFIG'] || 'opt' + ruby_cc_versions = ['3.0.0', '2.7.0', '2.6.0', '2.5.0', '2.4.0', '2.3.0'].join(':') if RUBY_PLATFORM =~ /darwin/ FileUtils.touch 'grpc_c.32.ruby' @@ -130,15 +131,28 @@ task 'gem:native' do "invoked on macos with ruby #{RUBY_VERSION}. The ruby macos artifact " \ "build should be running on ruby 2.5." end - system "rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0 V=#{verbose} GRPC_CONFIG=#{grpc_config}" + system "rake cross native gem RUBY_CC_VERSION=#{ruby_cc_versions} V=#{verbose} GRPC_CONFIG=#{grpc_config}" else Rake::Task['dlls'].execute - ['x86-mingw32', 'x64-mingw32', 'x86_64-linux', 'x86-linux'].each do |plat| + ['x86-mingw32', 'x64-mingw32'].each do |plat| run_rake_compiler plat, <<-EOT gem update --system --no-document && \ bundle && \ rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \ - RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0 \ + RUBY_CC_VERSION=#{ruby_cc_versions} \ + V=#{verbose} \ + GRPC_CONFIG=#{grpc_config} + EOT + end + # Truncate grpc_c.*.ruby files because they're for Windows only. + File.truncate('grpc_c.32.ruby', 0) + File.truncate('grpc_c.64.ruby', 0) + ['x86_64-linux', 'x86-linux'].each do |plat| + run_rake_compiler plat, <<-EOT + gem update --system --no-document && \ + bundle && \ + rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \ + RUBY_CC_VERSION=#{ruby_cc_versions} \ V=#{verbose} \ GRPC_CONFIG=#{grpc_config} EOT