@@ -57,24 +57,6 @@ fn check_cli<const N: usize>(paths: [&str; N]) {
57
57
) ;
58
58
}
59
59
60
- macro_rules! std {
61
- ( $host: ident => $target: ident, stage = $stage: literal) => {
62
- compile:: Std :: new(
63
- Compiler { host: TargetSelection :: from_user( stringify!( $host) ) , stage: $stage } ,
64
- TargetSelection :: from_user( stringify!( $target) ) ,
65
- )
66
- } ;
67
- }
68
-
69
- macro_rules! rustc {
70
- ( $host: ident => $target: ident, stage = $stage: literal) => {
71
- compile:: Rustc :: new(
72
- Compiler { host: TargetSelection :: from_user( stringify!( $host) ) , stage: $stage } ,
73
- TargetSelection :: from_user( stringify!( $target) ) ,
74
- )
75
- } ;
76
- }
77
-
78
60
#[ test]
79
61
fn test_valid ( ) {
80
62
// make sure multi suite paths are accepted
@@ -135,17 +117,6 @@ fn test_exclude_kind() {
135
117
assert ! ( run_build( & [ path] , config) . contains:: <tool:: CargoTest >( ) ) ;
136
118
}
137
119
138
- /// Ensure that if someone passes both a single crate and `library`, all library crates get built.
139
- #[ test]
140
- fn alias_and_path_for_library ( ) {
141
- let mut cache =
142
- run_build ( & [ "library" . into ( ) , "core" . into ( ) ] , configure ( "build" , & [ "A" ] , & [ "A" ] ) ) ;
143
- assert_eq ! (
144
- first( cache. all:: <compile:: Std >( ) ) ,
145
- & [ std!( A => A , stage = 0 ) , std!( A => A , stage = 1 ) ]
146
- ) ;
147
- }
148
-
149
120
mod defaults {
150
121
use super :: { configure, first, run_build} ;
151
122
use crate :: builder:: * ;
@@ -159,7 +130,10 @@ mod defaults {
159
130
let a = TargetSelection :: from_user ( "A" ) ;
160
131
assert_eq ! (
161
132
first( cache. all:: <compile:: Std >( ) ) ,
162
- & [ std!( A => A , stage = 0 ) , std!( A => A , stage = 1 ) , ]
133
+ & [
134
+ compile:: Std { compiler: Compiler { host: a, stage: 0 } , target: a } ,
135
+ compile:: Std { compiler: Compiler { host: a, stage: 1 } , target: a } ,
136
+ ]
163
137
) ;
164
138
assert ! ( !cache. all:: <compile:: Assemble >( ) . is_empty( ) ) ;
165
139
// Make sure rustdoc is only built once.
@@ -169,7 +143,10 @@ mod defaults {
169
143
// - this is the compiler it's _linked_ to, not built with.
170
144
& [ tool:: Rustdoc { compiler: Compiler { host: a, stage: 1 } } ] ,
171
145
) ;
172
- assert_eq ! ( first( cache. all:: <compile:: Rustc >( ) ) , & [ rustc!( A => A , stage = 0 ) ] , ) ;
146
+ assert_eq ! (
147
+ first( cache. all:: <compile:: Rustc >( ) ) ,
148
+ & [ compile:: Rustc { compiler: Compiler { host: a, stage: 0 } , target: a } , ]
149
+ ) ;
173
150
}
174
151
175
152
#[ test]
@@ -178,7 +155,10 @@ mod defaults {
178
155
let mut cache = run_build ( & [ ] , config) ;
179
156
180
157
let a = TargetSelection :: from_user ( "A" ) ;
181
- assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [ std!( A => A , stage = 0 ) ] ) ;
158
+ assert_eq ! (
159
+ first( cache. all:: <compile:: Std >( ) ) ,
160
+ & [ compile:: Std { compiler: Compiler { host: a, stage: 0 } , target: a } , ]
161
+ ) ;
182
162
assert ! ( !cache. all:: <compile:: Assemble >( ) . is_empty( ) ) ;
183
163
assert_eq ! (
184
164
first( cache. all:: <tool:: Rustdoc >( ) ) ,
@@ -205,10 +185,10 @@ mod defaults {
205
185
assert_eq ! (
206
186
first( cache. all:: <compile:: Std >( ) ) ,
207
187
& [
208
- std! ( A => A , stage = 0 ) ,
209
- std! ( A => A , stage = 1 ) ,
210
- std! ( A => B , stage = 0 ) ,
211
- std! ( A => B , stage = 1 ) ,
188
+ compile :: Std { compiler : Compiler { host : a , stage: 0 } , target : a } ,
189
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : a } ,
190
+ compile :: Std { compiler : Compiler { host : a , stage: 0 } , target : b } ,
191
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : b } ,
212
192
]
213
193
) ;
214
194
assert_eq ! (
@@ -228,7 +208,10 @@ mod defaults {
228
208
) ;
229
209
assert_eq ! (
230
210
first( cache. all:: <compile:: Rustc >( ) ) ,
231
- & [ rustc!( A => A , stage = 0 ) , rustc!( A => B , stage = 0 ) , ]
211
+ & [
212
+ compile:: Rustc { compiler: Compiler { host: a, stage: 0 } , target: a } ,
213
+ compile:: Rustc { compiler: Compiler { host: a, stage: 0 } , target: b } ,
214
+ ]
232
215
) ;
233
216
}
234
217
@@ -351,18 +334,19 @@ mod dist {
351
334
assert_eq ! (
352
335
first( cache. all:: <compile:: Std >( ) ) ,
353
336
& [
354
- std! ( A => A , stage = 0 ) ,
355
- std! ( A => A , stage = 1 ) ,
356
- std! ( A => A , stage = 2 ) ,
357
- std! ( A => B , stage = 1 ) ,
358
- std! ( A => B , stage = 2 ) ,
337
+ compile :: Std { compiler : Compiler { host : a , stage: 0 } , target : a } ,
338
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : a } ,
339
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : a } ,
340
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : b } ,
341
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : b } ,
359
342
] ,
360
343
) ;
361
344
assert_eq ! ( first( cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
362
345
}
363
346
364
347
#[ test]
365
348
fn dist_only_cross_host ( ) {
349
+ let a = TargetSelection :: from_user ( "A" ) ;
366
350
let b = TargetSelection :: from_user ( "B" ) ;
367
351
let mut config = configure ( & [ "A" , "B" ] , & [ "A" , "B" ] ) ;
368
352
config. docs = false ;
@@ -376,7 +360,10 @@ mod dist {
376
360
) ;
377
361
assert_eq ! (
378
362
first( cache. all:: <compile:: Rustc >( ) ) ,
379
- & [ rustc!( A => A , stage = 0 ) , rustc!( A => B , stage = 1 ) , ]
363
+ & [
364
+ compile:: Rustc { compiler: Compiler { host: a, stage: 0 } , target: a } ,
365
+ compile:: Rustc { compiler: Compiler { host: a, stage: 1 } , target: b } ,
366
+ ]
380
367
) ;
381
368
}
382
369
@@ -463,11 +450,11 @@ mod dist {
463
450
assert_eq ! (
464
451
first( cache. all:: <compile:: Std >( ) ) ,
465
452
& [
466
- std! ( A => A , stage = 0 ) ,
467
- std! ( A => A , stage = 1 ) ,
468
- std! ( A => A , stage = 2 ) ,
469
- std! ( A => B , stage = 1 ) ,
470
- std! ( A => B , stage = 2 ) ,
453
+ compile :: Std { compiler : Compiler { host : a , stage: 0 } , target : a } ,
454
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : a } ,
455
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : a } ,
456
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : b } ,
457
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : b } ,
471
458
]
472
459
) ;
473
460
assert_eq ! (
@@ -487,29 +474,33 @@ mod dist {
487
474
let mut builder = Builder :: new ( & build) ;
488
475
builder. run_step_descriptions (
489
476
& Builder :: get_step_descriptions ( Kind :: Build ) ,
490
- & [ "compiler/rustc" . into ( ) , "library" . into ( ) ] ,
477
+ & [ "compiler/rustc" . into ( ) , "library/std " . into ( ) ] ,
491
478
) ;
492
479
480
+ let a = TargetSelection :: from_user ( "A" ) ;
481
+ let b = TargetSelection :: from_user ( "B" ) ;
482
+ let c = TargetSelection :: from_user ( "C" ) ;
483
+
493
484
assert_eq ! (
494
485
first( builder. cache. all:: <compile:: Std >( ) ) ,
495
486
& [
496
- std! ( A => A , stage = 0 ) ,
497
- std! ( A => A , stage = 1 ) ,
498
- std! ( A => A , stage = 2 ) ,
499
- std! ( A => B , stage = 1 ) ,
500
- std! ( A => B , stage = 2 ) ,
501
- std! ( A => C , stage = 2 ) ,
487
+ compile :: Std { compiler : Compiler { host : a , stage: 0 } , target : a } ,
488
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : a } ,
489
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : a } ,
490
+ compile :: Std { compiler : Compiler { host : a , stage: 1 } , target : b } ,
491
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : b } ,
492
+ compile :: Std { compiler : Compiler { host : a , stage: 2 } , target : c } ,
502
493
]
503
494
) ;
504
- assert_eq ! ( builder. cache. all:: <compile:: Assemble >( ) . len ( ) , 5 ) ;
495
+ assert ! ( ! builder. cache. all:: <compile:: Assemble >( ) . is_empty ( ) ) ;
505
496
assert_eq ! (
506
497
first( builder. cache. all:: <compile:: Rustc >( ) ) ,
507
498
& [
508
- rustc! ( A => A , stage = 0 ) ,
509
- rustc! ( A => A , stage = 1 ) ,
510
- rustc! ( A => A , stage = 2 ) ,
511
- rustc! ( A => B , stage = 1 ) ,
512
- rustc! ( A => B , stage = 2 ) ,
499
+ compile :: Rustc { compiler : Compiler { host : a , stage: 0 } , target : a } ,
500
+ compile :: Rustc { compiler : Compiler { host : a , stage: 1 } , target : a } ,
501
+ compile :: Rustc { compiler : Compiler { host : a , stage: 2 } , target : a } ,
502
+ compile :: Rustc { compiler : Compiler { host : a , stage: 1 } , target : b } ,
503
+ compile :: Rustc { compiler : Compiler { host : a , stage: 2 } , target : b } ,
513
504
]
514
505
) ;
515
506
}
@@ -522,10 +513,15 @@ mod dist {
522
513
builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
523
514
524
515
let a = TargetSelection :: from_user ( "A" ) ;
516
+ let c = TargetSelection :: from_user ( "C" ) ;
525
517
526
518
assert_eq ! (
527
519
first( builder. cache. all:: <compile:: Std >( ) ) ,
528
- & [ std!( A => A , stage = 0 ) , std!( A => A , stage = 1 ) , std!( A => C , stage = 2 ) , ]
520
+ & [
521
+ compile:: Std { compiler: Compiler { host: a, stage: 0 } , target: a } ,
522
+ compile:: Std { compiler: Compiler { host: a, stage: 1 } , target: a } ,
523
+ compile:: Std { compiler: Compiler { host: a, stage: 2 } , target: c } ,
524
+ ]
529
525
) ;
530
526
assert_eq ! (
531
527
first( builder. cache. all:: <compile:: Assemble >( ) ) ,
@@ -537,7 +533,10 @@ mod dist {
537
533
) ;
538
534
assert_eq ! (
539
535
first( builder. cache. all:: <compile:: Rustc >( ) ) ,
540
- & [ rustc!( A => A , stage = 0 ) , rustc!( A => A , stage = 1 ) , ]
536
+ & [
537
+ compile:: Rustc { compiler: Compiler { host: a, stage: 0 } , target: a } ,
538
+ compile:: Rustc { compiler: Compiler { host: a, stage: 1 } , target: a } ,
539
+ ]
541
540
) ;
542
541
}
543
542
0 commit comments