[Deps] Ruby uses protobuf 4.x (#36215)

Protobuf for Ruby bumped the major version to 4. [package](https://rubygems.org/gems/google-protobuf) so the Ruby gemspec should be updated to have 4 instead of 3.

But gRPC's other dependencies don't work with Protobuf 4.x so I fixed the version of google-protobuf for gRPC Ruby to 3.25 which was the last version gRPC used.

Closes #36215

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36215 from veblush:ruby-protobuf 171a6d63bc
PiperOrigin-RevId: 620987535
pull/36217/head
Esun Kim 8 months ago committed by Copybara-Service
parent 65ddb57908
commit 899aed0156
  1. 2
      grpc.gemspec
  2. 5
      templates/grpc.gemspec.template
  3. 3
      tools/buildgen/plugins/expand_version.py

2
grpc.gemspec generated

@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> 3.26'
s.add_dependency 'google-protobuf', '~> 3.25'
s.add_dependency 'googleapis-common-protos-types', '~> 1.0'
s.add_development_dependency 'bundler', '>= 1.9'

@ -32,7 +32,10 @@
s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> ${settings.protobuf_major_minor_version}'
## Once protobuf 4.x is working with other dependencies,
## please replace the following fixed 3.25 version with
## '~> 4.${settings.protobuf_version.split(".")[1]}'
s.add_dependency 'google-protobuf', '~> 3.25'
s.add_dependency 'googleapis-common-protos-types', '~> 1.0'
s.add_development_dependency 'bundler', '>= 1.9'

@ -134,6 +134,3 @@ def mako_plugin(dictionary):
settings[version_tag] = Version(
version_str, override_major=override_major
)
settings["protobuf_major_minor_version"] = ".".join(
settings["protobuf_version"].split(".")[:2]
)

Loading…
Cancel
Save