[autotest] Upgrade setuptools and make errors more visible
setuptools is too old, upgrade it to latest.
Allow _build_and_install to return a tuple of success, error_message.
Then build_externals can print the error at the end as well.
BUG=chromium:510143
TEST=local test
Change-Id: Ia750fd333e6d0d9d137a68b49fafc441094f07bc
Reviewed-on: https://chromium-review.googlesource.com/285646
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
diff --git a/utils/build_externals.py b/utils/build_externals.py
index b404b6e..ccd102a 100755
--- a/utils/build_externals.py
+++ b/utils/build_externals.py
@@ -12,8 +12,7 @@
utils/build_externals.py
"""
-import compileall, logging, os, shutil, sys, tempfile, time, urllib2
-import subprocess, re
+import compileall, logging, os, sys
import common
from autotest_lib.client.common_lib import logging_config, logging_manager
from autotest_lib.client.common_lib import utils
@@ -136,8 +135,16 @@
"""
errors = []
for package in packages:
- if not package.build_and_install(install_dir):
- msg = 'Unable to build and install %s' % package.name
+ result = package.build_and_install(install_dir)
+ if isinstance(result, bool):
+ success = result
+ message = None
+ else:
+ success = result[0]
+ message = result[1]
+ if not success:
+ msg = ('Unable to build and install %s.\nError: %s' %
+ (package.name, message))
logging.error(msg)
errors.append(msg)
return errors