diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | Rakefile | 1 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver/spec_group.rb | 1 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 118 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | task/release.rake | 7 |
9 files changed, 99 insertions, 37 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f2a6f742c..990d49d0fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.1.0.pre.1 +## 2.1.0.pre.1 (August 28, 2019) One of the biggest changes in bundler 2.1.0 is that deprecations for upcoming breaking changes in bundler 3 will be turned on by default. We do this to grab @@ -187,6 +187,7 @@ namespace :man do Spec::Rubygems.gem_require("ronn") rescue Gem::LoadError => e task(:build) { abort "We couln't activate ronn (#{e.requirement}). Try `gem install ronn:'#{e.requirement}'` to be able to build the help pages" } + task(:check) { abort "We couln't activate ronn (#{e.requirement}). Try `gem install ronn:'#{e.requirement}'` to be able to build the help pages" } else directory "man" diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 01ee86a358..d6fbb0b5b7 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -317,7 +317,7 @@ module Bundler end def spec_git_paths - sources.git_sources.map {|s| File.realpath(s.path) } + sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact end def groups diff --git a/lib/bundler/resolver/spec_group.rb b/lib/bundler/resolver/spec_group.rb index 119f63b5c8..e5772eed81 100644 --- a/lib/bundler/resolver/spec_group.rb +++ b/lib/bundler/resolver/spec_group.rb @@ -62,6 +62,7 @@ module Bundler end def eql?(other) + return unless other.is_a?(SpecGroup) name.eql?(other.name) && version.eql?(other.version) && source.eql?(other.source) diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 3ef7e809e8..7f9f84c104 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -25,7 +25,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle! "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -52,7 +54,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -80,7 +84,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle! "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -111,8 +117,10 @@ RSpec.describe "bundle clean" do end G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") - bundle "install", forgotten_command_line_options(:without => "test_group") + bundle "config set path vendor/bundle" + bundle "install" + bundle "config set without test_group" + bundle "install" bundle :clean expect(out).to include("Removing rack (1.0.0)") @@ -137,7 +145,8 @@ RSpec.describe "bundle clean" do end G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" bundle :clean @@ -160,7 +169,8 @@ RSpec.describe "bundle clean" do end G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -200,7 +210,8 @@ RSpec.describe "bundle clean" do FileUtils.mkdir_p(bundled_app("real-path")) FileUtils.ln_sf(bundled_app("real-path"), bundled_app("symlink-path")) - bundle "install", forgotten_command_line_options(:path => bundled_app("symlink-path")) + bundle "config set path #{bundled_app("symlink-path")}" + bundle "install" bundle :clean @@ -222,7 +233,8 @@ RSpec.describe "bundle clean" do end G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle! "install" update_git "foo", :path => lib_path("foo-bar") revision2 = revision_for(lib_path("foo-bar")) @@ -252,7 +264,8 @@ RSpec.describe "bundle clean" do gem "activesupport", :git => "#{lib_path("rails")}", :ref => '#{revision}' G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" bundle :clean expect(out).to include("") @@ -274,7 +287,9 @@ RSpec.describe "bundle clean" do end end G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :without => "test") + bundle "config set path vendor/bundle" + bundle "config set without test" + bundle "install" bundle :clean @@ -295,7 +310,9 @@ RSpec.describe "bundle clean" do end G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :without => "development") + bundle "config set path vendor/bundle" + bundle "config set without development" + bundle "install" bundle :clean expect(exitstatus).to eq(0) if exitstatus @@ -324,7 +341,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -372,7 +390,9 @@ RSpec.describe "bundle clean" do gem "thin" gem "rack" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => true) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install --clean true" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -393,7 +413,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => true) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install --clean true" update_repo2 do build_gem "foo", "1.0.1" @@ -436,7 +458,8 @@ RSpec.describe "bundle clean" do gem "thin" gem "rack" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -456,7 +479,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle! "install" update_repo2 do build_gem "foo", "1.0.1" @@ -557,7 +581,8 @@ RSpec.describe "bundle clean" do gem "foo", :git => "#{lib_path("foo-1.0")}" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" # mimic 7 length git revisions in Gemfile.lock gemfile_lock = File.read(bundled_app("Gemfile.lock")).split("\n") @@ -566,7 +591,8 @@ RSpec.describe "bundle clean" do end lockfile(bundled_app("Gemfile.lock"), gemfile_lock.join("\n")) - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" bundle :clean @@ -616,7 +642,8 @@ RSpec.describe "bundle clean" do gem "bar", "1.0", :path => "#{relative_path}" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle "install" bundle! :clean end @@ -628,7 +655,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -656,7 +685,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -684,7 +715,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle "install" bundle "config set dry_run false" gemfile <<-G @@ -714,7 +747,9 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false) + bundle "config set path vendor/bundle" + bundle "config set clean false" + bundle! "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -741,7 +776,8 @@ RSpec.describe "bundle clean" do gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle! "install" expect(vendored_gems("bundler/gems/extensions")).to exist expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist @@ -761,7 +797,8 @@ RSpec.describe "bundle clean" do gem "simple_binary" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle! "install" very_simple_binary_extensions_dir = Pathname.glob("#{vendored_gems}/extensions/*/*/very_simple_binary-1.0").first @@ -800,7 +837,8 @@ RSpec.describe "bundle clean" do gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" G - bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + bundle "config set path vendor/bundle" + bundle! "install" very_simple_binary_extensions_dir = Pathname.glob("#{vendored_gems}/bundler/gems/extensions/*/*/very_simple_git_binary-1.0-#{short_revision}").first @@ -825,4 +863,30 @@ RSpec.describe "bundle clean" do expect(very_simple_binary_extensions_dir).not_to exist end + + it "keeps git extension directories when excluded by group", :ruby_repo do + build_git "very_simple_git_binary", &:add_c_extension + + revision = revision_for(lib_path("very_simple_git_binary-1.0")) + short_revision = revision[0..11] + + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + + group :development do + gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" + end + G + + bundle :lock + bundle "config set without development" + bundle "config set path vendor/bundle" + bundle! "install" + bundle! :clean + + very_simple_binary_extensions_dir = + Pathname.glob("#{vendored_gems}/bundler/gems/extensions/*/*/very_simple_git_binary-1.0-#{short_revision}").first + + expect(very_simple_binary_extensions_dir).to be_nil + end end diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index a36b303060..cf76d3fb93 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -55,7 +55,7 @@ RSpec.describe "bundle exec" do expect(out).to eq("hi") end - it "respects custom process title when loading through ruby", :github_action_linux do + 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") puts `ps -ocommand= -p#{$$}` diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 6c268a7c10..92243a77b6 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -90,7 +90,7 @@ RSpec.describe "bundler/inline#gemfile" do expect(out).to include("Installing activesupport") err.gsub! %r{(.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$)}, "" err_lines = err.split("\n") - err_lines.reject!{|line| line =~ /\.rb:\d+: warning: The last/ } + err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } expect(err_lines).to be_empty expect(exitstatus).to be_zero if exitstatus end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f10f6c464f..58d498e070 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -71,7 +71,6 @@ RSpec.configure do |config| config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0]) config.filter_run_excluding :ruby_repo => !ENV["GEM_COMMAND"].nil? config.filter_run_excluding :no_color_tty => Gem.win_platform? || !ENV["GITHUB_ACTION"].nil? - config.filter_run_excluding :github_action_linux => !ENV["GITHUB_ACTION"].nil? && (ENV["RUNNER_OS"] == "Linux") config.filter_run_when_matching :focus unless ENV["CI"] diff --git a/task/release.rake b/task/release.rake index 73d3d5045c..f5573eac5e 100644 --- a/task/release.rake +++ b/task/release.rake @@ -4,7 +4,7 @@ require "bundler/gem_tasks" task :build => ["build_metadata"] do Rake::Task["build_metadata:clean"].tap(&:reenable).real_invoke end -task :release => ["release:verify_docs", "release:verify_files", "release:verify_github", "build_metadata"] +task "release:rubygem_push" => ["release:verify_docs", "release:verify_files", "release:verify_github", "build_metadata", "release:github"] namespace :release do task :verify_docs => :"man:check" @@ -129,6 +129,7 @@ namespace :release do relevant.join("\n").strip end + desc "Push the release to Github releases" task :github, :version do |_t, args| version = Gem::Version.new(args.version) tag = "v#{version}" @@ -142,10 +143,6 @@ namespace :release do } end - task :release do |args| - Rake::Task["release:github"].invoke(args.version) - end - desc "Make a patch release with the PRs from master in the patch milestone" task :patch, :version do |_t, args| version = args.version |