(Temporarily?) delay path changes and global cache changes

There are several issues with these which I'm not sure I'll have time to
address properly. I prefer to keep our default branch in a releasable
state just in case. Once they are fixed, this can be reverted.
This commit is contained in:
David Rodríguez 2025-07-24 21:50:49 +02:00 committed by Hiroshi SHIBATA
parent 48a79cd492
commit 95fdaa5c3b
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
6 changed files with 15 additions and 6 deletions

View file

@ -130,7 +130,7 @@ module Bundler
def self.clean_after_install?
clean = Bundler.settings[:clean]
return clean unless clean.nil?
clean ||= Bundler.feature_flag.bundler_4_mode? && Bundler.settings[:path].nil?
clean ||= Bundler.feature_flag.bundler_5_mode? && Bundler.settings[:path].nil?
clean &&= !Bundler.use_system_gems?
clean
end

View file

@ -30,7 +30,7 @@ module Bundler
settings_flag(:allow_offline_install) { bundler_4_mode? }
settings_flag(:cache_all) { bundler_4_mode? }
settings_flag(:forget_cli_options) { bundler_4_mode? }
settings_flag(:global_gem_cache) { bundler_4_mode? }
settings_flag(:global_gem_cache) { bundler_5_mode? }
settings_flag(:lockfile_checksums) { bundler_4_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
settings_flag(:update_requires_all_flag) { bundler_5_mode? }

View file

@ -272,7 +272,7 @@ module Bundler
def use_system_gems?
return true if system_path
return false if explicit_path
!Bundler.feature_flag.bundler_4_mode?
!Bundler.feature_flag.bundler_5_mode?
end
def base_path

View file

@ -427,7 +427,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "foo-1.0"
end
it "automatically cleans when path has not been set", bundler: "4" do
it "automatically cleans when path has not been set", bundler: "5" do
build_repo2
install_gemfile <<-G

View file

@ -38,6 +38,15 @@ RSpec.describe "bundle install with gem sources" do
expect(bundled_app(".bundle")).not_to exist
end
it "will create a ./.bundle by default", bundler: "5" do
install_gemfile <<-G
source "https://gem.repo1"
gem "myrack"
G
expect(bundled_app(".bundle")).to exist
end
it "does not create ./.bundle by default when installing to system gems" do
install_gemfile <<-G, env: { "BUNDLE_PATH__SYSTEM" => "true" }
source "https://gem.repo1"

View file

@ -32,7 +32,7 @@ RSpec.configure do |config|
config.filter_run_when_matching :focus unless ENV["CI"]
config.before(:each, bundler: "4") do
bundle "config simulate_version 4"
config.before(:each, :bundler) do |example|
bundle "config simulate_version #{example.metadata[:bundler]}"
end
end