diff options
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/bootstrap_commands.py | 14 | ||||
-rw-r--r-- | python/servo/build_commands.py | 45 | ||||
-rw-r--r-- | python/servo/command_base.py | 17 |
3 files changed, 17 insertions, 59 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index a4cf509f113..13db36079ae 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -138,12 +138,7 @@ class MachCommands(CommandBase): self.set_use_stable_rust(stable) version = self.rust_version() rust_path = self.rust_path() - if stable: - rust_dir = path.join( - self.context.sharedir, "rust", version, rust_path) - else: - rust_dir = path.join( - self.context.sharedir, "rust", rust_path) + rust_dir = path.join(self.context.sharedir, "rust", rust_path) install_dir = path.join(self.context.sharedir, "rust", version) if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)): @@ -160,9 +155,10 @@ class MachCommands(CommandBase): # giving a directory name that will be the same as the tarball name (rustc is # in that directory). if stable: - rustc_url = "https://static.rust-lang.org/dist/%s.tar.gz" % rust_path + tarball = "rustc-%s-%s.tar.gz" % (version, host_triple()) else: - rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/%s.tar.gz" % rust_path + tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple()) + rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball tgz_file = rust_dir + '-rustc.tar.gz' download_file("Rust compiler", rustc_url, tgz_file) @@ -196,7 +192,7 @@ class MachCommands(CommandBase): continue if self.use_stable_rust(): - std_url = ("https://static.rust-lang.org/dist/rust-std-%s-%s.tar.gz" + std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-std-%s-%s.tar.gz" % (version, target_triple)) tgz_file = install_dir + ('rust-std-%s-%s.tar.gz' % (version, target_triple)) else: diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 7a4dba41cfa..0e7151e5efc 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -265,43 +265,6 @@ class MachCommands(CommandBase): print("Build completed in %s" % format_duration(elapsed)) return status - @Command('build-stable', - description='Build Servo using stable rustc', - category='build') - @CommandArgument('--target', '-t', - default=None, - help='Cross compile for given target platform') - @CommandArgument('--release', '-r', - action='store_true', - help='Build in release mode') - @CommandArgument('--dev', '-d', - action='store_true', - help='Build in development mode') - @CommandArgument('--jobs', '-j', - default=None, - help='Number of jobs to run in parallel') - @CommandArgument('--features', - default=None, - help='Space-separated list of features to also build', - nargs='+') - @CommandArgument('--android', - default=None, - action='store_true', - help='Build for Android') - @CommandArgument('--debug-mozjs', - default=None, - action='store_true', - help='Enable debug assertions in mozjs') - @CommandArgument('--verbose', '-v', - action='store_true', - help='Print verbose output') - @CommandArgument('params', nargs='...', - help="Command-line arguments to be passed through to Cargo") - def build_stable(self, target=None, release=False, dev=False, jobs=None, - features=None, android=None, verbose=False, debug_mozjs=False, params=None): - self.set_use_stable_rust() - self.build(target, release, dev, jobs, features, android, verbose, debug_mozjs, params) - @Command('build-cef', description='Build the Chromium Embedding Framework library', category='build') @@ -356,6 +319,7 @@ class MachCommands(CommandBase): action='store_true', help='Build in release mode') def build_geckolib(self, jobs=None, verbose=False, release=False): + self.set_use_stable_rust() self.ensure_bootstrapped() ret = None @@ -367,11 +331,12 @@ class MachCommands(CommandBase): if release: opts += ["--release"] - build_start = time() env = self.build_env() + env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib") + + build_start = time() with cd(path.join("ports", "geckolib")): - ret = call(["cargo", "build"] + opts, - env=env, verbose=verbose) + ret = call(["cargo", "build"] + opts, env=env, verbose=verbose) elapsed = time() - build_start # Generate Desktop Notification if elapsed-time > some threshold value diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 9f4f9096316..a814f58fbf9 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -218,10 +218,11 @@ class CommandBase(object): return self._use_stable_rust def rust_path(self): + version = self.rust_version() if self._use_stable_rust: - return "rustc-%s-%s" % (self.rust_version(), host_triple()) + return "%s/rustc-%s-%s" % (version, version, host_triple()) else: - return "%s/rustc-nightly-%s" % (self.rust_version(), host_triple()) + return "%s/rustc-nightly-%s" % (version, host_triple()) def rust_version(self): if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable: @@ -332,10 +333,7 @@ class CommandBase(object): env["CARGO_HOME"] = self.config["tools"]["cargo-home-dir"] - if self.use_stable_rust(): - env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "ports/stable-rust/target") - elif "CARGO_TARGET_DIR" not in env: - env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target") + env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target") if extra_lib: if sys.platform == "darwin": @@ -436,10 +434,9 @@ class CommandBase(object): rustc_binary_exists = path.exists(rustc_path) base_target_path = path.join(rust_root, "rustc", "lib", "rustlib") - target_exists = True - if target is not None: - target_path = path.join(base_target_path, target) - target_exists = path.exists(target_path) + + target_path = path.join(base_target_path, target or host_triple()) + target_exists = path.exists(target_path) if not (self.config['tools']['system-rust'] or (rustc_binary_exists and target_exists)): print("looking for rustc at %s" % (rustc_path)) |