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

Unified Diff: third_party/instrumented_libraries/scripts/download_binaries.py

Issue 1019573003: Instrumented libraries: add a hook to download pre-built binaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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
« build/common.gypi ('K') | « build/common.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/instrumented_libraries/scripts/download_binaries.py
diff --git a/third_party/instrumented_libraries/scripts/download_binaries.py b/third_party/instrumented_libraries/scripts/download_binaries.py
new file mode 100755
index 0000000000000000000000000000000000000000..8069f2e5aed86f7be40e5f70b031237808df74df
--- /dev/null
+++ b/third_party/instrumented_libraries/scripts/download_binaries.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+# Copyright (c) 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Downloads pre-built sanitizer-instrumented third-party libraries from GCS."""
+
+import os
+import subprocess
+import sys
+
+def get_ubuntu_release():
+ supported_releases = ['precise', 'trusty']
+ release = subprocess.check_output(['lsb_release', '-cs']).strip()
+ if release not in supported_releases:
+ raise Exception("Supported Ubuntu versions: %s", str(supported_releases))
+ return release
+
+
+def get_configuration(gyp_defines):
+ if 'msan=1' in gyp_defines:
+ if 'msan_track_origins=2' in gyp_defines:
Nico 2015/03/19 18:31:00 do we need to support multiple modes for this? can
earthdok 2015/03/23 13:02:56 We may want to support track_origins=0. It's used
Nico 2015/03/23 16:35:09 If there's only one mode, where would the abi inco
+ return 'msan-chained-origins'
+ if 'msan_track_origins' not in gyp_defines:
+ # NB: must be the same as the default value in common.gypi
+ return 'msan-chained-origins'
+ raise Exception(
+ "Prebuilt instrumented libraries not available for your configuration.")
+
+
+def get_archive_name(gyp_defines):
+ return "%s-%s.tgz" % (get_configuration(gyp_defines), get_ubuntu_release())
+
+
+def main(args):
+ gyp_defines = os.environ.get('GYP_DEFINES', '')
+ if not 'use_prebuilt_instrumented_libraries=1' in gyp_defines:
+ return 0
+
Nico 2015/03/19 18:31:00 error out here if not on linux?
earthdok 2015/03/23 13:02:56 Done.
+ archive_name = get_archive_name(gyp_defines)
+ sha1file = '%s.sha1' % archive_name
+ target_directory = 'src/third_party/instrumented_libraries/binaries/'
+
+ subprocess.check_call([
+ 'download_from_google_storage',
+ '--no_resume',
+ '--no_auth',
+ '--bucket', 'chromium-instrumented-libraries',
+ '-s', sha1file], cwd=target_directory)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
« build/common.gypi ('K') | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698