WebKit Bugzilla
Attachment 340445 Details for
Bug 185045
: Enhanced Download Build Product Script with Additional Use Cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185045-20180515194303.patch (text/plain), 24.98 KB, created by
Amal Hussein
on 2018-05-15 16:43:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Amal Hussein
Created:
2018-05-15 16:43:04 PDT
Size:
24.98 KB
patch
obsolete
>Subversion Revision: 231800 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 59c7bdb9ba453e156395e47cc17e5cd148321550..04013dce36036c46a07677c3f2a5e272733dc27b 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,51 @@ >+2018-05-15 Amal Hussein <amal@bocoup.com> >+ >+ Add Support for a Download Build Product Script >+ https://bugs.webkit.org/show_bug.cgi?id=185045 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * BuildSlaveSupport/build.webkit.org-config/steps.py: >+ (DownloadBuiltProduct): >+ * BuildSlaveSupport/built-product-archive: >+ (main): >+ (archiveBuiltProduct): >+ (unzipArchive): >+ (extractBuiltProduct): >+ * BuildSlaveSupport/download-built-product: >+ (main): >+ * Scripts/bisect-builds: >+ (bisect_builds): >+ (download_and_extract_archive): >+ (find_ge): >+ (get_indices_from_revisions): >+ (minified_platforms): >+ (unminified_platforms): >+ (print_list_and_exit): >+ (main): >+ (download_archive): Deleted. >+ (extract_archive): Deleted. >+ (get_api_url): Deleted. >+ (get_sorted_revisions): Deleted. >+ (get_s3_location_for_revision): Deleted. >+ * Scripts/webkitpy/common/build_binaries_fetcher.py: Added. >+ (BuildBinariesFetcher): >+ (BuildBinariesFetcher.__init__): >+ (BuildBinariesFetcher.local_downloaded_binaries_directory): >+ (BuildBinariesFetcher.local_extracted_directory): >+ (BuildBinariesFetcher.s3_build_type): >+ (BuildBinariesFetcher.s3_build_binaries_url): >+ (BuildBinariesFetcher.s3_build_binaries_single_revision_url): >+ (BuildBinariesFetcher.local_zip_path): >+ (BuildBinariesFetcher._get_archives_json): >+ (BuildBinariesFetcher._prompt_user_to_delete_first): >+ (BuildBinariesFetcher.get_path): >+ (BuildBinariesFetcher.get_sorted_revisions): >+ (BuildBinariesFetcher._get_latest_build_revision): >+ (BuildBinariesFetcher._fetch_build_binaries): >+ (BuildBinariesFetcher._fetch_build_binaries_zip): >+ (BuildBinariesFetcher._extract_zip_archive): >+ > 2018-05-15 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, rolling out r230749 >diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py b/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py >index a78473370de63b6b3dae5ba0f859c53eeb1144d8..6743215c27ed0f7c7233598eeb14661190e18974 100644 >--- a/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py >+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py >@@ -306,7 +306,7 @@ class UploadMinifiedBuiltProduct(UploadBuiltProduct): > > class DownloadBuiltProduct(shell.ShellCommand): > command = ["python", "./Tools/BuildSlaveSupport/download-built-product", >- WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), >+ WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), WithProperties("--delete-first"), WithProperties("--no-extract"), > WithProperties(S3URL + "archives.webkit.org/%(fullPlatform)s-%(architecture)s-%(configuration)s/%(got_revision)s.zip")] > name = "download-built-product" > description = ["downloading built product"] >diff --git a/Tools/BuildSlaveSupport/built-product-archive b/Tools/BuildSlaveSupport/built-product-archive >index 68fe4ba552134f6915af2a9750add9ceed3f8fce..94819e75ae79934be76f7fde962d03fbe4cffb5d 100644 >--- a/Tools/BuildSlaveSupport/built-product-archive >+++ b/Tools/BuildSlaveSupport/built-product-archive >@@ -44,9 +44,9 @@ def main(): > parser.add_option("--platform", dest="platform") > parser.add_option("--debug", action="store_const", const="debug", dest="configuration") > parser.add_option("--release", action="store_const", const="release", dest="configuration") >- parser.add_option("--minify", action="store_true", dest="minify", default=False, >- help="Create a minified archive by removing files that are not necessary for running applications against the built product, at the cost of complicating debugging.") >- >+ parser.add_option("--minify", action="store_true", dest="minify", default=False, help="Create a minified archive by removing files that are not necessary for running applications against the built product, at the cost of complicating debugging.") >+ parser.add_option("--build-directory", dest="build_directory", help="Path to zip file executables which need to be extracted") >+ > options, (action, ) = parser.parse_args() > if not options.platform: > parser.error("Platform is required") >@@ -70,7 +70,7 @@ def main(): > if action == 'archive': > return archiveBuiltProduct(options.configuration, genericPlatform, options.platform, options.minify) > else: >- return extractBuiltProduct(options.configuration, genericPlatform) >+ return extractBuiltProduct(options.configuration, genericPlatform, options.build_directory) > > > def webkitBuildDirectoryForConfigurationAndPlatform(configuration, platform, fullPlatform='', returnTopLevelDirectory=False): >@@ -239,9 +239,8 @@ def archiveBuiltProduct(configuration, platform, fullPlatform, minify=False): > if createZipFromList(neededDirectories, configuration, excludePattern='*.o'): > return 1 > >-def unzipArchive(directoryToExtractTo, configuration): >- archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild")) >- assert os.path.isdir(archiveDir) >+def unzipArchive(archiveDir, directoryToExtractTo, configuration): >+ > archiveFile = os.path.join(archiveDir, configuration + ".zip") > > if sys.platform == 'darwin': >@@ -258,19 +257,22 @@ def unzipArchive(directoryToExtractTo, configuration): > os.unlink(archiveFile) > > >-def extractBuiltProduct(configuration, platform): >+def extractBuiltProduct(configuration, platform, build_directory): > assert platform in ('mac', 'win', 'gtk', 'ios', 'wpe', 'wincairo') >+ archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild")) >+ assert os.path.isdir(archiveDir) > >- archiveFile = os.path.join(_topLevelBuildDirectory, configuration + '.zip') >+ if build_directory: >+ return unzipArchive(build_directory, build_directory, configuration) > > removeDirectoryIfExists(_configurationBuildDirectory) > os.makedirs(_configurationBuildDirectory) > > if platform in ('mac', 'ios'): >- return unzipArchive(_topLevelBuildDirectory, configuration) >+ return unzipArchive(archiveDir, _topLevelBuildDirectory, configuration) > elif platform in ('win', 'gtk', 'wpe', 'wincairo'): > print 'Extracting', _configurationBuildDirectory >- return unzipArchive(_configurationBuildDirectory, configuration) >+ return unzipArchive(archiveDir, _configurationBuildDirectory, configuration) > > > if __name__ == '__main__': >diff --git a/Tools/BuildSlaveSupport/download-built-product b/Tools/BuildSlaveSupport/download-built-product >index 8bb68ea613c81d73fee0f76b73eff8f97a339722..5cdac2883ce6862b816aa72adf15c6ba7cac52de 100644 >--- a/Tools/BuildSlaveSupport/download-built-product >+++ b/Tools/BuildSlaveSupport/download-built-product >@@ -1,6 +1,6 @@ > #!/usr/bin/env python > # >-# Copyright (C) 2009 Apple Inc. All rights reserved. >+# Copyright (C) 2012-2018 Apple Inc. All rights reserved. > # Copyright (C) 2012 Google Inc. All rights reserved. > # > # Redistribution and use in source and binary forms, with or without >@@ -24,33 +24,43 @@ > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > >- >-import optparse >+import argparse > import os >-import subprocess > import sys >-import urllib >+import logging > >+# exposing webkitpy from this path >+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'Scripts')) >+ >+from webkitpy.common.build_binaries_fetcher import BuildBinariesFetcher >+from webkitpy.common.host import Host > >-def main(): >- parser = optparse.OptionParser("usage: %prog [options] [url]") >- parser.add_option("--platform", dest="platform") >- parser.add_option("--debug", action="store_const", const="debug", dest="configuration") >- parser.add_option("--release", action="store_const", const="release", dest="configuration") > >- options, (url, ) = parser.parse_args() >+_log = logging.getLogger(__name__) > >- archiveDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild")) >- if not os.path.isdir(archiveDir): >- os.makedirs(archiveDir) >- archivePath = os.path.join(archiveDir, "%s.zip" % options.configuration) >+logging.basicConfig() > >- if sys.platform == 'win32': # curl is not availble on Windows (outside of cygwin) >- urllib.urlretrieve(url, archivePath) >- return 0 >+_log.setLevel(logging.INFO) > >- return subprocess.call(["curl", "--fail", "--output", archivePath, url]) >+BUILD_DIRECTORY = 'DownloadedBinaries' >+ >+def main(): >+ parser = argparse.ArgumentParser(description='Downloads and extracts archive executables') >+ parser.add_argument("--platform", dest="platform", required=True, help='Platform to use (e.g., "mac-highsierra")') >+ parser.add_argument("--configuration", default="release", dest="configuration", help='Set the configuration to Release or Debug') >+ parser.add_argument("--debug", action="store_const", const="debug", dest="configuration", help='Alias for --configuration=debug') >+ parser.add_argument("--release", action="store_const", const="release", dest="configuration", help='Alias for --configuration=release') >+ parser.add_argument('--architecture', default='x86_64', help='The architecture to query [x86_64 | i386]') >+ parser.add_argument('--build-directory', nargs='?', const=BUILD_DIRECTORY, help='Path to build executables, and defaults if nothing is passed in') >+ parser.add_argument('--full', action='store_true', default=False, help='Use full archives containing debug symbols. These are significantly larger files!') >+ parser.add_argument('--revision', default=None, help='Pass in a build revision number from WebKit archives to download binaries. Revision=None will download the latest build.') >+ parser.add_argument('--delete-first', action='store_true', default=False, help='Override an exisiting build directory.') >+ parser.add_argument('--no-extract', action='store_true', default=False, help='Only download archives without extracting.') >+ parser.add_argument('url', nargs='?', help='Full url to the s3 zip archive file.') >+ args = parser.parse_args() > >+ build_binaries_fetcher = BuildBinariesFetcher(Host(), args.platform, args.architecture, args.configuration, args.full, args.revision, args.build_directory, args.delete_first, args.no_extract, args.url) >+ build_binaries_fetcher.get_path() > > if __name__ == '__main__': > sys.exit(main()) >diff --git a/Tools/Scripts/bisect-builds b/Tools/Scripts/bisect-builds >index b3e59fe9f69aac6bc12c9993248791af047b2727..f5085af4050e94b878299e876ab9039300d5b376 100755 >--- a/Tools/Scripts/bisect-builds >+++ b/Tools/Scripts/bisect-builds >@@ -28,20 +28,15 @@ > > import argparse > import bisect >-import json > import math > import os > import shutil > import subprocess > import sys > import tempfile >-import urllib2 >-import urlparse >- >-REST_API_URL = 'https://q1tzqfy48e.execute-api.us-west-2.amazonaws.com/v2/' >-REST_API_ENDPOINT = 'archives/' >-REST_API_MINIFIED_ENDPOINT = 'minified-archives/' > >+from webkitpy.common.build_binaries_fetcher import BuildBinariesFetcher >+from webkitpy.common.host import Host > > def bisect_builds(revision_list, start_index, end_index, options): > while True: >@@ -49,8 +44,7 @@ def bisect_builds(revision_list, start_index, end_index, options): > if index_to_test == None: > print('No more builds to test...') > exit(1) >- download_archive(options, revision_list[index_to_test]) >- extract_archive(options) >+ download_and_extract_archive(options, revision_list[index_to_test]) > reproduces = test_archive(options, revision_list[index_to_test]) > > if reproduces: # bisect left >@@ -61,17 +55,13 @@ def bisect_builds(revision_list, start_index, end_index, options): > bisect_builds(revision_list, index_to_test, end_index, options) > > >-def download_archive(options, revision): >- api_url = get_api_url(options) >- s3_url = get_s3_location_for_revision(api_url, revision) >- print('Archive URL: {}'.format(s3_url)) >- command = ['python', '../BuildSlaveSupport/download-built-product', '--{}'.format(options.configuration), '--platform', options.platform, s3_url] >- print('Downloading revision: {}'.format(revision)) >- subprocess.check_call(command) >+def download_and_extract_archive(options, revision): >+ command = ['python', '../BuildSlaveSupport/download-built-product', '--{}'.format(options.configuration), '--platform', options.platform, '--architecture', options.architecture, '--revision', str(revision), '--delete-first'] > >+ if options.full: >+ command.extend(['--full']) > >-def extract_archive(options): >- command = ['python', '../BuildSlaveSupport/built-product-archive', '--platform', options.platform, '--%s' % options.configuration, 'extract'] >+ print('Downloading revision: {}'.format(revision)) > subprocess.check_call(command) > > >@@ -92,17 +82,6 @@ def find_ge(a, x): > raise ValueError > # ---- end bisect helpers ---- > >- >-def get_api_url(options): >- if options.full: >- base_url = urlparse.urljoin(REST_API_URL, REST_API_ENDPOINT) >- else: >- base_url = urlparse.urljoin(REST_API_URL, REST_API_MINIFIED_ENDPOINT) >- >- api_url = urlparse.urljoin(base_url, '-'.join([options.platform, options.architecture, options.configuration])) >- return api_url >- >- > def get_indices_from_revisions(revision_list, start_revision, end_revision): > if start_revision is None: > print('WARNING: No starting revision was given, defaulting to first available for this configuration') >@@ -119,21 +98,6 @@ def get_indices_from_revisions(revision_list, start_revision, end_revision): > return start_index, end_index > > >-def get_sorted_revisions(revisions_dict): >- revisions = [int(item['revision']['N']) for item in revisions_dict['revisions']['Items']] >- return sorted(revisions) >- >- >-def get_s3_location_for_revision(url, revision): >- url = '/'.join([url, str(revision)]) >- r = urllib2.urlopen(url) >- data = json.load(r) >- >- for archive in data['archive']: >- s3_url = archive['s3_url'] >- return s3_url >- >- > def parse_args(args): > helptext = 'bisect-builds is designed to help pinpoint regressions to specific code changes. It does this by bisecting across archives produced by build.webkit.org. Full and "minified" archives are available. Minified archives are significantly smaller, as they have been stripped of dSYMs and other non-essential components.' > parser = argparse.ArgumentParser(description=helptext) >@@ -191,12 +155,12 @@ def test_archive(options, revision): > > > def minified_platforms(): >- # FIXME: query this dynamically from API >+ # FIXME: query this dynamically from API - tracked via https://bugs.webkit.org/show_bug.cgi?id=185163 > return ['mac-elcapitan', 'mac-sierra', 'mac-highsierra', 'ios-simulator-10', 'ios-simulator-11'] > > > def unminified_platforms(): >- # FIXME: query this dynamically from API >+ # FIXME: query this dynamically from API - tracked via https://bugs.webkit.org/show_bug.cgi?id=185163 > return ['gtk', 'ios-simulator-10', 'ios-simulator-11', 'mac-elcapitan', 'mac-sierra', 'mac-highsierra', 'win', 'wpe'] > > >@@ -224,20 +188,18 @@ def print_list_and_exit(revision_list, options): > exit(0) > > def main(options): >- validate_options(options) > >- url = get_api_url(options) >- r = urllib2.urlopen(url) >- data = json.load(r) >- >- revision_list = get_sorted_revisions(data) >+ validate_options(options) >+ build_binaries_fetcher = BuildBinariesFetcher(Host(), options.platform, options.architecture, options.configuration, options.full) >+ revision_list = build_binaries_fetcher.get_sorted_revisions() > > if options.list: > print_list_and_exit(revision_list, options) > > start_index, end_index = get_indices_from_revisions(revision_list, options.start, options.end) > print('Bisecting between {} and {}'.format(revision_list[start_index], revision_list[end_index])) >- >+ >+ > # from here forward, use indices instead of revisions > bisect_builds(revision_list, start_index, end_index, options) > >diff --git a/Tools/Scripts/webkitpy/common/build_binaries_fetcher.py b/Tools/Scripts/webkitpy/common/build_binaries_fetcher.py >new file mode 100644 >index 0000000000000000000000000000000000000000..c539e84977eced607813543865fffb91a3676f11 >--- /dev/null >+++ b/Tools/Scripts/webkitpy/common/build_binaries_fetcher.py >@@ -0,0 +1,188 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+import os >+import json >+import subprocess >+import logging >+from urllib2 import urlopen, HTTPError, URLError >+from webkitpy.common.webkit_finder import WebKitFinder >+ >+REST_API_URL = 'https://q1tzqfy48e.execute-api.us-west-2.amazonaws.com/v2/' >+REST_API_ENDPOINT = 'archives/' >+REST_API_MINIFIED_ENDPOINT = 'minified-archives/' >+ >+_log = logging.getLogger(__name__) >+ >+logging.basicConfig() >+ >+_log.setLevel(logging.INFO) >+ >+ >+class BuildBinariesFetcher: >+ >+ def __init__(self, host, platform, architecture='x86_64', configuration='release', full=False, revision=None, build_directory=None, delete_first=False, no_extract=False, url=None): >+ self.host = host >+ self.platform = platform >+ self.architecture = architecture >+ self.configuration = configuration >+ self.revision = revision >+ self.build_directory = build_directory >+ self.should_use_download_unminified_url = full >+ self.should_delete_first = delete_first >+ self.should_not_extract = no_extract >+ self.s3_zip_url = url >+ >+ @property >+ def local_downloaded_binaries_directory(self): >+ build_directory = ('WebkitBuild', ) >+ >+ if self.build_directory: >+ build_directory = ', '.join(self.build_directory.split('/')), self.platform + self.architecture + self.revision >+ >+ return WebKitFinder(self.host.filesystem).path_from_webkit_base(*build_directory) >+ >+ @property >+ def local_extracted_directory(self): >+ return WebKitFinder(self.host.filesystem).path_from_webkit_base(self.local_downloaded_binaries_directory, self.configuration.capitalize()) >+ >+ @property >+ def s3_build_type(self): >+ return "{self.platform}-{self.architecture}-{self.configuration}".format(self=self).lower() >+ >+ @property >+ def s3_build_binaries_url(self): >+ s3_api_base_path = self.host.filesystem.join(REST_API_URL, REST_API_MINIFIED_ENDPOINT) >+ if self.should_use_download_unminified_url: >+ s3_api_base_path = self.host.filesystem.join(REST_API_URL, REST_API_ENDPOINT) >+ return self.host.filesystem.join(s3_api_base_path, self.s3_build_type) >+ >+ @property >+ def s3_build_binaries_single_revision_url(self): >+ return self.host.filesystem.join(self.s3_build_binaries_url, self.revision) >+ >+ @property >+ def local_zip_path(self): >+ return self.host.filesystem.join(self.local_downloaded_binaries_directory, self.configuration + '.zip') >+ >+ @staticmethod >+ def _get_archives_json(url): >+ response = urlopen(url) >+ build_binaries_json = json.load(response) >+ >+ _log.info('Fetching JSON from %s', url) >+ return build_binaries_json >+ >+ def _prompt_user_to_delete_first(self): >+ ans = raw_input('\n A build already exists at %s. Do you want to override it [y/n]: ' % self.local_extracted_directory) >+ ans = ans.lower() >+ if 'y' in ans: >+ return True >+ if 'n' in ans: >+ return False >+ else: >+ self._prompt_user_to_delete_first() >+ >+ def get_path(self): >+ try: >+ if self.s3_zip_url: >+ self.revision = os.path.basename(self.s3_zip_url).strip('.zip') >+ >+ if not self.revision: >+ self.revision = self._get_latest_build_revision() >+ >+ # check to see if previously downloaded local version exists before downloading >+ if self.host.filesystem.exists(self.local_extracted_directory) and not self.should_delete_first: >+ >+ if not self._prompt_user_to_delete_first(): >+ _log.info('\n Aborting... to download build in another directory use the --build-directory flag') >+ exit(0) >+ >+ return self._fetch_build_binaries() >+ except KeyboardInterrupt: >+ _log.error('\n User interrupted cmd...exiting') >+ except Exception as error: >+ raise error >+ >+ def get_sorted_revisions(self): >+ build_binaries_json = self._get_archives_json(self.s3_build_binaries_url) >+ revisions = [int(item['revision']['N']) for item in build_binaries_json['revisions']['Items']] >+ return sorted(revisions) >+ >+ def _get_latest_build_revision(self): >+ build_binaries_json = self._get_archives_json(self.s3_build_binaries_url) >+ items = build_binaries_json['revisions']['Items'] >+ if not items: >+ raise Exception('No build revisions found at: %s' % self.s3_build_binaries_url) >+ >+ latest_revision_index = len(items) - 1 >+ latest_build_revision = items[latest_revision_index]['revision']['N'] >+ >+ _log.info('Defaulting to fetching the latest build revision: %s' % latest_build_revision) >+ >+ return latest_build_revision >+ >+ def _fetch_build_binaries(self): >+ >+ if not self.s3_zip_url: >+ build_binaries_json = self._get_archives_json(self.s3_build_binaries_single_revision_url) >+ >+ if not build_binaries_json['archive']: >+ raise Exception('22 No build revisions found at: %s' % self.s3_build_binaries_url) >+ >+ self.s3_zip_url = build_binaries_json['archive'][0]['s3_url'] >+ >+ return self._fetch_build_binaries_zip() >+ >+ def _fetch_build_binaries_zip(self): >+ >+ try: >+ _log.info("Starting ZipFile Download: %s" % self.s3_zip_url) >+ build_zip = urlopen(self.s3_zip_url) >+ >+ self.host.filesystem.maybe_make_directory(self.local_downloaded_binaries_directory) >+ >+ with open(self.local_zip_path, "wb") as local_build_binaries: >+ _log.info("Writing ZipFile To Local Drive: %s" % self.local_zip_path) >+ local_build_binaries.write(build_zip.read()) >+ >+ if not self.should_not_extract: >+ _log.info("Extracting ZipFile") >+ >+ self._extract_zip_archive() >+ >+ _log.info("Extracted Binaries Can Be Found Here: %s" % self.local_downloaded_binaries_directory) >+ >+ return self.local_downloaded_binaries_directory >+ except HTTPError: >+ raise Exception('HTTP Error: internet connectivity is required fetch binary file') >+ except URLError: >+ raise Exception('URLError Error: please make sure %s is a valid link' % self.s3_build_binaries_url) >+ >+ def _extract_zip_archive(self): >+ extract_script_path = WebKitFinder(self.host.filesystem).path_from_webkit_base('Tools', 'BuildSlaveSupport', 'built-product-archive') >+ command = ['python', extract_script_path, '--platform', self.platform.lower(), '--%s' % self.configuration.lower(), 'extract'] >+ >+ if self.build_directory: >+ command.extend(['--build-directory', self.local_downloaded_binaries_directory]) >+ >+ subprocess.check_call(command) >diff --git a/.gitignore b/.gitignore >index e934031387bebcbfa0cb138f26d276b87c5681e0..24222ea38a5ee7b94b2370ecae26108a78cc9bf3 100644 >--- a/.gitignore >+++ b/.gitignore >@@ -10,6 +10,7 @@ build/ > autoinstall.cache.d > project.xcworkspace > xcuserdata >+/DownloadedBinaries/ > > # Ignore auto-generated files by VS2005 and VS2010. > *.vcproj.*.user
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185045
:
339013
|
340416
| 340445 |
340459