crosfw: Output errors to stderr instead of stdout
IDEs expect errors to be sent to stderr. For example, Kate will not taken
any notice of errors and warnings sent to stdout.
Update the script to use stderr for build output.
BUG=chromium:629855
TEST=add a build error; crosfw -b sandbox -w
See that Kate shows line/file info in its errors/warnings view
Change-Id: I6255f32544d0f0fc81fb4822837d6cbd52d907e6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/431296
Reviewed-by: Chris Ching <chingcodes@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/crosfw.py b/scripts/crosfw.py
index f3a2dbd..61d7365 100644
--- a/scripts/crosfw.py
+++ b/scripts/crosfw.py
@@ -518,7 +518,9 @@
result = cros_build_lib.RunCommand(base + [target], capture_output=True,
combine_stdout_stderr=True, **kwargs)
if result.returncode:
- print("cmd: '%s', output: '%s'" % (result.cmdstr, result.output))
+ # The build failed, so output the results to stderr.
+ print("cmd: '%s', output: '%s'" % (result.cmdstr, result.output),
+ file=sys.stderr)
sys.exit(result.returncode)
files = ['%s/u-boot' % outdir]