diff options
author | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 17:23:39 +0000 |
---|---|---|
committer | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 17:23:39 +0000 |
commit | dfb5c824570e1fe0e594874f359e29e510052482 (patch) | |
tree | 3047dd9ba86df860c029a10ea6fd9d373bbe49c1 /native_client_sdk | |
parent | 454d2c3f13f2ba1a31b9b9c90b903e55874e364c (diff) | |
download | chromium_src-dfb5c824570e1fe0e594874f359e29e510052482.zip chromium_src-dfb5c824570e1fe0e594874f359e29e510052482.tar.gz chromium_src-dfb5c824570e1fe0e594874f359e29e510052482.tar.bz2 |
[NaCl SDK] Handle subprocess failures during sdk build
This avoids overly verbose stacktraces in response to
subcommand failures.
BUG=None
R=binji@chromium.org
Review URL: https://codereview.chromium.org/16171022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r-- | native_client_sdk/src/build_tools/buildbot_common.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/native_client_sdk/src/build_tools/buildbot_common.py b/native_client_sdk/src/build_tools/buildbot_common.py index e8b215625..46d8499 100644 --- a/native_client_sdk/src/build_tools/buildbot_common.py +++ b/native_client_sdk/src/build_tools/buildbot_common.py @@ -39,7 +39,7 @@ def IsSDKTrybot(): def ErrorExit(msg): """Write and error to stderr, then exit with 1 signaling failure.""" - sys.stderr.write(msg + '\n') + sys.stderr.write(str(msg) + '\n') sys.exit(1) @@ -110,7 +110,13 @@ def Run(args, cwd=None, env=None, shell=False): print 'Running: ' + ' '.join(args) sys.stdout.flush() sys.stderr.flush() - subprocess.check_call(args, cwd=cwd, env=env, shell=shell) + try: + subprocess.check_call(args, cwd=cwd, env=env, shell=shell) + except subprocess.CalledProcessError as e: + sys.stdout.flush() + sys.stderr.flush() + ErrorExit('buildbot_common: %s' % e) + sys.stdout.flush() sys.stderr.flush() @@ -179,10 +185,8 @@ def Archive(filename, bucket_path, cwd=None, step_link=True): """Upload the given filename to Google Store.""" full_dst = 'gs://%s/%s' % (bucket_path, filename) - subprocess.check_call( - '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), - shell=True, - cwd=cwd) + cmd = [GetGsutil(), 'cp', '-a', 'public-read', filename, full_dst] + Run(cmd, shell=True, cwd=cwd) url = 'https://commondatastorage.googleapis.com/'\ '%s/%s' % (bucket_path, filename) if step_link: |