Skip to content

Commit 0691c06

Browse files
committed
Partial Revert: "Auto merge of rust-lang#117018 - Kobzol:opt-dist-cargo-stage0"
1 parent ccbd304 commit 0691c06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tools/opt-dist/src/tests.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
2424
let host_triple = env.host_triple();
2525
let version = find_dist_version(&dist_dir)?;
2626

27-
// Extract rustc, libstd and src archives to create the optimized sysroot
27+
// Extract rustc, libstd, cargo and src archives to create the optimized sysroot
2828
let rustc_dir = extract_dist_dir(&format!("rustc-{version}-{host_triple}"))?.join("rustc");
2929
let libstd_dir = extract_dist_dir(&format!("rust-std-{version}-{host_triple}"))?
3030
.join(format!("rust-std-{host_triple}"));
31+
let cargo_dir = extract_dist_dir(&format!("cargo-{version}-{host_triple}"))?.join("cargo");
3132
let extracted_src_dir = extract_dist_dir(&format!("rust-src-{version}"))?.join("rust-src");
3233

3334
// We need to manually copy libstd to the extracted rustc sysroot
@@ -46,6 +47,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
4647

4748
let rustc_path = rustc_dir.join("bin").join(format!("rustc{}", executable_extension()));
4849
assert!(rustc_path.is_file());
50+
let cargo_path = cargo_dir.join("bin").join(format!("cargo{}", executable_extension()));
51+
assert!(cargo_path.is_file());
4952

5053
// Specify path to a LLVM config so that LLVM is not rebuilt.
5154
// It doesn't really matter which LLVM config we choose, because no sysroot will be compiled.
@@ -62,11 +65,13 @@ change-id = 115898
6265
6366
[build]
6467
rustc = "{rustc}"
68+
cargo = "{cargo}"
6569
6670
[target.{host_triple}]
6771
llvm-config = "{llvm_config}"
6872
"#,
6973
rustc = rustc_path.to_string().replace('\\', "/"),
74+
cargo = cargo_path.to_string().replace('\\', "/"),
7075
llvm_config = llvm_config.to_string().replace('\\', "/")
7176
);
7277
log::info!("Using following `config.toml` for running tests:\n{config_content}");

0 commit comments

Comments
 (0)