Skip to content

Commit

Permalink
Use source for grpc and google-protobuf on Ruby preview
Browse files Browse the repository at this point in the history
While the presence of a ruby-platform gem for these should be picked up
by bundler, sometimes it is not. Also, this makes it a bit more
future-proof, so that bundler doesn't attempt to pick a version that has
no ruby platform gem, and then proceed to fail.
  • Loading branch information
lloeki committed Oct 11, 2022
1 parent 7da6156 commit ba1ef94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ gem 'opentracing', '>= 0.4.1'
# Since most of our customers won't have BUNDLE_FORCE_RUBY_PLATFORM=true, it's not something we want to add
# to our CI, so we just shortcut and exclude specific versions that were affecting our CI.
if RUBY_PLATFORM != 'java'
if RUBY_VERSION >= '2.5.0' # Bundler 1.x fails to recognize that version >= 3.19.2 is not compatible with older rubies
if RUBY_DESCRIPTION =~ /^ruby \d+\.\d+\.\d+preview/
# binary gems for these have a max ruby version requirement that excludes preview versions
gem 'google-protobuf', ['~> 3.0', '!= 3.7.0', '!= 3.7.1'], platforms: ['ruby']
gem 'grpc', platforms: ['ruby']
elsif RUBY_VERSION >= '2.5.0' # Bundler 1.x fails to recognize that version >= 3.19.2 is not compatible with older rubies
gem 'google-protobuf', ['~> 3.0', '!= 3.7.0', '!= 3.7.1']
else
gem 'google-protobuf', ['~> 3.0', '!= 3.7.0', '!= 3.7.1', '< 3.19.2']
Expand Down

0 comments on commit ba1ef94

Please sign in to comment.