diff --git a/.travis.yml b/.travis.yml index e7828fd4af4..14091cadea8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,17 @@ script: bin/rake spec:travis before_script: - travis_retry gem install rake:"~> 12.0" - travis_retry bin/rake override_version - - travis_retry bin/rake spec:travis:deps + - travis_retry bin/rake spec:deps - bin/rake man:check + - if [ "$BUNDLER_SPEC_SUB_VERSION" = "" ]; + then + travis_retry sudo apt-get install graphviz -y; + fi + - if [ "$TRAVIS_RUBY_VERSION" = "2.3.8" ]; + then + sudo sed -i 's/1000::/1000:Travis:/g' /etc/passwd; + sudo sed -i '/secure_path/d' /etc/sudoers; + fi branches: only: diff --git a/CHANGELOG.md b/CHANGELOG.md index ec13c087541..612b0e36bb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.1.2 (December 20, 2019) + +Bugfixes: + + - Restore an explicit `require "rubygems"` on top `rubygems_integration.rb` to avoid some missing constant errors under some convoluted setups [#7505](https://github.com/bundler/bundler/pull/7505) + ## 2.1.1 (December 17, 2019) Bugfixes: diff --git a/Rakefile b/Rakefile index 4fd9a5179a7..07f74edb71d 100644 --- a/Rakefile +++ b/Rakefile @@ -36,24 +36,6 @@ namespace :spec do Spec::Rubygems.dev_setup end - namespace :travis do - task :deps do - # Give the travis user a name so that git won't fatally error - system "sudo sed -i 's/1000::/1000:Travis:/g' /etc/passwd" - # Strip secure_path so that RVM paths transmit through sudo -E - system "sudo sed -i '/secure_path/d' /etc/sudoers" - # Refresh packages index that the ones we need can be installed - sh "sudo apt-get update" - # Install groff so ronn can generate man/help pages - sh "sudo apt-get install groff-base=1.22.3-10 -y" - # Install graphviz so that the viz specs can run - sh "sudo apt-get install graphviz -y" - - # Install the other gem deps, etc - Rake::Task["spec:deps"].invoke - end - end - task :clean do rm_rf "tmp" end @@ -127,7 +109,7 @@ 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") + sh("gem install rubygems-bundler && RUBYOPT=-Ilib rake -T") end namespace :man do diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 88fcd4d9e07..18da5915a5d 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "rubygems" + module Bundler class RubygemsIntegration if defined?(Gem::Ext::Builder::CHDIR_MONITOR) diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 06d6a0f2557..b63e39b8d20 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false module Bundler - VERSION = "2.1.1".freeze + VERSION = "2.1.2".freeze def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index befc5f9d090..39240b7404a 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1344,5 +1344,11 @@ def lock_with(ruby_version = nil) expect(last_command.stdboth).not_to include "FAIL" expect(err).to include "private method `require'" end + + it "takes care of requiring rubygems" do + sys_exec("#{Gem.ruby} -I#{lib_dir} -e \"puts require('bundler/setup')\"", "RUBYOPT" => "--disable=gems") + + expect(last_command.stdboth).to eq("true") + end end end diff --git a/task/release.rake b/task/release.rake index cd66ff755d5..e7218d2996d 100644 --- a/task/release.rake +++ b/task/release.rake @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "bundler/gem_tasks" +require_relative "../lib/bundler/gem_tasks" task :build => ["build_metadata"] do Rake::Task["build_metadata:clean"].tap(&:reenable).real_invoke end