diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 85f702bc64..c3400c3959 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -165,9 +165,6 @@ module Bundler def normalize_settings Bundler.settings.set_command_option :path, nil if options[:system] - Bundler.settings.temporary(:path_relative_to_cwd => false) do - Bundler.settings.set_command_option :path, "vendor/bundle" if Bundler.settings[:deployment] && Bundler.settings[:path].nil? - end Bundler.settings.set_command_option_if_given :path, options[:path] Bundler.settings.temporary(:path_relative_to_cwd => false) do Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil? diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 1ced590b6f..72728fb20f 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -219,6 +219,7 @@ module Bundler def path configs.each do |_level, settings| path = value_for("path", settings) + path = "vendor/bundle" if value_for("deployment", settings) && path.nil? path_system = value_for("path.system", settings) disabled_shared_gems = value_for("disable_shared_gems", settings) next if path.nil? && path_system.nil? && disabled_shared_gems.nil? diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index a7ccc9c201..a7d32cb0a1 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false module Bundler - VERSION = "2.3.2".freeze + VERSION = "2.3.3".freeze def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i diff --git a/lib/rubygems.rb b/lib/rubygems.rb index ddadd0f797..e24580c5b8 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -8,7 +8,7 @@ require 'rbconfig' module Gem - VERSION = "3.3.2".freeze + VERSION = "3.3.3".freeze end # Must be first since it unloads the prelude from 1.9.2 diff --git a/spec/bundler/runtime/self_management_spec.rb b/spec/bundler/runtime/self_management_spec.rb index def9361d0f..7746a6ffa9 100644 --- a/spec/bundler/runtime/self_management_spec.rb +++ b/spec/bundler/runtime/self_management_spec.rb @@ -45,6 +45,29 @@ RSpec.describe "Self management", :rubygems => ">= 3.3.0.dev" do bundle "config set --local path vendor/bundle" bundle "install", :env => { "BUNDLER_SPEC_GEM_SOURCES" => file_uri_for(gem_repo2).to_s } expect(out).to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.") + expect(vendored_gems("gems/bundler-#{next_minor}")).to exist + + # It does not uninstall the locked bundler + bundle "clean" + expect(out).to be_empty + + # App now uses locked version + bundle "-v" + expect(out).to end_with(next_minor[0] == "2" ? "Bundler version #{next_minor}" : next_minor) + + # Subsequent installs use the locked version without reinstalling + bundle "install --verbose" + expect(out).to include("Using bundler #{next_minor}") + expect(out).not_to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.") + end + + it "installs locked version when using deployment option and uses it" do + lockfile_bundled_with(next_minor) + + bundle "config set --local deployment true" + bundle "install", :env => { "BUNDLER_SPEC_GEM_SOURCES" => file_uri_for(gem_repo2).to_s } + expect(out).to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.") + expect(vendored_gems("gems/bundler-#{next_minor}")).to exist # It does not uninstall the locked bundler bundle "clean" diff --git a/tool/bundler/rubocop_gems.rb.lock b/tool/bundler/rubocop_gems.rb.lock index 93e22b74ef..8c74c71d7d 100644 --- a/tool/bundler/rubocop_gems.rb.lock +++ b/tool/bundler/rubocop_gems.rb.lock @@ -60,4 +60,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.3.2 + 2.3.3 diff --git a/tool/bundler/standard_gems.rb.lock b/tool/bundler/standard_gems.rb.lock index 497e19af7a..4201bfd7a0 100644 --- a/tool/bundler/standard_gems.rb.lock +++ b/tool/bundler/standard_gems.rb.lock @@ -66,4 +66,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.3.2 + 2.3.3 diff --git a/tool/bundler/test_gems.rb.lock b/tool/bundler/test_gems.rb.lock index 66efd03518..8a06010025 100644 --- a/tool/bundler/test_gems.rb.lock +++ b/tool/bundler/test_gems.rb.lock @@ -41,4 +41,4 @@ DEPENDENCIES webrick (= 1.7.0) BUNDLED WITH - 2.3.2 + 2.3.3