@@ -25,15 +25,14 @@ use std::io::Read;
25
25
26
26
use build_helper:: { self , output} ;
27
27
28
- use { Build , Mode } ;
29
- use dist;
30
- use util:: { self , dylib_path, dylib_path_var} ;
31
-
28
+ use builder:: { Kind , RunConfig , ShouldRun , Builder , Compiler , Step } ;
29
+ use cache:: { INTERNER , Interned } ;
32
30
use compile;
31
+ use dist;
33
32
use native;
34
- use builder:: { Kind , RunConfig , ShouldRun , Builder , Compiler , Step } ;
35
33
use tool:: { self , Tool } ;
36
- use cache:: { INTERNER , Interned } ;
34
+ use util:: { self , dylib_path, dylib_path_var} ;
35
+ use { Build , Mode } ;
37
36
38
37
const ADB_TEST_DIR : & str = "/data/tmp/work" ;
39
38
@@ -963,16 +962,31 @@ impl Step for Crate {
963
962
964
963
builder. ensure ( compile:: Test { compiler, target } ) ;
965
964
builder. ensure ( RemoteCopyLibs { compiler, target } ) ;
966
- let ( name, path, features, root) = match mode {
965
+
966
+ // If we're not doing a full bootstrap but we're testing a stage2 version of
967
+ // libstd, then what we're actually testing is the libstd produced in
968
+ // stage1. Reflect that here by updating the compiler that we're working
969
+ // with automatically.
970
+ let compiler = if build. force_use_stage1 ( compiler, target) {
971
+ builder. compiler ( 1 , compiler. host )
972
+ } else {
973
+ compiler. clone ( )
974
+ } ;
975
+
976
+ let mut cargo = builder. cargo ( compiler, mode, target, test_kind. subcommand ( ) ) ;
977
+ let ( name, root) = match mode {
967
978
Mode :: Libstd => {
968
- ( "libstd" , "src/libstd" , build. std_features ( ) , "std" )
979
+ compile:: std_cargo ( build, & compiler, target, & mut cargo) ;
980
+ ( "libstd" , "std" )
969
981
}
970
982
Mode :: Libtest => {
971
- ( "libtest" , "src/libtest" , String :: new ( ) , "test" )
983
+ compile:: test_cargo ( build, & compiler, target, & mut cargo) ;
984
+ ( "libtest" , "test" )
972
985
}
973
986
Mode :: Librustc => {
974
987
builder. ensure ( compile:: Rustc { compiler, target } ) ;
975
- ( "librustc" , "src/rustc" , build. rustc_features ( ) , "rustc-main" )
988
+ compile:: rustc_cargo ( build, & compiler, target, & mut cargo) ;
989
+ ( "librustc" , "rustc-main" )
976
990
}
977
991
_ => panic ! ( "can only test libraries" ) ,
978
992
} ;
@@ -983,25 +997,11 @@ impl Step for Crate {
983
997
println ! ( "{} {} stage{} ({} -> {})" , test_kind, name, compiler. stage,
984
998
& compiler. host, target) ;
985
999
986
- // If we're not doing a full bootstrap but we're testing a stage2 version of
987
- // libstd, then what we're actually testing is the libstd produced in
988
- // stage1. Reflect that here by updating the compiler that we're working
989
- // with automatically.
990
- let compiler = if build. force_use_stage1 ( compiler, target) {
991
- builder. compiler ( 1 , compiler. host )
992
- } else {
993
- compiler. clone ( )
994
- } ;
995
-
996
1000
// Build up the base `cargo test` command.
997
1001
//
998
1002
// Pass in some standard flags then iterate over the graph we've discovered
999
1003
// in `cargo metadata` with the maps above and figure out what `-p`
1000
1004
// arguments need to get passed.
1001
- let mut cargo = builder. cargo ( compiler, mode, target, test_kind. subcommand ( ) ) ;
1002
- cargo. arg ( "--manifest-path" )
1003
- . arg ( build. src . join ( path) . join ( "Cargo.toml" ) )
1004
- . arg ( "--features" ) . arg ( features) ;
1005
1005
if test_kind. subcommand ( ) == "test" && !build. fail_fast {
1006
1006
cargo. arg ( "--no-fail-fast" ) ;
1007
1007
}
@@ -1014,16 +1014,18 @@ impl Step for Crate {
1014
1014
let mut visited = HashSet :: new ( ) ;
1015
1015
let mut next = vec ! [ root] ;
1016
1016
while let Some ( name) = next. pop ( ) {
1017
- // Right now jemalloc is our only target-specific crate in the
1018
- // sense that it's not present on all platforms. Custom skip it
1019
- // here for now, but if we add more this probably wants to get
1020
- // more generalized.
1017
+ // Right now jemalloc and the sanitizer crates are
1018
+ // target-specific crate in the sense that it's not present
1019
+ // on all platforms. Custom skip it here for now, but if we
1020
+ // add more this probably wants to get more generalized.
1021
1021
//
1022
- // Also skip `build_helper` as it's not compiled normally for
1023
- // target during the bootstrap and it's just meant to be a
1024
- // helper crate, not tested. If it leaks through then it ends up
1025
- // messing with various mtime calculations and such.
1026
- if !name. contains ( "jemalloc" ) && * name != * "build_helper" {
1022
+ // Also skip `build_helper` as it's not compiled normally
1023
+ // for target during the bootstrap and it's just meant to be
1024
+ // a helper crate, not tested. If it leaks through then it
1025
+ // ends up messing with various mtime calculations and such.
1026
+ if !name. contains ( "jemalloc" ) &&
1027
+ * name != * "build_helper" &&
1028
+ !( name. starts_with ( "rustc_" ) && name. ends_with ( "san" ) ) {
1027
1029
cargo. arg ( "-p" ) . arg ( & format ! ( "{}:0.0.0" , name) ) ;
1028
1030
}
1029
1031
for dep in build. crates [ & name] . deps . iter ( ) {
0 commit comments