mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Fix autoninja && chrome on failed builds
A handy usage pattern for autoninja.bat that I was not aware of is to go
autoninja -C out\Default chrome && chrome
This will build chrome and then run it, but only run it if the build
succeeds. The addition of post_build_ninja_summary.py broke this by
losing the error code. This change fixes it by using black magic to
set an error code in the failure case.
Bug: chromium:787983
Change-Id: Ib87fd1799816e19d56de76e08e0f9688be903d80
Reviewed-on: https://chromium-review.googlesource.com/916705
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This commit is contained in:
10
autoninja
10
autoninja
@@ -10,7 +10,13 @@
|
||||
command=$(python $(dirname -- "$0")/autoninja.py "$@")
|
||||
echo $command
|
||||
$command
|
||||
if [ $? -eq 0 ] && [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
|
||||
python $(dirname -- "$0")/post_build_ninja_summary.py $@
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
|
||||
python $(dirname -- "$0")/post_build_ninja_summary.py $@
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
# Return an error code of 1 so that if a developer types:
|
||||
# "autoninja chrome && chrome" then chrome won't run if the build fails.
|
||||
exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user