diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-06-12 11:54:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 09:54:45 +0000 |
commit | fd472ebd0edc8eb91155b20e95ea9acfa6e77573 (patch) | |
tree | 357745d9283222d698cc80bf8ec931ff336f6dc3 /python/servo/platform/base.py | |
parent | 370fbf0331d73ae95ea29e67305aa86065c3604b (diff) | |
download | servo-fd472ebd0edc8eb91155b20e95ea9acfa6e77573.tar.gz servo-fd472ebd0edc8eb91155b20e95ea9acfa6e77573.zip |
Add cargo-deny to mach-tidy to check license compliance. (#32465)
* Use cargo-deny to check license compliance.
All licenses should be MPL-2.0 or weaker.
* Run cargo-deny check licenses in mach tidy
* fmt
* Fix inverted boolean
* Move cargo deny to tidy.py
* Add quotes around license in error message
* Integrate `cargo-deny` into tidy fully
* Fix script tests
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'python/servo/platform/base.py')
-rw-r--r-- | python/servo/platform/base.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py index b2957941c6e..0e81f149d9e 100644 --- a/python/servo/platform/base.py +++ b/python/servo/platform/base.py @@ -59,6 +59,7 @@ class Base: if not skip_platform: installed_something |= self._platform_bootstrap(force) installed_something |= self.install_taplo(force) + installed_something |= self.install_cargo_deny(force) installed_something |= self.install_crown(force) if not installed_something: @@ -74,6 +75,16 @@ class Base: return True + def install_cargo_deny(self, force: bool) -> bool: + if not force and shutil.which("cargo-deny") is not None: + return False + + print(" * Installing cargo-deny...") + if subprocess.call(["cargo", "install", "cargo-deny", "--locked"]) != 0: + raise EnvironmentError("Installation of cargo-deny failed.") + + return True + def install_crown(self, force: bool) -> bool: print(" * Installing crown (the Servo linter)...") if subprocess.call(["cargo", "install", "--path", "support/crown"]) != 0: |