From d810ef6be77c079b890e92a20e5b37cfd8768a0b Mon Sep 17 00:00:00 2001 From: Jason Lunn Date: Tue, 2 Apr 2024 19:10:39 -0700 Subject: [PATCH] Add bigdecimal to dependencies (#16379) In Ruby 3.4, `bigdecimal` is no longer built in. See announcement in [Ruby 3.3 release notes](https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/#:~:text=base64-,bigdecimal,-csv). Closes #16379 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16379 from protocolbuffers:support_ruby_3.4.x 084063bfacd305798fa5b55109083d369a50c3da PiperOrigin-RevId: 621362101 --- ruby/google-protobuf.gemspec | 2 ++ ruby/lib/google/BUILD.bazel | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 2ef9996147334..b66e8fc74d49b 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -32,6 +32,8 @@ Gem::Specification.new do |s| s.add_development_dependency "rake-compiler-dock", "= 1.2.1" end s.required_ruby_version = '>= 3.0' + # bigdecimal must be used as a non-built in gem as of ruby-3.4 + s.add_dependency "bigdecimal" # TODO: evaluate removing Rakefile and moving logic to extconf.rb, so that we # can remove this runtime dependency on rake. See the discussion here for # more details: diff --git a/ruby/lib/google/BUILD.bazel b/ruby/lib/google/BUILD.bazel index 979f3fe49a434..e5aaceab911ce 100644 --- a/ruby/lib/google/BUILD.bazel +++ b/ruby/lib/google/BUILD.bazel @@ -81,7 +81,10 @@ ruby_library( "ruby/lib", ], visibility = ["//ruby:__pkg__"], - deps = ["//ruby:well_known_ruby_protos"] + select({ + deps = [ + "//ruby:well_known_ruby_protos", + "@protobuf_bundle//:bigdecimal", + ] + select({ "//ruby:ffi_enabled": [ "@protobuf_bundle//:ffi", "@protobuf_bundle//:ffi-compiler",