diff options
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/bootstrap_commands.py | 10 | ||||
-rw-r--r-- | python/servo/command_base.py | 18 | ||||
-rw-r--r-- | python/servo/devenv_commands.py | 21 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 4 | ||||
-rw-r--r-- | python/servo/util.py | 6 |
5 files changed, 28 insertions, 31 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 8975f174d84..aa298611825 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -70,6 +70,8 @@ class MachCommands(CommandBase): rust_path = self.rust_path() rust_dir = path.join(self.context.sharedir, "rust", rust_path) install_dir = path.join(self.context.sharedir, "rust", version) + if not self.config["build"]["llvm-assertions"]: + install_dir += "-alt" if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)): print("Rust compiler already downloaded.", end=" ") @@ -86,9 +88,13 @@ class MachCommands(CommandBase): # in that directory). if stable: tarball = "rustc-%s-%s.tar.gz" % (version, host_triple()) + rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball else: tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple()) - rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball + base_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds" + if not self.config["build"]["llvm-assertions"]: + base_url += "-alt" + rustc_url = base_url + "/" + tarball tgz_file = rust_dir + '-rustc.tar.gz' download_file("Rust compiler", rustc_url, tgz_file) @@ -126,7 +132,7 @@ class MachCommands(CommandBase): % (version, target_triple)) tgz_file = install_dir + ('rust-std-%s-%s.tar.gz' % (version, target_triple)) else: - std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s/rust-std-nightly-%s.tar.gz" + std_url = ("https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/rust-std-nightly-%s.tar.gz" % (version, target_triple)) tgz_file = install_dir + ('rust-std-nightly-%s.tar.gz' % target_triple) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 3169e9c9d6a..34ce2bfc682 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -23,7 +23,7 @@ from mach.registrar import Registrar import toml from servo.packages import WINDOWS_MSVC as msvc_deps -from servo.util import host_triple +from servo.util import host_triple, host_platform BIN_SUFFIX = ".exe" if sys.platform == "win32" else "" @@ -258,15 +258,20 @@ class CommandBase(object): self.config["tools"].setdefault("system-cargo", False) self.config["tools"].setdefault("rust-root", "") self.config["tools"].setdefault("cargo-root", "") - self.set_use_stable_rust(False) if not self.config["tools"]["system-cargo"]: self.config["tools"]["cargo-root"] = path.join( context.sharedir, "cargo", self.cargo_build_id()) self.config["tools"].setdefault("rustc-with-gold", get_env_bool("SERVO_RUSTC_WITH_GOLD", True)) + # https://github.com/rust-lang/rust/pull/39754 + platforms_with_rustc_alt_builds = ["unknown-linux-gnu", "apple-darwin", "pc-windows-msvc"] + llvm_assertions_default = ("SERVO_RUSTC_LLVM_ASSERTIONS" in os.environ + or host_platform() not in platforms_with_rustc_alt_builds) + self.config.setdefault("build", {}) self.config["build"].setdefault("android", False) self.config["build"].setdefault("mode", "") + self.config["build"].setdefault("llvm-assertions", llvm_assertions_default) self.config["build"].setdefault("debug-mozjs", False) self.config["build"].setdefault("ccache", "") self.config["build"].setdefault("rustflags", "") @@ -279,6 +284,8 @@ class CommandBase(object): self.config["android"].setdefault("platform", "android-18") self.config["android"].setdefault("target", "arm-linux-androideabi") + self.set_use_stable_rust(False) + _use_stable_rust = False _rust_version = None _rust_version_is_stable = False @@ -297,13 +304,14 @@ class CommandBase(object): version = self.rust_version() if self._use_stable_rust: return os.path.join(version, "rustc-%s-%s" % (version, host_triple())) - else: - return os.path.join(version, "rustc-nightly-%s" % (host_triple())) + if not self.config["build"]["llvm-assertions"]: + version += "-alt" + return os.path.join(version, "rustc-nightly-%s" % (host_triple())) def rust_version(self): if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable: filename = path.join(self.context.topdir, - "rust-stable-version" if self._use_stable_rust else "rust-nightly-date") + "rust-stable-version" if self._use_stable_rust else "rust-commit-hash") with open(filename) as f: self._rust_version = f.read().strip() return self._rust_version diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index e2acab9b979..bb5ed6d2704 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 ( @@ -87,26 +86,6 @@ class MachCommands(CommandBase): call(["cargo", "update"] + params, env=self.build_env()) - @Command('clippy', - description='Run Clippy', - category='devenv') - @CommandArgument( - '--package', '-p', default=None, - help='Updates the selected package') - @CommandArgument( - '--json', '-j', action="store_true", - help='Outputs') - def clippy(self, package=None, json=False): - params = ["--features=clippy"] - if package: - params += ["-p", package] - if json: - params += ["--", "-Zunstable-options", "--error-format", "json"] - - with cd(path.join(self.context.topdir, "components", "servo")): - return subprocess.call(["cargo", "rustc", "-v"] + params, - env=self.build_env()) - @Command('rustc', description='Run the Rust compiler', category='devenv') diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 2417483c4df..0733911d2b4 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -232,7 +232,7 @@ class MachCommands(CommandBase): test_patterns.append(test) if not packages: - packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) + packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store']) packages.discard('stylo') @@ -345,7 +345,7 @@ class MachCommands(CommandBase): test_patterns.append(test) if not packages: - packages = set(os.listdir(path.join(self.context.topdir, "tests", "compiletest"))) + packages = set(os.listdir(path.join(self.context.topdir, "tests", "compiletest"))) - set(['.DS_Store']) packages.remove("helper") diff --git a/python/servo/util.py b/python/servo/util.py index 03f993b3bf0..77fba165446 100644 --- a/python/servo/util.py +++ b/python/servo/util.py @@ -20,7 +20,7 @@ import zipfile import urllib2 -def host_triple(): +def host_platform(): os_type = platform.system().lower() if os_type == "linux": os_type = "unknown-linux-gnu" @@ -42,7 +42,11 @@ def host_triple(): os_type = "unknown-freebsd" else: os_type = "unknown" + return os_type + +def host_triple(): + os_type = host_platform() cpu_type = platform.machine().lower() if os_type.endswith("-msvc"): # vcvars*.bat should set it properly |