diff options
author | The Bundler Bot <bot@bundler.io> | 2017-07-11 15:34:39 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-07-11 15:34:39 +0000 |
commit | 83f01beb5eaf324f5ae6dba609b604b7f687c348 (patch) | |
tree | c06562a695f1f5e0c3b0dc2fae041df51311d89f | |
parent | 9324c84671292c24f598a367708edd03722b6b5b (diff) | |
parent | 1b66e57dba91b22fabc3e8d6173030ac6e1c26ed (diff) | |
download | bundler-83f01beb5eaf324f5ae6dba609b604b7f687c348.tar.gz |
Auto merge of #5850 - bundler:seg-corrupted-lockfile-show-tree, r=segiddins
[ParallelInstaller] Show require tree when a gem fails to install due to corrupted lockfile
### What was the end-user problem that led to this PR?
The problem was that when installation failed due to a corrupted lockfile or checksum mis-match, we wouldn't show the reason that gem was being installed in the first place, as we would when other errors happened.
See https://github.com/bundler/bundler/issues/5846
### What was your diagnosis of the problem?
My diagnosis was we needed to show that requirement tree whenever installation fails, regardless of the reason for the failure.
### What is your fix for the problem, implemented in this PR?
My fix rescues hard installation errors and re-raises with the tree appended.
-rw-r--r-- | lib/bundler/installer/parallel_installer.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb index 97c124e015..22bc8c51c6 100644 --- a/lib/bundler/installer/parallel_installer.rb +++ b/lib/bundler/installer/parallel_installer.rb @@ -112,7 +112,12 @@ module Bundler gem_installer = Bundler::GemInstaller.new( spec_install.spec, @installer, @standalone, worker_num, @force ) - success, message = gem_installer.install_from_spec + success, message = begin + gem_installer.install_from_spec + rescue => e + raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}" + end + if success && !message.nil? spec_install.post_install_message = message elsif !success |