truncate windows dlls for linux package

pull/25070/head
Alexander Polcyn 4 years ago
parent 4fa05591e3
commit 56f1944e2d
  1. 20
      Rakefile

@ -121,6 +121,7 @@ task 'gem:native' do
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', '2.4.0', '2.3.0'].join(':')
if RUBY_PLATFORM =~ /darwin/ if RUBY_PLATFORM =~ /darwin/
FileUtils.touch 'grpc_c.32.ruby' 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 " \ "invoked on macos with ruby #{RUBY_VERSION}. The ruby macos artifact " \
"build should be running on ruby 2.5." "build should be running on ruby 2.5."
end 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 else
Rake::Task['dlls'].execute 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 run_rake_compiler plat, <<-EOT
gem update --system --no-document && \ gem update --system --no-document && \
bundle && \ bundle && \
rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \ 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} \ V=#{verbose} \
GRPC_CONFIG=#{grpc_config} GRPC_CONFIG=#{grpc_config}
EOT EOT

Loading…
Cancel
Save