summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-02-13 14:10:14 -0600
committerSamuel Giddins <segiddins@segiddins.me>2017-02-13 14:10:19 -0600
commit986a2ea581edfd70cd1a2a6936c981fd4c92f6d0 (patch)
tree141b9bb79d4764978102980974525efa6abe4b69
parentad5aaa7c9b3a6e09fea980015d9c8666525858a1 (diff)
downloadbundler-986a2ea581edfd70cd1a2a6936c981fd4c92f6d0.tar.gz
Print a debug warning where the corrupted API deps came from
-rw-r--r--lib/bundler/endpoint_specification.rb1
-rw-r--r--lib/bundler/remote_specification.rb1
-rw-r--r--lib/bundler/source/rubygems/remote.rb4
-rw-r--r--spec/install/gems/compact_index_spec.rb4
4 files changed, 8 insertions, 2 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index fbba025779..65f6b6fbcf 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -93,6 +93,7 @@ module Bundler
def __swap__(spec)
without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) }
if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
+ Bundler.ui.debug "#{full_name} from #{remote} has corrupted API dependencies"
raise APIResponseMismatchError,
"Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&:to_s).join(", ")})." \
"\nInstalling with `--full-index` should fix the problem."
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index c62c5d61d2..3d201fbf16 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -52,6 +52,7 @@ module Bundler
def __swap__(spec)
without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) }
if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
+ Bundler.ui.debug "#{full_name} from #{remote} has corrupted API dependencies"
raise APIResponseMismatchError,
"Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&:to_s).join(", ")})." \
"\nInstalling with `--full-index` should fix the problem."
diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb
index 92f8a40588..b49e645506 100644
--- a/lib/bundler/source/rubygems/remote.rb
+++ b/lib/bundler/source/rubygems/remote.rb
@@ -30,6 +30,10 @@ module Bundler
end
end
+ def to_s
+ "rubygems remote at #{anonymized_uri}"
+ end
+
private
def apply_auth(uri, auth)
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index 3f39e420b7..66e643e978 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -755,11 +755,11 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "doesn't explode when the API dependencies are wrong" do
- install_gemfile <<-G, :artifice => "compact_index_wrong_dependencies"
+ install_gemfile <<-G, :artifice => "compact_index_wrong_dependencies", :env => { "DEBUG" => "true" }
source "#{source_uri}"
gem "rails"
G
- expect(out).to end_with(<<-E.strip)
+ expect(out).to include(<<-E.strip).and include("rails-2.3.2 from rubygems remote at #{source_uri}/ has corrupted API dependencies")
Downloading rails-2.3.2 revealed dependencies not in the API (rake (= 10.0.2), actionpack (= 2.3.2), activerecord (= 2.3.2), actionmailer (= 2.3.2), activeresource (= 2.3.2)).
Installing with `--full-index` should fix the problem.
E