mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Revert "Use rustup "proxies" instead of rustup run
"
This reverts commit ad22368646290510149d33a0a41fc436ac4a0e96.
This commit is contained in:
parent
2618e4ed9d
commit
ded0bc9365
1 changed files with 13 additions and 12 deletions
|
@ -14,6 +14,7 @@ import itertools
|
|||
import locale
|
||||
import os
|
||||
from os import path
|
||||
import re
|
||||
import contextlib
|
||||
import subprocess
|
||||
from subprocess import PIPE
|
||||
|
@ -136,8 +137,7 @@ def call(*args, **kwargs):
|
|||
kwargs['env'] = normalize_env(kwargs['env'])
|
||||
# we have to use shell=True in order to get PATH handling
|
||||
# when looking for the binary on Windows
|
||||
kwargs.setdefault("shell", sys.platform == "win32")
|
||||
return subprocess.call(*args, **kwargs)
|
||||
return subprocess.call(*args, shell=sys.platform == 'win32', **kwargs)
|
||||
|
||||
|
||||
def check_output(*args, **kwargs):
|
||||
|
@ -149,8 +149,7 @@ def check_output(*args, **kwargs):
|
|||
kwargs['env'] = normalize_env(kwargs['env'])
|
||||
# we have to use shell=True in order to get PATH handling
|
||||
# when looking for the binary on Windows
|
||||
kwargs.setdefault("shell", sys.platform == "win32")
|
||||
return subprocess.check_output(*args, **kwargs)
|
||||
return subprocess.check_output(*args, shell=sys.platform == 'win32', **kwargs)
|
||||
|
||||
|
||||
def check_call(*args, **kwargs):
|
||||
|
@ -166,8 +165,7 @@ def check_call(*args, **kwargs):
|
|||
print(' '.join(args[0]))
|
||||
# we have to use shell=True in order to get PATH handling
|
||||
# when looking for the binary on Windows
|
||||
kwargs.setdefault("shell", sys.platform == "win32")
|
||||
proc = subprocess.Popen(*args, **kwargs)
|
||||
proc = subprocess.Popen(*args, shell=sys.platform == 'win32', **kwargs)
|
||||
status = None
|
||||
# Leave it to the subprocess to handle Ctrl+C. If it terminates as
|
||||
# a result of Ctrl+C, proc.wait() will return a status code, and,
|
||||
|
@ -324,22 +322,25 @@ class CommandBase(object):
|
|||
return self._default_toolchain
|
||||
|
||||
def call_rustup_run(self, args, **kwargs):
|
||||
args[0] += BIN_SUFFIX
|
||||
if self.config["tools"]["use-rustup"]:
|
||||
try:
|
||||
kwargs.setdefault("env", {})["RUSTUP_TOOLCHAIN"] = self.toolchain()
|
||||
return call(args, executable="rustup" + BIN_SUFFIX, shell=False, **kwargs)
|
||||
version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"])
|
||||
except OSError as e:
|
||||
if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
|
||||
print repr(e)
|
||||
print
|
||||
print "It looks like rustup is not installed. See instructions at " \
|
||||
"https://github.com/servo/servo/#setting-up-your-environment"
|
||||
print
|
||||
return 1
|
||||
raise
|
||||
version = tuple(map(int, re.match("rustup (\d+)\.(\d+)\.(\d+)", version_line).groups()))
|
||||
if version < (1, 8, 0):
|
||||
print "rustup is at version %s.%s.%s, Servo requires 1.8.0 or more recent." % version
|
||||
print "Try running 'rustup self update'."
|
||||
return 1
|
||||
args = ["rustup" + BIN_SUFFIX, "run", "--install", self.toolchain()] + args
|
||||
else:
|
||||
return call(args, **kwargs)
|
||||
args[0] += BIN_SUFFIX
|
||||
return call(args, **kwargs)
|
||||
|
||||
def get_top_dir(self):
|
||||
return self.context.topdir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue