Skip to content

Commit

Permalink
[rubygems/rubygems] Remove RUBYGEMS_GEMDEPS warning
Browse files Browse the repository at this point in the history
When setting the `RUBYGEMS_GEMDEPS` environment variable to allow
skipping `bundle exec`, `bundler` will print a warning about potential
incompatibility.

Initially the `RUBYGEMS_GEMDEPS` variable used a completely different
(re)implementation of `bundler` functionality. That implementation was
not battle tested and could potentially differ in behaviour from what
`bundler` does. That's why print a warning.

However, these days, all `rubygems` does when `RUBYGEMS_GEMDEPS` is set
is to require `bundler/setup`, so there's no risk of any
incompatibility, since that's just plain `bundler`.

rubygems/rubygems@bbddc27016
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent ab1edc7 commit 5aee962
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
8 changes: 0 additions & 8 deletions lib/bundler/cli.rb
Expand Up @@ -73,14 +73,6 @@ def initialize(*args)
Bundler.ui = UI::Shell.new(options)
Bundler.ui.level = "debug" if options["verbose"]
unprinted_warnings.each {|w| Bundler.ui.warn(w) }

if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
Bundler.ui.warn(
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
)
end
end

check_unknown_options!(:except => [:config, :exec])
Expand Down
16 changes: 0 additions & 16 deletions spec/bundler/bundler/cli_spec.rb
Expand Up @@ -111,22 +111,6 @@ def out_with_macos_man_workaround
end
end

context "when ENV['RUBYGEMS_GEMDEPS'] is set" do
it "displays a warning" do
gemfile bundled_app_gemfile, <<-G
source "#{file_uri_for(gem_repo1)}"
gem 'rack'
G

bundle :install, :env => { "RUBYGEMS_GEMDEPS" => "foo" }
expect(err).to include("RUBYGEMS_GEMDEPS")
expect(err).to include("conflict with Bundler")

bundle :install, :env => { "RUBYGEMS_GEMDEPS" => "" }
expect(err).not_to include("RUBYGEMS_GEMDEPS")
end
end

context "with --verbose" do
it "prints the running command" do
gemfile "source \"#{file_uri_for(gem_repo1)}\""
Expand Down

0 comments on commit 5aee962

Please sign in to comment.