about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-10-23 16:08:31 +0200
committerUrgau <urgau@numericable.fr>2023-10-23 16:10:52 +0200
commit0691c06d9401649644dc26acc9285a156ff8d12d (patch)
tree438d38c458159446c3c68192c2ebd1c8f590760f
parentccbd3043352488e2a1a806a155906945e788027c (diff)
downloadrust-0691c06d9401649644dc26acc9285a156ff8d12d.tar.gz
rust-0691c06d9401649644dc26acc9285a156ff8d12d.zip
Partial Revert: "Auto merge of #117018 - Kobzol:opt-dist-cargo-stage0"
-rw-r--r--src/tools/opt-dist/src/tests.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs
index 3c33cfe985d..8a8f98a5eda 100644
--- a/src/tools/opt-dist/src/tests.rs
+++ b/src/tools/opt-dist/src/tests.rs
@@ -24,10 +24,11 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
     let host_triple = env.host_triple();
     let version = find_dist_version(&dist_dir)?;
 
-    // Extract rustc, libstd and src archives to create the optimized sysroot
+    // Extract rustc, libstd, cargo and src archives to create the optimized sysroot
     let rustc_dir = extract_dist_dir(&format!("rustc-{version}-{host_triple}"))?.join("rustc");
     let libstd_dir = extract_dist_dir(&format!("rust-std-{version}-{host_triple}"))?
         .join(format!("rust-std-{host_triple}"));
+    let cargo_dir = extract_dist_dir(&format!("cargo-{version}-{host_triple}"))?.join("cargo");
     let extracted_src_dir = extract_dist_dir(&format!("rust-src-{version}"))?.join("rust-src");
 
     // We need to manually copy libstd to the extracted rustc sysroot
@@ -46,6 +47,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
 
     let rustc_path = rustc_dir.join("bin").join(format!("rustc{}", executable_extension()));
     assert!(rustc_path.is_file());
+    let cargo_path = cargo_dir.join("bin").join(format!("cargo{}", executable_extension()));
+    assert!(cargo_path.is_file());
 
     // Specify path to a LLVM config so that LLVM is not rebuilt.
     // It doesn't really matter which LLVM config we choose, because no sysroot will be compiled.
@@ -62,11 +65,13 @@ change-id = 115898
 
 [build]
 rustc = "{rustc}"
+cargo = "{cargo}"
 
 [target.{host_triple}]
 llvm-config = "{llvm_config}"
 "#,
         rustc = rustc_path.to_string().replace('\\', "/"),
+        cargo = cargo_path.to_string().replace('\\', "/"),
         llvm_config = llvm_config.to_string().replace('\\', "/")
     );
     log::info!("Using following `config.toml` for running tests:\n{config_content}");