author | Jeremy Lempereur <jeremy.lempereur@gmail.com> |
Fri, 16 Mar 2018 12:56:02 -0400 | |
changeset 408619 | fa37f81e428ecd33c9f3de59849543387721f117 |
parent 408618 | c039062bce149c2debc27bfb5a0e5eb471d3d84c |
child 408620 | d1250e3ead1aa2c1b33d8ed98b37c057c427fc00 |
push id | 100996 |
push user | btara@mozilla.com |
push date | Sat, 17 Mar 2018 10:37:43 +0000 |
treeherder | mozilla-inbound@97160a734959 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jdm |
milestone | 61.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/servo/python/servo/command_base.py +++ b/servo/python/servo/command_base.py @@ -397,18 +397,17 @@ class CommandBase(object): return if not nightly_date: print( "No nightly date has been provided although the --nightly or -n flag has been passed.") sys.exit(1) # Will alow us to fetch the relevant builds from the nightly repository os_prefix = "linux" if is_windows(): - print("The nightly flag is not supported on windows yet.") - sys.exit(1) + os_prefix = "windows-msvc" if is_macosx(): print("The nightly flag is not supported on mac yet.") sys.exit(1) nightly_date = nightly_date.strip() # Fetch the filename to download from the build list repository_index = NIGHTLY_REPOSITORY_URL + "?list-type=2&prefix=nightly" req = urllib2.Request( "{}/{}/{}".format(repository_index, os_prefix, nightly_date)) @@ -423,20 +422,23 @@ class CommandBase(object): e.reason)) sys.exit(1) except AttributeError as e: print("Could not fetch a nightly version for date {} and platform {}".format( nightly_date, os_prefix)) sys.exit(1) nightly_target_directory = path.join(self.context.topdir, "target") + # ':' is not an authorized character for a file name on Windows + # make sure the OS specific separator is used + target_file_path = file_to_download.replace(':', '-').split('/') + destination_file = os.path.join( + nightly_target_directory, os.path.join(*target_file_path)) # Once extracted, the nightly folder name is the tar name without the extension # (eg /foo/bar/baz.tar.gz extracts to /foo/bar/baz) - destination_file = path.join( - nightly_target_directory, file_to_download) destination_folder = os.path.splitext(destination_file)[0] nightlies_folder = path.join( nightly_target_directory, 'nightly', os_prefix) # Make sure the target directory exists if not os.path.isdir(nightlies_folder): print("The nightly folder for the target does not exist yet. Creating {}".format( nightlies_folder)) @@ -452,21 +454,30 @@ class CommandBase(object): download_file(destination_file, NIGHTLY_REPOSITORY_URL + file_to_download, destination_file) # Extract the downloaded nightly version if os.path.isdir(destination_folder): print("The nightly file {} has already been extracted.".format( destination_folder)) else: - print("Extracting to {}...".format(destination_folder)) - with tarfile.open(os.path.join(nightlies_folder, destination_file), "r") as tar: - tar.extractall(destination_folder) - - return path.join(destination_folder, "servo", "servo") + print("Extracting to {} ...".format(destination_folder)) + if is_windows(): + command = 'msiexec /a {} /qn TARGETDIR={}'.format( + os.path.join(nightlies_folder, destination_file), destination_folder) + if subprocess.call(command, stdout=PIPE, stderr=PIPE) != 0: + print("Could not extract the nightly executable from the msi package.") + sys.exit(1) + else: + with tarfile.open(os.path.join(nightlies_folder, destination_file), "r") as tar: + tar.extractall(destination_folder) + bin_folder = path.join(destination_folder, "servo") + if is_windows(): + bin_folder = path.join(destination_folder, "PFiles", "Mozilla research", "Servo Tech Demo") + return path.join(bin_folder, "servo{}".format(BIN_SUFFIX)) def build_env(self, hosts_file_path=None, target=None, is_build=False, geckolib=False, test_unit=False): """Return an extended environment dictionary.""" env = os.environ.copy() if sys.platform == "win32" and type(env['PATH']) == unicode: # On win32, the virtualenv's activate_this.py script sometimes ends up # turning os.environ['PATH'] into a unicode string. This doesn't work # for passing env vars in to a process, so we force it back to ascii.