Run autoninja scripts using vpython.

Bug: 1002153
Change-Id: I769a5370d726f4ce478035f59bfd1df50fef452e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992315
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/15/1992315/4
Edward Lemur 6 years ago committed by LUCI CQ
parent 2247035813
commit 59a3b2fd5d

@ -20,16 +20,16 @@ if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
fi fi
if eval "$command"; then if eval "$command"; then
if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
python "$(dirname -- "$0")/post_build_ninja_summary.py" "$@" vpython "$(dirname -- "$0")/post_build_ninja_summary.py" "$@"
fi fi
# Collect ninjalog from googler. # Collect ninjalog from googler.
"$(dirname -- "$0")/ninjalog_uploader_wrapper.py" --cmd $command vpython "$(dirname -- "$0")/ninjalog_uploader_wrapper.py" --cmd $command
exit exit
fi fi
# Collect ninjalog from googler. # Collect ninjalog from googler.
"$(dirname -- "$0")/ninjalog_uploader_wrapper.py" --cmd $command vpython "$(dirname -- "$0")/ninjalog_uploader_wrapper.py" --cmd $command
# Return an error code of 1 so that if a developer types: # Return an error code of 1 so that if a developer types:
# "autoninja chrome && chrome" then chrome won't run if the build fails. # "autoninja chrome && chrome" then chrome won't run if the build fails.

@ -19,14 +19,14 @@ REM Also print it to reassure that the right settings are being used.
FOR /f "usebackq tokens=*" %%a in (`vpython %~dp0autoninja.py "%*"`) do echo %%a & %%a FOR /f "usebackq tokens=*" %%a in (`vpython %~dp0autoninja.py "%*"`) do echo %%a & %%a
@if errorlevel 1 goto buildfailure @if errorlevel 1 goto buildfailure
REM Use call to invoke python script here, because we use python via python.bat. REM Use call to invoke vpython script here, because we use vpython via vpython.bat.
@if "%NINJA_SUMMARIZE_BUILD%" == "1" call python.bat %~dp0post_build_ninja_summary.py %* @if "%NINJA_SUMMARIZE_BUILD%" == "1" call vpython.bat %~dp0post_build_ninja_summary.py %*
@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %* @call vpython.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*
exit /b exit /b
:buildfailure :buildfailure
@call python.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %* @call vpython.bat %~dp0ninjalog_uploader_wrapper.py --cmdline %*
REM Return an error code of 1 so that if a developer types: REM Return an error code of 1 so that if a developer types:
REM "autoninja chrome && chrome" then chrome won't run if the build fails. REM "autoninja chrome && chrome" then chrome won't run if the build fails.

@ -27,10 +27,6 @@ import subprocess
import sys import sys
import time import time
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party'))
import httplib2 import httplib2
# These build configs affect build performance a lot. # These build configs affect build performance a lot.

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2018 The Chromium Authors. All rights reserved. # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
@ -6,11 +6,11 @@
from __future__ import print_function from __future__ import print_function
import os import os
import subprocess
import json import json
import sys import sys
import ninjalog_uploader import ninjalog_uploader
import subprocess2
THIS_DIR = os.path.dirname(__file__) THIS_DIR = os.path.dirname(__file__)
UPLOADER = os.path.join(THIS_DIR, 'ninjalog_uploader.py') UPLOADER = os.path.join(THIS_DIR, 'ninjalog_uploader.py')
@ -110,8 +110,8 @@ def main():
# Run upload script without wait. # Run upload script without wait.
devnull = open(os.devnull, "w") devnull = open(os.devnull, "w")
subprocess.Popen([sys.executable, UPLOADER] + sys.argv[1:], subprocess2.Popen(['vpython', UPLOADER] + sys.argv[1:],
stdout=devnull, stderr=devnull) stdout=devnull, stderr=devnull)
if __name__ == '__main__': if __name__ == '__main__':

@ -1,3 +1,4 @@
#!/usr/bin/env vpython
# Copyright (c) 2018 The Chromium Authors. All rights reserved. # Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.

Loading…
Cancel
Save