diff options
author | Vladimir Vukicevic <vladimir@pobox.com> | 2015-09-22 15:09:54 -0400 |
---|---|---|
committer | Lars Bergstrom <lars@lars.com> | 2016-01-20 08:38:24 -0600 |
commit | ee863fde5993f0f7bae2acf06e1fae21bd459c88 (patch) | |
tree | 452fbf59927fee6339756c973cf8ca3074211463 /python/servo/devenv_commands.py | |
parent | 77aea599c76278d7efd92efbdae8392d7e93a832 (diff) | |
download | servo-ee863fde5993f0f7bae2acf06e1fae21bd459c88.tar.gz servo-ee863fde5993f0f7bae2acf06e1fae21bd459c88.zip |
win32: mach and build command fixes
- Add SERVO_USE_NIGHTLY_RUST env var to use the latest rust/cargo nightly snapshot
- Fix up looking for cargo binary (in cargo/bin/cargo, not bin/cargo)
- Fix up win32 executable checking (use .exe suffix)
- fix up win32 PATH handling (subprocess must use shell=True for PATH change to be honored)
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r-- | python/servo/devenv_commands.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 484e308e291..015ae3c91af 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -10,7 +10,6 @@ from __future__ import print_function, unicode_literals from os import path, getcwd, listdir -import subprocess import sys from mach.decorators import ( @@ -19,7 +18,7 @@ from mach.decorators import ( Command, ) -from servo.command_base import CommandBase, cd +from servo.command_base import CommandBase, cd, call @CommandProvider @@ -36,10 +35,8 @@ class MachCommands(CommandBase): if self.context.topdir == getcwd(): with cd(path.join('components', 'servo')): - return subprocess.call( - ["cargo"] + params, env=self.build_env()) - return subprocess.call(['cargo'] + params, - env=self.build_env()) + return call(["cargo"] + params, env=self.build_env()) + return call(['cargo'] + params, env=self.build_env()) @Command('cargo-update', description='Same as update-cargo', @@ -89,8 +86,8 @@ class MachCommands(CommandBase): for cargo_path in cargo_paths: with cd(cargo_path): print(cargo_path) - subprocess.call(["cargo", "update"] + params, - env=self.build_env()) + call(["cargo", "update"] + params, + env=self.build_env()) @Command('clippy', description='Run Clippy', @@ -111,7 +108,7 @@ class MachCommands(CommandBase): def rustc(self, params): if params is None: params = [] - return subprocess.call(["rustc"] + params, env=self.build_env()) + return call(["rustc"] + params, env=self.build_env()) @Command('rust-root', description='Print the path to the root of the Rust compiler', @@ -140,7 +137,7 @@ class MachCommands(CommandBase): root_dirs_abs = [path.join(self.context.topdir, s) for s in root_dirs] # Absolute paths for all directories to be considered grep_paths = root_dirs_abs + tests_dirs_abs - return subprocess.call( + return call( ["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js'], env=self.build_env()) @@ -149,14 +146,14 @@ class MachCommands(CommandBase): category='devenv') def upgrade_wpt_runner(self): with cd(path.join(self.context.topdir, 'tests', 'wpt', 'harness')): - code = subprocess.call(["git", "init"], env=self.build_env()) + code = call(["git", "init"], env=self.build_env()) if code: return code - subprocess.call( + call( ["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=self.build_env()) - code = subprocess.call(["git", "fetch", "upstream"], env=self.build_env()) + code = call(["git", "fetch", "upstream"], env=self.build_env()) if code: return code - code = subprocess.call(["git", "reset", '--', "hard", "remotes/upstream/master"], env=self.build_env()) + code = call(["git", "reset", '--', "hard", "remotes/upstream/master"], env=self.build_env()) if code: return code |