Skip to content

Commit d316cf7

Browse files
authored
[Ruby] Add ruby_abi_version to exported symbols (grpc#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>' ```
1 parent c16fa00 commit d316cf7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ruby/ext/grpc/ext-export.clang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
_Init_grpc_c
2+
_ruby_abi_version

src/ruby/ext/grpc/ext-export.gcc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
grpc_1.0 {
22
global:
33
Init_grpc_c;
4+
ruby_abi_version;
45
local:
56
*;
67
};

0 commit comments

Comments
 (0)