From 3c1ab6545829442d30cc8244074f59c9e857755f Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 15 Jan 2024 12:18:48 +0100 Subject: [PATCH] crown: Add a cargo config.toml file (#31090) This makes it more foolproof to install crown from inside the Servo directory, because the root Servo config.toml overrides the rustc to use crown (an obvious circular dependency). --- .github/workflows/windows.yml | 4 ---- python/servo/platform/base.py | 7 +------ support/crown/.cargo/config.toml | 2 ++ 3 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 support/crown/.cargo/config.toml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a17dbec89a2..3367b0b1c2a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -71,10 +71,6 @@ jobs: choco install wixtoolset echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Bootstrap - env: - # We need to override the rustc set in cargo/config.toml, because at - # this point crown is not installed yet. - RUSTC: "rustc" run: | python -m pip install --upgrade pip python mach fetch diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py index 1024ab6c28f..a3909d08c11 100644 --- a/python/servo/platform/base.py +++ b/python/servo/platform/base.py @@ -96,13 +96,8 @@ class Base: return True def install_crown(self, force: bool) -> bool: - # We need to override the rustc set in cargo/config.toml because crown - # may not be installed yet. - env = dict(os.environ) - env["CARGO_BUILD_RUSTC"] = "rustc" - print(" * Installing crown (the Servo linter)...") - if subprocess.call(["cargo", "install", "--path", "support/crown"], env=env) != 0: + if subprocess.call(["cargo", "install", "--path", "support/crown"]) != 0: raise EnvironmentError("Installation of crown failed.") return True diff --git a/support/crown/.cargo/config.toml b/support/crown/.cargo/config.toml new file mode 100644 index 00000000000..66822bc1830 --- /dev/null +++ b/support/crown/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustc = "rustc"