summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-07 15:35:46 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-07 15:35:46 +0200
commit017e19f924827d9bd1019f82d605492463ad244d (patch)
treefc082a9c2fc0ed2e39b046a32084a8abade7abe5
parentb1c7297ccfd59879d4181d72b171f3ea88ac5fbd (diff)
downloadbundler-017e19f924827d9bd1019f82d605492463ad244d.tar.gz
Remove global_path_appends_ruby_scope setting
This is a bug fix, so it makes no sense to make it configurable. Also, the fix is unlikely to cause problems other than maybe needing a fresh `bundle install` on some edge cases. So, let's ship the fix and remove the setting.
-rw-r--r--lib/bundler/feature_flag.rb1
-rw-r--r--lib/bundler/settings.rb6
-rw-r--r--man/bundle-config.ronn3
-rw-r--r--spec/install/bundler_spec.rb1
-rw-r--r--spec/install/gems/sudo_spec.rb12
-rw-r--r--spec/install/path_spec.rb73
6 files changed, 25 insertions, 71 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 9cc14c9bc8..a45694dd8e 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -37,7 +37,6 @@ module Bundler
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
- settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_3_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 6cc25bc998..f670bf8779 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -33,7 +33,6 @@ module Bundler
frozen
gem.coc
gem.mit
- global_path_appends_ruby_scope
global_gem_cache
ignore_messages
init_gems_rb
@@ -205,13 +204,12 @@ module Bundler
locations
end
- # for legacy reasons, in Bundler 1, the ruby scope isnt appended when the setting comes from ENV or the global config,
- # nor do we respect :disable_shared_gems
+ # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
def path
key = key_for(:path)
path = ENV[key] || @global_config[key]
if path && !@temporary.key?(key) && !@local_config.key?(key)
- return Path.new(path, Bundler.feature_flag.global_path_appends_ruby_scope?, false, false)
+ return Path.new(path, true, false, false)
end
system_path = self["path.system"] || (self[:disable_shared_gems] == false)
diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn
index 9242a59f95..7d3b8dcc8d 100644
--- a/man/bundle-config.ronn
+++ b/man/bundle-config.ronn
@@ -202,9 +202,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
Whether Bundler should cache all gems globally, rather than locally to the
installing Ruby installation.
-* `global_path_appends_ruby_scope` (`BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE`):
- Whether Bundler should append the Ruby scope (e.g. engine and ABI version)
- to a globally-configured path.
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
messages will be printed. To silence a single gem, use dot notation like
`ignore_messages.httparty true`.
diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb
index 90f7c63330..fad6d68010 100644
--- a/spec/install/bundler_spec.rb
+++ b/spec/install/bundler_spec.rb
@@ -140,7 +140,6 @@ RSpec.describe "bundle install" do
it "can install dependencies with newer bundler version with a local path" do
bundle! "config set path .bundle"
- bundle! "config set global_path_appends_ruby_scope true"
install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "rails", "3.0"
diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb
index fb41f63a07..a7372b1fbe 100644
--- a/spec/install/gems/sudo_spec.rb
+++ b/spec/install/gems/sudo_spec.rb
@@ -52,8 +52,6 @@ RSpec.describe "when using sudo", :sudo => true do
end
it "installs when BUNDLE_PATH is owned by root" do
- bundle! "config set global_path_appends_ruby_scope false" # consistency in tests between 1.x and 2.x modes
-
bundle_path = tmp("owned_by_root")
FileUtils.mkdir_p bundle_path
sudo "chown -R root #{bundle_path}"
@@ -64,14 +62,12 @@ RSpec.describe "when using sudo", :sudo => true do
gem "rack", '1.0'
G
- expect(bundle_path.join("gems/rack-1.0.0")).to exist
- expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0)
+ expect(bundle_path.join(Bundler.ruby_scope, "gems/rack-1.0.0")).to exist
+ expect(bundle_path.join(Bundler.ruby_scope, "gems/rack-1.0.0").stat.uid).to eq(0)
expect(the_bundle).to include_gems "rack 1.0"
end
it "installs when BUNDLE_PATH does not exist" do
- bundle! "config set global_path_appends_ruby_scope false" # consistency in tests between 1.x and 2.x modes
-
root_path = tmp("owned_by_root")
FileUtils.mkdir_p root_path
sudo "chown -R root #{root_path}"
@@ -83,8 +79,8 @@ RSpec.describe "when using sudo", :sudo => true do
gem "rack", '1.0'
G
- expect(bundle_path.join("gems/rack-1.0.0")).to exist
- expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0)
+ expect(bundle_path.join(Bundler.ruby_scope, "gems/rack-1.0.0")).to exist
+ expect(bundle_path.join(Bundler.ruby_scope, "gems/rack-1.0.0").stat.uid).to eq(0)
expect(the_bundle).to include_gems "rack 1.0"
end
diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb
index aac697fb23..b2a3375342 100644
--- a/spec/install/path_spec.rb
+++ b/spec/install/path_spec.rb
@@ -113,71 +113,36 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "rack 1.0.0"
end
- context "with global_path_appends_ruby_scope set", :bundler => "3" do
- it "installs gems to ." do
- set_bundle_path(type, ".")
- bundle! "config set --global disable_shared_gems true"
+ it "installs gems to ." do
+ set_bundle_path(type, ".")
+ bundle! "config set --global disable_shared_gems true"
- bundle! :install
-
- paths_to_exist = %w[cache/rack-1.0.0.gem gems/rack-1.0.0 specifications/rack-1.0.0.gemspec].map {|path| bundled_app(Bundler.ruby_scope, path) }
- expect(paths_to_exist).to all exist
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
-
- it "installs gems to the path" do
- set_bundle_path(type, bundled_app("vendor").to_s)
-
- bundle! :install
+ bundle! :install
- expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
+ paths_to_exist = %w[cache/rack-1.0.0.gem gems/rack-1.0.0 specifications/rack-1.0.0.gemspec].map {|path| bundled_app(Bundler.ruby_scope, path) }
+ expect(paths_to_exist).to all exist
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
- it "installs gems to the path relative to root when relative" do
- set_bundle_path(type, "vendor")
+ it "installs gems to the path" do
+ set_bundle_path(type, bundled_app("vendor").to_s)
- FileUtils.mkdir_p bundled_app("lol")
- Dir.chdir(bundled_app("lol")) do
- bundle! :install
- end
+ bundle! :install
- expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
+ expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory
+ expect(the_bundle).to include_gems "rack 1.0.0"
end
- context "with global_path_appends_ruby_scope unset", :bundler => "< 3" do
- it "installs gems to ." do
- set_bundle_path(type, ".")
- bundle! "config set --global disable_shared_gems true"
+ it "installs gems to the path relative to root when relative" do
+ set_bundle_path(type, "vendor")
+ FileUtils.mkdir_p bundled_app("lol")
+ Dir.chdir(bundled_app("lol")) do
bundle! :install
-
- expect([bundled_app("cache/rack-1.0.0.gem"), bundled_app("gems/rack-1.0.0"), bundled_app("specifications/rack-1.0.0.gemspec")]).to all exist
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
-
- it "installs gems to BUNDLE_PATH with #{type}" do
- set_bundle_path(type, bundled_app("vendor").to_s)
-
- bundle :install
-
- expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory
- expect(the_bundle).to include_gems "rack 1.0.0"
end
- it "installs gems to BUNDLE_PATH relative to root when relative" do
- set_bundle_path(type, "vendor")
-
- FileUtils.mkdir_p bundled_app("lol")
- Dir.chdir(bundled_app("lol")) do
- bundle :install
- end
-
- expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
+ expect(bundled_app("vendor", Bundler.ruby_scope, "gems/rack-1.0.0")).to be_directory
+ expect(the_bundle).to include_gems "rack 1.0.0"
end
end
end