@@ -18,6 +18,7 @@ use std::str;
1818
1919use serde:: Deserialize ;
2020
21+ use crate :: builder:: crate_description;
2122use crate :: builder:: Cargo ;
2223use crate :: builder:: { Builder , Kind , RunConfig , ShouldRun , Step } ;
2324use crate :: cache:: { Interned , INTERNER } ;
@@ -110,7 +111,10 @@ impl Step for Std {
110111 let compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
111112 if compiler_to_use != compiler {
112113 builder. ensure ( Std :: new ( compiler_to_use, target) ) ;
113- builder. info ( & format ! ( "Uplifting stage1 std ({} -> {})" , compiler_to_use. host, target) ) ;
114+ builder. info ( & format ! (
115+ "Uplifting stage1 library ({} -> {})" ,
116+ compiler_to_use. host, target
117+ ) ) ;
114118
115119 // Even if we're not building std this stage, the new sysroot must
116120 // still contain the third party objects needed by various targets.
@@ -126,19 +130,18 @@ impl Step for Std {
126130
127131 let mut cargo = builder. cargo ( compiler, Mode :: Std , SourceType :: InTree , target, "build" ) ;
128132 std_cargo ( builder, target, compiler. stage , & mut cargo) ;
133+ for krate in & * self . crates {
134+ cargo. arg ( "-p" ) . arg ( krate) ;
135+ }
129136
130137 builder. info ( & format ! (
131- "Building stage{} std artifacts ({} -> {})" ,
132- compiler. stage, & compiler. host, target
138+ "Building{} stage{} library artifacts ({} -> {})" ,
139+ crate_description( & self . crates) ,
140+ compiler. stage,
141+ & compiler. host,
142+ target,
133143 ) ) ;
134- run_cargo (
135- builder,
136- cargo,
137- self . crates . to_vec ( ) ,
138- & libstd_stamp ( builder, compiler, target) ,
139- target_deps,
140- false ,
141- ) ;
144+ run_cargo ( builder, cargo, & libstd_stamp ( builder, compiler, target) , target_deps, false ) ;
142145
143146 builder. ensure ( StdLink :: from_std (
144147 self ,
@@ -425,7 +428,7 @@ impl Step for StdLink {
425428 let target_compiler = self . target_compiler ;
426429 let target = self . target ;
427430 builder. info ( & format ! (
428- "Copying stage{} std from stage{} ({} -> {} / {})" ,
431+ "Copying stage{} library from stage{} ({} -> {} / {})" ,
429432 target_compiler. stage, compiler. stage, & compiler. host, target_compiler. host, target
430433 ) ) ;
431434 let libdir = builder. sysroot_libdir ( target_compiler, target) ;
@@ -714,18 +717,18 @@ impl Step for Rustc {
714717 }
715718 }
716719
720+ for krate in & * self . crates {
721+ cargo. arg ( "-p" ) . arg ( krate) ;
722+ }
723+
717724 builder. info ( & format ! (
718- "Building stage{} compiler artifacts ({} -> {})" ,
719- compiler. stage, & compiler. host, target
725+ "Building{} stage{} compiler artifacts ({} -> {})" ,
726+ crate_description( & self . crates) ,
727+ compiler. stage,
728+ & compiler. host,
729+ target,
720730 ) ) ;
721- run_cargo (
722- builder,
723- cargo,
724- self . crates . to_vec ( ) ,
725- & librustc_stamp ( builder, compiler, target) ,
726- vec ! [ ] ,
727- false ,
728- ) ;
731+ run_cargo ( builder, cargo, & librustc_stamp ( builder, compiler, target) , vec ! [ ] , false ) ;
729732
730733 builder. ensure ( RustcLink :: from_rustc (
731734 self ,
@@ -981,7 +984,7 @@ impl Step for CodegenBackend {
981984 "Building stage{} codegen backend {} ({} -> {})" ,
982985 compiler. stage, backend, & compiler. host, target
983986 ) ) ;
984- let files = run_cargo ( builder, cargo, vec ! [ ] , & tmp_stamp, vec ! [ ] , false ) ;
987+ let files = run_cargo ( builder, cargo, & tmp_stamp, vec ! [ ] , false ) ;
985988 if builder. config . dry_run ( ) {
986989 return ;
987990 }
@@ -1405,7 +1408,6 @@ pub fn add_to_sysroot(
14051408pub fn run_cargo (
14061409 builder : & Builder < ' _ > ,
14071410 cargo : Cargo ,
1408- tail_args : Vec < String > ,
14091411 stamp : & Path ,
14101412 additional_target_deps : Vec < ( PathBuf , DependencyType ) > ,
14111413 is_check : bool ,
@@ -1431,7 +1433,7 @@ pub fn run_cargo(
14311433 // files we need to probe for later.
14321434 let mut deps = Vec :: new ( ) ;
14331435 let mut toplevel = Vec :: new ( ) ;
1434- let ok = stream_cargo ( builder, cargo, tail_args , & mut |msg| {
1436+ let ok = stream_cargo ( builder, cargo, & mut |msg| {
14351437 let ( filenames, crate_types) = match msg {
14361438 CargoMessage :: CompilerArtifact {
14371439 filenames,
@@ -1546,7 +1548,6 @@ pub fn run_cargo(
15461548pub fn stream_cargo (
15471549 builder : & Builder < ' _ > ,
15481550 cargo : Cargo ,
1549- tail_args : Vec < String > ,
15501551 cb : & mut dyn FnMut ( CargoMessage < ' _ > ) ,
15511552) -> bool {
15521553 let mut cargo = Command :: from ( cargo) ;
@@ -1566,10 +1567,6 @@ pub fn stream_cargo(
15661567 }
15671568 cargo. arg ( "--message-format" ) . arg ( message_format) . stdout ( Stdio :: piped ( ) ) ;
15681569
1569- for arg in tail_args {
1570- cargo. arg ( arg) ;
1571- }
1572-
15731570 builder. verbose ( & format ! ( "running: {:?}" , cargo) ) ;
15741571 let mut child = match cargo. spawn ( ) {
15751572 Ok ( child) => child,
0 commit comments