consistently print failed build command if a builder fails

This commit is contained in:
Josh Holtrop 2017-05-19 10:57:30 -04:00
parent 6344692087
commit 5cef9896ac

View File

@ -304,10 +304,8 @@ module Rscons
job[:vars], job[:vars],
allow_delayed_execution: true, allow_delayed_execution: true,
setup_info: job[:setup_info]) setup_info: job[:setup_info])
unless result.is_a?(ThreadedCommand) unless result
unless result raise BuildError.new("Failed to build #{job[:target]}")
raise BuildError.new("Failed to build #{job[:target]}")
end
end end
end end
@ -337,6 +335,9 @@ module Rscons
build_hook_block.call(tc.build_operation) build_hook_block.call(tc.build_operation)
end end
else else
unless @echo == :command
$stdout.write "Failed command was: #{command_to_s(tc.command)}"
end
raise BuildError.new("Failed to build #{tc.build_operation[:target]}") raise BuildError.new("Failed to build #{tc.build_operation[:target]}")
end end
end end
@ -393,8 +394,7 @@ module Rscons
options_args = options[:options] ? [options[:options]] : [] options_args = options[:options] ? [options[:options]] : []
system(*env_args, *Rscons.command_executer, *command, *options_args).tap do |result| system(*env_args, *Rscons.command_executer, *command, *options_args).tap do |result|
unless result or @echo == :command unless result or @echo == :command
$stdout.write "Failed command was: " $stdout.write "Failed command was: #{command_to_s(command)}"
puts command_to_s(command)
end end
end end
end end
@ -622,7 +622,13 @@ module Rscons
rv = builder.finalize( rv = builder.finalize(
command_status: tc.thread.value, command_status: tc.thread.value,
builder_info: tc.builder_info) builder_info: tc.builder_info)
call_build_hooks[:post] if rv if rv
call_build_hooks[:post]
else
unless @echo == :command
$stdout.write "Failed command was: #{command_to_s(tc.command)}"
end
end
end end
else else
call_build_hooks[:post] if rv call_build_hooks[:post] if rv