Skip to content

Commit

Permalink
Change bundler versions to ensure it works with the prism gem
Browse files Browse the repository at this point in the history
In rubygems PR7607, this bundler bug presented itself with respect to
adding the prism gem and was fixed in 2.5.10. As such, we want to
avoid loading 2.5.0 to 2.5.9.

Separately, the application will still work with older versions of
bundler. While we could change the bundler minimum to ">= 2.5.10", and
call it a day, this actually causes unnecessary overhead for developers
and CI, where we are forced to install that minimum version and can't
just use what comes with Ruby, which is the most convenient option. In
CI, the setup-ruby action will try to use the version of bundler that
comes with Ruby, and we'd like to avoid overriding that if possible,
because it requires changes to ci.yaml files in every repo. Again,
using what comes with Ruby is the most convenient option.

So, to summarize, the goal is to support as many versions of Ruby and
bundler as possible, avoid CI and developer overhead, while simultaneous
not allowing specific versions of bundler, namely 2.2.10 (which has a
bug that breaks our application) and 2.5.0-2.5.9, while also keeping
the Gemfile line as succint as possible.

So, the changes in this commit:
1. Bump the minimum version of bundler to 2.2. This is because the
   application only supports Ruby 3.0+ and the version of bundler that
   shipped with Ruby 3.0.0 was bundler 2.2.3.
2. Bump Ruby minimum to 3.0.1 and thus further bump the bundler minimum
   to 2.2.15. This avoids the bundler 2.2.10 problem. It's unlikely
   anyone is actually using Ruby 3.0.0 since 3.0.7 is the current
   version of Ruby, so changing this Ruby minimum shouldn't affect many
   developers, and it does not affect CI at all.
3. Prevent bundler 2.5.0 through 2.5.9. The only way to do this in
   bundler while keeping 2.2 as the mimimum is to enumerate each
   version. For cleanliness, this commit uses a simple map.
  • Loading branch information
Fryguy committed May 3, 2024
1 parent 14a7757 commit a507120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
raise "Ruby versions < 3.0.0 are unsupported!" if RUBY_VERSION < "3.0.0"
raise "Ruby versions < 3.0.1 are unsupported!" if RUBY_VERSION < "3.0.1"
raise "Ruby versions >= 3.2.0 are unsupported!" if RUBY_VERSION >= "3.2.0"

source 'https://rubygems.org'
Expand Down Expand Up @@ -29,7 +29,7 @@ gem "awesome_spawn", "~>1.6", :require => false
gem "aws-sdk-s3", "~>1.0", :require => false # For FileDepotS3
gem "bcrypt", "~> 3.1.10", :require => false
gem "bootsnap", ">= 1.8.1", :require => false # for psych 3.3.2+ / 4 unsafe_load
gem "bundler", "~> 2.1", ">= 2.1.4", "!= 2.2.10", :require => false
gem "bundler", "~> 2.2", ">= 2.2.15", *(0..9).map { |z| "!= 2.5.#{z}" }, :require => false
gem "byebug", :require => false
gem "color", "~>1.8"
gem "config", "~>2.2", ">=2.2.3", :require => false
Expand Down

0 comments on commit a507120

Please sign in to comment.