From f795a150fe01b68bdd62503c39fbdc9ed04a5219 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Wed, 15 Mar 2023 12:50:04 +0000 Subject: chore: allow `cargo` to have its own workspace This also * bumps cargo to the latest in rust-lang/cargo. * adds 0BSD to allowed list of licenses Co-authored-by: Scott Schafer Co-authored-by: Eric Huss --- src/bootstrap/bootstrap.py | 3 ++- src/bootstrap/dist.rs | 3 +++ src/bootstrap/tool.rs | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 025145244c4..0f3a9f96826 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -822,7 +822,8 @@ class RustBuild(object): if self.use_vendored_sources: vendor_dir = os.path.join(self.rust_root, 'vendor') if not os.path.exists(vendor_dir): - sync_dirs = "--sync ./src/tools/rust-analyzer/Cargo.toml " \ + sync_dirs = "--sync ./src/tools/cargo/Cargo.toml " \ + "--sync ./src/tools/rust-analyzer/Cargo.toml " \ "--sync ./compiler/rustc_codegen_cranelift/Cargo.toml " \ "--sync ./src/bootstrap/Cargo.toml " print('error: vendoring required, but vendor directory does not exist.') diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 9498b772f58..372d0708c5b 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -996,11 +996,14 @@ impl Step for PlainSourceTarball { // If we're building from git sources, we need to vendor a complete distribution. if builder.rust_info().is_managed_git_subrepository() { // Ensure we have the submodules checked out. + builder.update_submodule(Path::new("src/tools/cargo")); builder.update_submodule(Path::new("src/tools/rust-analyzer")); // Vendor all Cargo dependencies let mut cmd = Command::new(&builder.initial_cargo); cmd.arg("vendor") + .arg("--sync") + .arg(builder.src.join("./src/tools/cargo/Cargo.toml")) .arg("--sync") .arg(builder.src.join("./src/tools/rust-analyzer/Cargo.toml")) .arg("--sync") diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index d1fd2e8c42c..1cea3495ade 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -124,7 +124,7 @@ impl Step for ToolBuild { let is_expected = compile::stream_cargo(builder, cargo, vec![], &mut |msg| { // Only care about big things like the RLS/Cargo for now match tool { - "rls" | "cargo" | "clippy-driver" | "miri" | "rustfmt" => {} + "rls" | "clippy-driver" | "miri" | "rustfmt" => {} _ => return, } @@ -301,6 +301,9 @@ pub fn prepare_tool_cargo( cargo.env("LIBZ_SYS_STATIC", "1"); features.push("rustc-workspace-hack/all-static".to_string()); } + if path.ends_with("cargo") { + features.push("all-static".to_string()); + } } // clippy tests need to know about the stage sysroot. Set them consistently while building to -- cgit 1.4.1-3-g733a5