diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-08-01 16:44:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 14:44:57 +0000 |
commit | fef332f38552ae8af83cf69993dd6aabdebffd6a (patch) | |
tree | 577bca564e78c7b8a2e02e7e9b3431518533edae /python/servo/testing_commands.py | |
parent | 4061d13ba6d06f775e1a4a0fe50662ea3b16d2fa (diff) | |
download | servo-fef332f38552ae8af83cf69993dd6aabdebffd6a.tar.gz servo-fef332f38552ae8af83cf69993dd6aabdebffd6a.zip |
Make rustup a requirement and switch to `rust-toolchain.toml` (#30056)
This change makes rustup a requirement for building Servo with `./mach`
and switches to the newer `rust-toolchain.toml` format. The goal here is
to make mach builds more similar to non-mach builds.
- The new format allows listing the required components, removing some of
the complexity from our mach scripts.
- This means we must raise the required version of rustup to 1.23. The
current version is 1.26.
- We no longer wrap every call to cargo and rustc in "rustup run" calls
as both cargo and rustc will take care of installing and using all
necessary components specified in `rust-toolchain.toml` when run
inside the project directory.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 799e5ff6ac5..549b5aed842 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -263,14 +263,6 @@ class MachCommands(CommandBase): "tests/wpt/mozilla/.") return 0 - def install_rustfmt(self): - self.ensure_bootstrapped() - with open(os.devnull, "w") as devnull: - if self.call_rustup_run(["cargo", "fmt", "--version", "-q"], - stderr=devnull) != 0: - # Rustfmt is not installed. Install: - self.call_rustup_run(["rustup", "component", "add", "rustfmt-preview"]) - @Command('test-tidy', description='Run the source code tidiness check', category='testing') @@ -289,8 +281,7 @@ class MachCommands(CommandBase): else: manifest_dirty = wpt.manifestupdate.update(check_clean=True) tidy_failed = tidy.scan(not all_files, not no_progress, stylo=stylo, no_wpt=no_wpt) - self.install_rustfmt() - rustfmt_failed = self.call_rustup_run(["cargo", "fmt", "--", "--check"]) + rustfmt_failed = call(["cargo", "fmt", "--", "--check"]) if rustfmt_failed: print("Run `./mach fmt` to fix the formatting") @@ -404,8 +395,7 @@ class MachCommands(CommandBase): description='Format the Rust and CPP source files with rustfmt', category='testing') def format_code(self): - self.install_rustfmt() - return self.call_rustup_run(["cargo", "fmt"]) + return call(["cargo", "fmt"]) @Command('update-wpt', description='Update the web platform tests', |