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)
This commit is contained in:
Vladimir Vukicevic 2015-09-22 15:09:54 -04:00 committed by Lars Bergstrom
parent 77aea599c7
commit ee863fde59
6 changed files with 74 additions and 49 deletions

View file

@ -22,7 +22,7 @@ from mach.decorators import (
Command,
)
from servo.command_base import CommandBase, cd
from servo.command_base import CommandBase, cd, call, check_call
def read_file(filename, if_exists=False):
@ -114,7 +114,7 @@ class PostBuildCommands(CommandBase):
args = args + params
try:
subprocess.check_call(args, env=env)
check_call(args, env=env)
except subprocess.CalledProcessError as e:
print("Servo exited with return value %d" % e.returncode)
return e.returncode
@ -142,7 +142,7 @@ class PostBuildCommands(CommandBase):
servo_cmd = [self.get_binary_path(release, dev)] + params
rr_cmd = ['rr', '--fatal-errors', 'record']
try:
subprocess.check_call(rr_cmd + servo_cmd)
check_call(rr_cmd + servo_cmd)
except OSError as e:
if e.errno == 2:
print("rr binary can't be found!")
@ -154,7 +154,7 @@ class PostBuildCommands(CommandBase):
category='post-build')
def rr_replay(self):
try:
subprocess.check_call(['rr', '--fatal-errors', 'replay'])
check_call(['rr', '--fatal-errors', 'replay'])
except OSError as e:
if e.errno == 2:
print("rr binary can't be found!")
@ -191,8 +191,8 @@ class PostBuildCommands(CommandBase):
else:
copy2(full_name, destination)
return subprocess.call(["cargo", "doc"] + params,
env=self.build_env(), cwd=self.servo_crate())
return call(["cargo", "doc"] + params,
env=self.build_env(), cwd=self.servo_crate())
@Command('browse-doc',
description='Generate documentation and open it in a web browser',