@@ -24,10 +24,11 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
24
24
let host_triple = env. host_triple ( ) ;
25
25
let version = find_dist_version ( & dist_dir) ?;
26
26
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
28
28
let rustc_dir = extract_dist_dir ( & format ! ( "rustc-{version}-{host_triple}" ) ) ?. join ( "rustc" ) ;
29
29
let libstd_dir = extract_dist_dir ( & format ! ( "rust-std-{version}-{host_triple}" ) ) ?
30
30
. join ( format ! ( "rust-std-{host_triple}" ) ) ;
31
+ let cargo_dir = extract_dist_dir ( & format ! ( "cargo-{version}-{host_triple}" ) ) ?. join ( "cargo" ) ;
31
32
let extracted_src_dir = extract_dist_dir ( & format ! ( "rust-src-{version}" ) ) ?. join ( "rust-src" ) ;
32
33
33
34
// We need to manually copy libstd to the extracted rustc sysroot
@@ -46,6 +47,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
46
47
47
48
let rustc_path = rustc_dir. join ( "bin" ) . join ( format ! ( "rustc{}" , executable_extension( ) ) ) ;
48
49
assert ! ( rustc_path. is_file( ) ) ;
50
+ let cargo_path = cargo_dir. join ( "bin" ) . join ( format ! ( "cargo{}" , executable_extension( ) ) ) ;
51
+ assert ! ( cargo_path. is_file( ) ) ;
49
52
50
53
// Specify path to a LLVM config so that LLVM is not rebuilt.
51
54
// It doesn't really matter which LLVM config we choose, because no sysroot will be compiled.
@@ -62,11 +65,13 @@ change-id = 115898
62
65
63
66
[build]
64
67
rustc = "{rustc}"
68
+ cargo = "{cargo}"
65
69
66
70
[target.{host_triple}]
67
71
llvm-config = "{llvm_config}"
68
72
"# ,
69
73
rustc = rustc_path. to_string( ) . replace( '\\' , "/" ) ,
74
+ cargo = cargo_path. to_string( ) . replace( '\\' , "/" ) ,
70
75
llvm_config = llvm_config. to_string( ) . replace( '\\' , "/" )
71
76
) ;
72
77
log:: info!( "Using following `config.toml` for running tests:\n {config_content}" ) ;
0 commit comments