Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7502
Browse files Browse the repository at this point in the history
7502: Release 2.1.1 r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was I want to get regression fixed as soon as possible to reduce impact.

### What is your fix for the problem, implemented in this PR?

My fix is to release what we have already fixed as soon as possible.


Co-authored-by: Bundlerbot <[email protected]>
Co-authored-by: David Rodríguez <[email protected]>
  • Loading branch information
bundlerbot and deivid-rodriguez committed Dec 17, 2019
2 parents 683fe97 + 0a5db7e commit 8bd21aa
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
- rvm: 2.6.5
script: bin/rake rubocop
stage: linting
- rvm: 2.6.5
script: bin/rake check_rvm_integration
stage: linting
# Ruby 2.3 also tested in 2.x mode
- rvm: 2.3.8
env: RGV=master
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.1.1 (December 17, 2019)

Bugfixes:

- Fix some cases of shelling out to `rubygems` still being silent [#7493](https://github.com/bundler/bundler/pull/7493)
- Restore compatibility with `rubygems-bundler` so that binstubs work under `RVM` [#7498](https://github.com/bundler/bundler/pull/7498)

## 2.1.0 (December 15, 2019)

Features:
Expand Down
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

$:.unshift File.expand_path("../lib", __FILE__)
require "benchmark"

require_relative "spec/support/rubygems_ext"
Expand Down Expand Up @@ -123,6 +122,14 @@ task :rubocop do
sh("bin/rubocop --parallel")
end

desc "Check RVM integration"
task :check_rvm_integration do
# The rubygems-bundler gem is installed by RVM by default and it could easily
# break when we change bundler. Make sure that binstubs still run with it
# installed.
sh("bin/rake install && gem install rubygems-bundler && rake -T")
end

namespace :man do
if RUBY_ENGINE == "jruby"
task(:build) {}
Expand Down
15 changes: 3 additions & 12 deletions lib/bundler/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def run
SharedHelpers.set_bundle_environment
if bin_path = Bundler.which(cmd)
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
return with_verbose_rubygems { kernel_load(bin_path, *args) }
return kernel_load(bin_path, *args)
end
with_verbose_rubygems { kernel_exec(bin_path, *args) }
kernel_exec(bin_path, *args)
else
# exec using the given command
with_verbose_rubygems { kernel_exec(cmd, *args) }
kernel_exec(cmd, *args)
end
end

Expand Down Expand Up @@ -89,14 +89,5 @@ def ruby_shebang?(file)
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
possibilities.any? {|shebang| first_line.start_with?(shebang) }
end

def with_verbose_rubygems
old_ui = Gem::DefaultUserInteraction.ui
Gem::DefaultUserInteraction.ui = nil

yield
ensure
Gem::DefaultUserInteraction.ui = old_ui
end
end
end
8 changes: 8 additions & 0 deletions lib/bundler/rubygems_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ def stub_rubygems(specs)
end
end

def plain_specs
Gem::Specification._all
end

def plain_specs=(specs)
Gem::Specification.all = specs
end

def fetch_specs(remote, name)
path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
fetcher = gem_remote_fetcher
Expand Down
5 changes: 5 additions & 0 deletions lib/bundler/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
else
Bundler.ui.silence { Bundler.setup }
end

# We might be in the middle of shelling out to rubygems
# (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
# not being silent.
Gem::DefaultUserInteraction.ui = nil
end
2 changes: 1 addition & 1 deletion lib/bundler/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: false

module Bundler
VERSION = "2.1.0".freeze
VERSION = "2.1.1".freeze

def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
Expand Down
6 changes: 6 additions & 0 deletions spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
expect(out).to eq(Gem::VERSION)
end

it "works when exec'ing to rubygems through sh -c" do
install_gemfile 'gem "rack"'
bundle "exec sh -c '#{gem_cmd} --version'"
expect(out).to eq(Gem::VERSION)
end

it "respects custom process title when loading through ruby" do
script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~'RUBY'
Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15")
Expand Down

0 comments on commit 8bd21aa

Please sign in to comment.