diff --git a/Dockerfile b/Dockerfile index d5850f8ba3e..1f2ebd74b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,9 +76,9 @@ ENV PATH="$BUNDLE_BIN:$PATH:$BUNDLE_PATH/bin" RUN apt-add-repository ppa:brightbox/ruby-ng \ && apt-get update \ && apt-get install -y --no-install-recommends ruby2.7 ruby2.7-dev \ - && gem update --system 3.3.11 --no-document \ + && gem update --system 3.2.20 \ && gem install bundler -v 1.17.3 --no-document \ - && gem install bundler -v 2.3.12 --no-document \ + && gem install bundler -v 2.3.10 --no-document \ && rm -rf /var/lib/gems/2.7.0/cache/* \ && rm -rf /var/lib/apt/lists/* diff --git a/bundler/helpers/v2/build b/bundler/helpers/v2/build index 5762a14abc8..c54f29b8e66 100755 --- a/bundler/helpers/v2/build +++ b/bundler/helpers/v2/build @@ -22,6 +22,6 @@ cd "$install_dir" # NOTE: Sets `BUNDLED WITH` to match the installed v2 version in Gemfile.lock # forcing specs and native helpers to run with the same version -BUNDLER_VERSION=2.3.12 bundle config --local path ".bundle" -BUNDLER_VERSION=2.3.12 bundle config --local without "test" -BUNDLER_VERSION=2.3.12 bundle install +BUNDLER_VERSION=2.3.10 bundle config --local path ".bundle" +BUNDLER_VERSION=2.3.10 bundle config --local without "test" +BUNDLER_VERSION=2.3.10 bundle install diff --git a/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb b/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb index d0d254ac408..e127b488270 100644 --- a/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb +++ b/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb @@ -5,32 +5,16 @@ module BundlerDefinitionRubyVersionPatch def source_requirements if ruby_version - requested_version = ruby_version.gem_version + requested_version = ruby_version.to_gem_version_with_patchlevel sources.metadata_source.specs << Gem::Specification.new("Ruby\0", requested_version) end sources.metadata_source.specs << - Gem::Specification.new("Ruby\0", "2.5.3") + Gem::Specification.new("Ruby\0", "2.5.3p105") super end - - def metadata_dependencies - @metadata_dependencies ||= - [ - Bundler::Dependency.new("Ruby\0", ruby_version_requirements), - Bundler::Dependency.new("RubyGems\0", Gem::VERSION) - ] - end - - def ruby_version_requirements - return [] unless ruby_version - - ruby_version.versions.map do |version| - Gem::Requirement.new(version) - end - end end Bundler::Definition.prepend(BundlerDefinitionRubyVersionPatch) diff --git a/bundler/lib/dependabot/bundler/helpers.rb b/bundler/lib/dependabot/bundler/helpers.rb index e9fcc2c6ee1..2c9d21d0cbc 100644 --- a/bundler/lib/dependabot/bundler/helpers.rb +++ b/bundler/lib/dependabot/bundler/helpers.rb @@ -4,7 +4,7 @@ module Dependabot module Bundler module Helpers V1 = "1.17.3" - V2 = "2.3.12" + V2 = "2.3.10" # If we are updating a project with no Gemfile.lock, we default to the # newest version we support DEFAULT = V2 diff --git a/bundler/lib/dependabot/bundler/native_helpers.rb b/bundler/lib/dependabot/bundler/native_helpers.rb index 910e195ec40..609aa614178 100644 --- a/bundler/lib/dependabot/bundler/native_helpers.rb +++ b/bundler/lib/dependabot/bundler/native_helpers.rb @@ -36,7 +36,7 @@ def clamp(seconds) def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) # Run helper suprocess with all bundler-related ENV variables removed bundler_major_version = bundler_version.split(".").first - helpers_path = versioned_helper_path(bundler_major_version) + helpers_path = versioned_helper_path(bundler_version: bundler_major_version) ::Bundler.with_original_env do command = BundleCommand. new(options[:timeout_per_operation_seconds]). @@ -47,7 +47,7 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) args: args, env: { # Bundler will pick the matching installed major version - "BUNDLER_VERSION" => installed_bundler_version(bundler_major_version), + "BUNDLER_VERSION" => bundler_version, "BUNDLE_GEMFILE" => File.join(helpers_path, "Gemfile"), # Prevent the GEM_HOME from being set to a folder owned by root "GEM_HOME" => File.join(helpers_path, ".bundle") @@ -61,15 +61,8 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) end end - def self.versioned_helper_path(bundler_major_version) - File.join(native_helpers_root, "v#{bundler_major_version}") - end - - # Maps the major version unto the specific version we have installed - def self.installed_bundler_version(bundler_major_version) - return Helpers::V1 if bundler_major_version == "1" - - Helpers::V2 + def self.versioned_helper_path(bundler_version:) + File.join(native_helpers_root, "v#{bundler_version}") end def self.native_helpers_root diff --git a/bundler/script/ci-test b/bundler/script/ci-test index dba5e762295..b1c953522a7 100755 --- a/bundler/script/ci-test +++ b/bundler/script/ci-test @@ -15,7 +15,7 @@ fi if [[ "$SUITE_NAME" == "bundler2" ]]; then cd helpers/v2 \ - && BUNDLER_VERSION=2.3.12 bundle install \ - && BUNDLER_VERSION=2.3.12 bundle exec rspec spec \ + && BUNDLER_VERSION=2.3.10 bundle install \ + && BUNDLER_VERSION=2.3.10 bundle exec rspec spec \ && cd - fi diff --git a/bundler/spec/dependabot/bundler/helper_spec.rb b/bundler/spec/dependabot/bundler/helper_spec.rb index 0697d46f7c2..9e8b4d03ab6 100644 --- a/bundler/spec/dependabot/bundler/helper_spec.rb +++ b/bundler/spec/dependabot/bundler/helper_spec.rb @@ -41,7 +41,7 @@ end let(:v1) { "1.17.3" } - let(:v2) { "2.3.12" } + let(:v2) { "2.3.10" } describe "#bundler_version" do def described_method(lockfile) diff --git a/bundler/spec/spec_helper.rb b/bundler/spec/spec_helper.rb index 23df38d61f8..ecf39911cd1 100644 --- a/bundler/spec/spec_helper.rb +++ b/bundler/spec/spec_helper.rb @@ -20,7 +20,7 @@ def self.use_bundler_2? end def self.bundler_version - use_bundler_2? ? "2.3.12" : "1.17.3" + use_bundler_2? ? "2.3.10" : "1.17.3" end def self.bundler_major_version