diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2020-01-02 15:27:25 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2020-01-02 15:48:11 +0100 |
commit | 1110cac184d15ba24f8f94cb21e258de4ba5be76 (patch) | |
tree | e2f448a2d4adee0676484059b6da33c49d7360aa | |
parent | 6f70a9c1de649ce38e014eaa8fa3b22f862768a9 (diff) | |
download | servo-1110cac184d15ba24f8f94cb21e258de4ba5be76.tar.gz servo-1110cac184d15ba24f8f94cb21e258de4ba5be76.zip |
mach + rustup: use the minimal profile and install rustc-dev
-rw-r--r-- | etc/taskcluster/decision_task.py | 24 | ||||
-rw-r--r-- | etc/taskcluster/decisionlib.py | 1 | ||||
-rw-r--r-- | etc/taskcluster/docker/build.dockerfile | 3 | ||||
-rw-r--r-- | python/servo/command_base.py | 9 | ||||
-rw-r--r-- | python/servo/devenv_commands.py | 4 |
5 files changed, 15 insertions, 26 deletions
diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index a3d70653794..414b129405d 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -181,9 +181,6 @@ def linux_tidy_unit_untrusted(): .with_dockerfile(dockerfile_path("build")) .with_env(**build_env, **unix_build_env, **linux_build_env) .with_repo_bundle() - .with_script("rustup set profile minimal") - # required by components/script_plugins: - .with_script("rustup component add rustc-dev") .with_script(""" ./mach test-tidy --no-progress --all ./mach test-tidy --no-progress --self-test @@ -304,11 +301,10 @@ def with_rust_nightly(): modified_build_env["RUSTFLAGS"] = " ".join(flags) return ( - linux_build_task("with Rust Nightly", build_env=modified_build_env, install_rustc_dev=False) + linux_build_task("with Rust Nightly", build_env=modified_build_env) .with_treeherder("Linux x64", "RustNightly") .with_script(""" echo "nightly" > rust-toolchain - rustup component add rustc-dev ./mach build --dev ./mach test-unit """) @@ -850,7 +846,7 @@ def macos_task(name): ) -def linux_build_task(name, *, build_env=build_env, install_rustc_dev=True): +def linux_build_task(name, *, build_env=build_env): task = ( linux_task(name) # https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/caches @@ -867,14 +863,8 @@ def linux_build_task(name, *, build_env=build_env, install_rustc_dev=True): .with_dockerfile(dockerfile_path("build")) .with_env(**build_env, **unix_build_env, **linux_build_env) .with_repo_bundle() - .with_script(""" - rustup set profile minimal - ./mach bootstrap-gstreamer - """) + .with_script("./mach bootstrap-gstreamer") ) - if install_rustc_dev: - # required by components/script_plugins: - task = task.with_script("rustup component add rustc-dev") return task @@ -920,9 +910,6 @@ def windows_build_task(name, package=True, arch="x86_64"): path="python3", ) .with_rustup() - .with_script("rustup set profile minimal") - # required by components/script_plugins: - .with_script("rustup component add rustc-dev") ) if arch in hashes["non-devel"] and arch in hashes["devel"]: task = ( @@ -968,11 +955,6 @@ def macos_build_task(name): .with_repo_bundle(alternate_object_dir="/var/cache/servo.git/objects") .with_python2() .with_rustup() - # Since macOS workers are long-lived and ~/.rustup kept across tasks: - .with_script("rustup self update") - .with_script("rustup set profile minimal") - # required by components/script_plugins: - .with_script("rustup component add rustc-dev") .with_index_and_artifacts_expire_in(build_artifacts_expire_in) # Debugging for surprising generic-worker behaviour .with_early_script("ls") diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index b8d878da9d8..2dca9e882ac 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -693,6 +693,7 @@ class MacOsGenericWorkerTask(UnixTaskMixin, GenericWorkerTask): return self.with_early_script(""" export PATH="$HOME/.cargo/bin:$PATH" which rustup || curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y + rustup self update """) diff --git a/etc/taskcluster/docker/build.dockerfile b/etc/taskcluster/docker/build.dockerfile index c5e148c4df3..e5a1edafc4a 100644 --- a/etc/taskcluster/docker/build.dockerfile +++ b/etc/taskcluster/docker/build.dockerfile @@ -44,7 +44,8 @@ RUN \ # && \ # - # + # Install the version of rustup that is current when this Docker image is being built: + # We want at least 1.21 (increment in this comment to force an image rebuild). curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none --profile=minimal -y && \ # # diff --git a/python/servo/command_base.py b/python/servo/command_base.py index f8c1bcb0610..f42a36fc738 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -1009,7 +1009,12 @@ install them, let us know by filing a bug!") toolchain = self.rust_toolchain() if toolchain not in check_output(["rustup", "toolchain", "list"]): - check_call(["rustup", "toolchain", "install", toolchain]) + check_call(["rustup", "toolchain", "install", "--profile", "minimal", toolchain]) + + if "rustc-dev" not in check_output( + ["rustup", "component", "list", "--installed", "--toolchain", toolchain] + ): + check_call(["rustup", "component", "add", "--toolchain", toolchain, "rustc-dev"]) if target and "uwp" not in target and target not in check_output( ["rustup", "target", "list", "--installed", "--toolchain", toolchain] @@ -1029,7 +1034,7 @@ install them, let us know by filing a bug!") return 1 raise version = tuple(map(int, re.match(b"rustup (\d+)\.(\d+)\.(\d+)", version_line).groups())) - if version < (1, 11, 0): + if version < (1, 21, 0): print("rustup is at version %s.%s.%s, Servo requires 1.11.0 or more recent." % version) print("Try running 'rustup self update'.") return 1 diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 658ef547f21..bc715205523 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -24,7 +24,7 @@ from mach.decorators import ( Command, ) -from servo.command_base import CommandBase, cd, call, BIN_SUFFIX +from servo.command_base import CommandBase, cd, call from servo.build_commands import notify_build_done from servo.util import get_static_rust_lang_org_dist, get_urlopen_kwargs @@ -213,7 +213,7 @@ class MachCommands(CommandBase): filename = path.join(self.context.topdir, "rust-toolchain") with open(filename, "w") as f: f.write(toolchain + "\n") - return call(["rustup" + BIN_SUFFIX, "component", "add", "rustc-dev"]) + self.ensure_bootstrapped() @Command('fetch', description='Fetch Rust, Cargo and Cargo dependencies', |