summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-02-22 13:32:06 +0000
committerThe Bundler Bot <bot@bundler.io>2017-02-22 13:32:06 +0000
commit815200c1a5831710ba3422bf1dcedc5a90c99d2f (patch)
tree2240d071a12a7e69cf74a5e61a1ea42dd4650f0c
parentf99067ff262352e3969ebf46b72d2a5d76f8cc7c (diff)
parent616ebf32816822b70cc865730855928044421285 (diff)
downloadbundler-815200c1a5831710ba3422bf1dcedc5a90c99d2f.tar.gz
Auto merge of #5460 - bundler:seg-sigint-debug-backtrace, r=indirect
Print a backtrace on SIGINT in debug mode I found this helpful when trying to figure out why bundler was going so slowly
-rwxr-xr-xexe/bundle5
-rw-r--r--lib/bundler/worker.rb1
2 files changed, 5 insertions, 1 deletions
diff --git a/exe/bundle b/exe/bundle
index ec88ea7552..ab2bde16e2 100755
--- a/exe/bundle
+++ b/exe/bundle
@@ -2,7 +2,10 @@
# frozen_string_literal: true
# Exit cleanly from an early interrupt
-Signal.trap("INT") { exit 1 }
+Signal.trap("INT") do
+ Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
+ exit 1
+end
update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb
index 62d93e285e..c6b96d815a 100644
--- a/lib/bundler/worker.rb
+++ b/lib/bundler/worker.rb
@@ -76,6 +76,7 @@ module Bundler
def abort_threads
return unless @threads
+ Bundler.ui.debug("\n#{caller.join("\n")}")
@threads.each(&:exit)
exit 1
end