Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: third_party/instrumented_libraries/download_build_install.py

Issue 113443003: Disable library dependencies check by default (instrumented libs). (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/instrumented_libraries/instrumented_libraries.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/instrumented_libraries/download_build_install.py
===================================================================
--- third_party/instrumented_libraries/download_build_install.py (revision 241259)
+++ third_party/instrumented_libraries/download_build_install.py (working copy)
@@ -52,6 +52,13 @@
build_dependencies = [l.strip() for l in command_result.stdout]
return build_dependencies
+def check_library_build_dependencies(library):
+ build_dependencies = get_library_build_dependencies(library)
+ if len(build_dependencies):
+ print >> sys.stderr, 'Please, install build-dependencies for %s' % library
+ print >> sys.stderr, 'One-liner for APT:'
+ print >> sys.stderr, 'sudo apt-get -y --no-remove build-dep %s' % library
+ sys.exit(1)
def shell_call(command, verbose=False, environment=None):
""" Wrapper on subprocess.Popen
@@ -111,17 +118,25 @@
# There should be exactly one subdirectory after downloading a package.
subdirectories = [d for d in os.listdir('.') if os.path.isdir(d)]
if len(subdirectories) != 1:
- raise Exception('There was not one directory after downloading ' \
- 'a package %s' % parsed_arguments.library)
+ raise (Exception('There was not one directory after downloading '
+ 'a package %s' % parsed_arguments.library))
with ScopedChangeDirectory(subdirectories[0]):
# Now we are in the package directory.
configure_command = './configure %s --prefix=%s' % (
parsed_arguments.custom_configure_flags, install_prefix)
- shell_call(configure_command, parsed_arguments.verbose, environment)
- shell_call('make -j%s' % parsed_arguments.jobs, parsed_arguments.verbose)
- shell_call('make -j%s install' % parsed_arguments.jobs,
- parsed_arguments.verbose)
-
+ try:
+ shell_call(configure_command, parsed_arguments.verbose, environment)
+ shell_call('make -j%s' % parsed_arguments.jobs,
+ parsed_arguments.verbose, environment)
+ shell_call('make -j%s install' % parsed_arguments.jobs,
+ parsed_arguments.verbose, environment)
+ except Exception as exception:
+ print exception
+ print "Failed to build library %s." % parsed_arguments.library
+ print ("Probably, some of its dependencies are not installed: %s" %
+ ' '.join(get_library_build_dependencies(parsed_arguments.library)))
+ sys.exit(1)
+
# Touch a txt file to indicate library is installed.
open('%s/%s.txt' % (install_prefix, parsed_arguments.library), 'w').close()
@@ -143,7 +158,8 @@
argument_parser.add_argument('-s', '--sanitizer-type', required=True,
choices=SUPPORTED_SANITIZERS.keys())
argument_parser.add_argument('-v', '--verbose', action='store_true')
-
+ argument_parser.add_argument('--check-build-deps', action='store_true')
+
# Ignore all empty arguments because in several cases gyp passes them to the
# script, but ArgumentParser treats them as positional arguments instead of
# ignoring (and doesn't have such options).
@@ -152,15 +168,9 @@
# Ensure current working directory is this script directory.
os.chdir(get_script_absolute_path())
# Ensure all build dependencies are installed.
- build_dependencies = get_library_build_dependencies(parsed_arguments.library)
- if len(build_dependencies):
- print >> sys.stderr, 'Please, install build-dependencies for %s' % \
- parsed_arguments.library
- print >> sys.stderr, 'One-liner for APT:'
- print >> sys.stderr, 'sudo apt-get -y --no-remove build-dep %s' % \
- parsed_arguments.library
- sys.exit(1)
-
+ if parsed_arguments.check_build_deps:
+ check_library_build_dependencies(parsed_arguments.library)
+
download_build_install(parsed_arguments)
« no previous file with comments | « no previous file | third_party/instrumented_libraries/instrumented_libraries.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698