diff options
-rw-r--r-- | CHANGELOG.md | 15 | ||||
-rw-r--r-- | lib/bundler/plugin/api/source.rb | 6 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 6 | ||||
-rw-r--r-- | lib/bundler/version.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 20 |
5 files changed, 47 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 69a56af175..6cf533d16c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.14.5 (2017-02-22) + +Bugfixes: + + - avoid loading all unused gemspecs during `bundle exec` on RubyGems 2.3+ (@segiddins) + - improve resolver performance when dependencies have zero or one total possibilities ignoring requirements (#5444, #5457, @segiddins) + - enable compact index when OpenSSL FIPS mode is enabled but not active (#5433, @wjordan) + - use github username instead of git name for the github url in `bundle gem` (#5438, @danielpclark) + - avoid a TypeError on RubyGems 2.6.8 when no build settings are set for native extensions (@okkez) + - fail gracefully when the dependency api is missing runtime dependencies for a gem (@segiddins) + - handle when a platform-specific gem has more dependencies than the ruby platform version (#5339, #5426, @segiddins) + - allow running bundler on a machine with no home directory where the temporary directory is not writable (#5371, @segiddins) + - avoid gem version conflicts on openssl using Ruby 2.5 (#5235, @rhenium) + - fail when installing in frozen mode and the dependencies for `gemspec` gems have changed without the lockfile being updated (#5264, @segiddins) + ## 1.14.4 (2017-02-12) Bugfixes: diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb index 04173b4ee9..5d3f58df92 100644 --- a/lib/bundler/plugin/api/source.rb +++ b/lib/bundler/plugin/api/source.rb @@ -287,6 +287,12 @@ module Bundler def root Bundler.root end + + # @private + # Returns true + def bundler_plugin_api_source? + true + end end end end diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 53a153e560..7293e7cfc7 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -42,7 +42,11 @@ module Gem attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=) def full_gem_path - if source.respond_to?(:path) || source.is_a?(Bundler::Plugin::API::Source) + # this cannot check source.is_a?(Bundler::Plugin::API::Source) + # because that _could_ trip the autoload, and if there are unresolved + # gems at that time, this method could be called inside another require, + # thus raising with that constant being undefined. Better to check a method + if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?) Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint else rg_full_gem_path diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 4ba59366d4..36cc05cb39 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -7,5 +7,5 @@ module Bundler # We're doing this because we might write tests that deal # with other versions of bundler and we are unsure how to # handle this better. - VERSION = "1.14.4" unless defined?(::Bundler::VERSION) + VERSION = "1.14.5" unless defined?(::Bundler::VERSION) end diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 541a7e4008..e2534be1ad 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -192,6 +192,26 @@ RSpec.describe "bundle install from an existing gemspec" do expect(@err).not_to match(/ahh/) end + it "allows the gemspec to activate other gems" do + # see https://github.com/bundler/bundler/issues/5409 + # + # issue was caused by rubygems having an unresolved gem during a require, + # so emulate that + system_gems %w(rack-1.0.0 rack-0.9.1 rack-obama-1.0) + + build_lib("foo", :path => bundled_app) + gemspec = bundled_app("foo.gemspec").read + bundled_app("foo.gemspec").open("w") do |f| + f.write "#{gemspec.strip}.tap { gem 'rack-obama'; require 'rack-obama' }" + end + + install_gemfile! <<-G + gemspec + G + + expect(the_bundle).to include_gem "foo 1.0" + end + it "allows conflicts" do build_lib("foo", :path => tmp.join("foo")) do |s| s.version = "1.0.0" |