@@ -28,7 +28,7 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
2828 ext . lib_dir = File . join ( 'src' , 'ruby' , 'lib' , 'grpc' )
2929 ext . cross_compile = true
3030 ext . cross_platform = [
31- 'x86-mingw32' , 'x64-mingw32' ,
31+ 'x86-mingw32' , 'x64-mingw32' , 'x64-mingw-ucrt' ,
3232 'x86_64-linux' , 'x86-linux' ,
3333 'x86_64-darwin' , 'arm64-darwin' ,
3434 'universal-darwin'
@@ -38,7 +38,7 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
3838 |file | file . start_with? (
3939 "src/ruby/bin/" , "src/ruby/ext/" , "src/ruby/lib/" , "src/ruby/pb/" )
4040 }
41- spec . files += %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby )
41+ spec . files += %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby grpc_c.64-ucrt.ruby )
4242 end
4343end
4444
@@ -87,9 +87,10 @@ task 'dlls', [:plat] do |t, args|
8787 plat_list = args [ :plat ]
8888
8989 build_configs = [ ]
90+ w64_ucrt = { cross : 'x86_64-w64-mingw32' , out : 'grpc_c.64-ucrt.ruby' , platform : 'x64-mingw-ucrt' }
9091 w64 = { cross : 'x86_64-w64-mingw32' , out : 'grpc_c.64.ruby' , platform : 'x64-mingw32' }
9192 w32 = { cross : 'i686-w64-mingw32' , out : 'grpc_c.32.ruby' , platform : 'x86-mingw32' }
92- [ w64 , w32 ] . each do |config |
93+ [ w64_ucrt , w64 , w32 ] . each do |config |
9394 if plat_list . include? ( config [ :platform ] )
9495 # build the DLL (as grpc_c.*.ruby)
9596 build_configs . append ( config )
@@ -151,6 +152,7 @@ task 'gem:native', [:plat] do |t, args|
151152
152153 FileUtils . touch 'grpc_c.32.ruby'
153154 FileUtils . touch 'grpc_c.64.ruby'
155+ FileUtils . touch 'grpc_c.64-ucrt.ruby'
154156 unless '2.5' == /(\d +\. \d +)/ . match ( RUBY_VERSION ) . to_s
155157 fail "rake gem:native (the rake task to build the binary packages) is being " \
156158 "invoked on macos with ruby #{ RUBY_VERSION } . The ruby macos artifact " \
@@ -168,7 +170,7 @@ task 'gem:native', [:plat] do |t, args|
168170 prepare_ccache_cmd += "export PATH=\" $PATH:/usr/local/bin\" && "
169171 prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
170172
171- supported_windows_platforms = [ 'x86-mingw32' , 'x64-mingw32' ]
173+ supported_windows_platforms = [ 'x86-mingw32' , 'x64-mingw32' , 'x64-mingw-ucrt' ]
172174 supported_unix_platforms = [ 'x86_64-linux' , 'x86-linux' , 'x86_64-darwin' , 'arm64-darwin' ]
173175 supported_platforms = supported_windows_platforms + supported_unix_platforms
174176
@@ -210,6 +212,7 @@ task 'gem:native', [:plat] do |t, args|
210212 # them to take up space in the gems that don't target windows.
211213 File . truncate ( 'grpc_c.32.ruby' , 0 )
212214 File . truncate ( 'grpc_c.64.ruby' , 0 )
215+ File . truncate ( 'grpc_c.64-ucrt.ruby' , 0 )
213216
214217 unix_platforms . each do |plat |
215218 run_rake_compiler ( plat , <<~EOT )
0 commit comments