[Ruby] Add ruby_abi_version to exported symbols (#28976)
The next Ruby version, 3.2, will have builtin ABI checking (see ruby/ruby#5474). This requires that the symbol `ruby_abi_version` is present in the shared object, otherwise the object fails to load. For example, this is a small repro in Ruby 3.2: ``` $ ruby -Isrc/ruby/lib -e "require 'grpc'" <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require': /home/peter/src/grpc/src/ruby/lib/grpc/grpc_c.so: undefined symbol: ruby_abi_version - ruby_abi_version (LoadError) from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /home/peter/src/grpc/src/ruby/lib/grpc/grpc.rb:22:in `<top (required)>' from /home/peter/src/grpc/src/ruby/lib/grpc.rb:19:in `require_relative' from /home/peter/src/grpc/src/ruby/lib/grpc.rb:19:in `<top (required)>' from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:/home/peter/src/ruby/install/lib/ruby/3.2.0+0/rubygems/core_ext/kernel_require.rb>:85:in `require' from -e:1:in `<main>' ```pull/29840/head
parent
c16fa00f94
commit
d316cf7ae9
2 changed files with 2 additions and 0 deletions
@ -1 +1,2 @@ |
||||
_Init_grpc_c |
||||
_ruby_abi_version |
||||
|
@ -1,6 +1,7 @@ |
||||
grpc_1.0 { |
||||
global: |
||||
Init_grpc_c; |
||||
ruby_abi_version; |
||||
local: |
||||
*; |
||||
}; |
Loading…
Reference in new issue