@@ -1133,8 +1133,7 @@ mod snapshot {
1133
1133
[dist] mingw <host>
1134
1134
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
1135
1135
[dist] rustc <host>
1136
- [build] rustc 2 <host> -> std 2 <host>
1137
- [dist] rustc 2 <host> -> std 2 <host>
1136
+ [dist] rustc 1 <host> -> std 1 <host>
1138
1137
[dist] rustc 1 <host> -> rustc-dev 2 <host>
1139
1138
[dist] src <>
1140
1139
[dist] reproducible-artifacts <host>
@@ -1198,8 +1197,7 @@ mod snapshot {
1198
1197
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
1199
1198
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
1200
1199
[dist] rustc <host>
1201
- [build] rustc 2 <host> -> std 2 <host>
1202
- [dist] rustc 2 <host> -> std 2 <host>
1200
+ [dist] rustc 1 <host> -> std 1 <host>
1203
1201
[dist] rustc 1 <host> -> rustc-dev 2 <host>
1204
1202
[dist] rustc 1 <host> -> analysis 2 <host>
1205
1203
[dist] src <>
@@ -1216,7 +1214,6 @@ mod snapshot {
1216
1214
[build] rustc 1 <host> -> miri 2 <host>
1217
1215
[build] rustc 1 <host> -> cargo-miri 2 <host>
1218
1216
[dist] rustc 1 <host> -> miri 2 <host>
1219
- [dist] rustc 1 <host> -> std 1 <host>
1220
1217
[dist] rustc 1 <host> -> extended 2 <host>
1221
1218
[dist] reproducible-artifacts <host>
1222
1219
" ) ;
@@ -1287,8 +1284,7 @@ mod snapshot {
1287
1284
[dist] mingw <target1>
1288
1285
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
1289
1286
[dist] rustc <host>
1290
- [build] rustc 2 <host> -> std 2 <host>
1291
- [dist] rustc 2 <host> -> std 2 <host>
1287
+ [dist] rustc 1 <host> -> std 1 <host>
1292
1288
[build] rustc 2 <host> -> std 2 <target1>
1293
1289
[dist] rustc 2 <host> -> std 2 <target1>
1294
1290
[dist] rustc 1 <host> -> rustc-dev 2 <host>
@@ -1350,8 +1346,7 @@ mod snapshot {
1350
1346
[dist] rustc <host>
1351
1347
[build] rustdoc 2 <target1>
1352
1348
[dist] rustc <target1>
1353
- [build] rustc 2 <host> -> std 2 <host>
1354
- [dist] rustc 2 <host> -> std 2 <host>
1349
+ [dist] rustc 1 <host> -> std 1 <host>
1355
1350
[dist] rustc 1 <host> -> rustc-dev 2 <host>
1356
1351
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
1357
1352
[dist] src <>
@@ -1433,10 +1428,8 @@ mod snapshot {
1433
1428
[dist] rustc <host>
1434
1429
[build] rustdoc 2 <target1>
1435
1430
[dist] rustc <target1>
1436
- [build] rustc 2 <host> -> std 2 <host>
1437
- [dist] rustc 2 <host> -> std 2 <host>
1438
- [build] rustc 2 <host> -> std 2 <target1>
1439
- [dist] rustc 2 <host> -> std 2 <target1>
1431
+ [dist] rustc 1 <host> -> std 1 <host>
1432
+ [dist] rustc 1 <host> -> std 1 <target1>
1440
1433
[dist] rustc 1 <host> -> rustc-dev 2 <host>
1441
1434
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
1442
1435
[dist] src <>
@@ -1490,10 +1483,8 @@ mod snapshot {
1490
1483
" ) ;
1491
1484
}
1492
1485
1493
- /// This also serves as an important regression test for <https://github.com/rust-lang/rust/issues/138123>
1494
- /// and <https://github.com/rust-lang/rust/issues/138004>.
1495
1486
#[ test]
1496
- fn dist_all_cross ( ) {
1487
+ fn dist_all_cross_extended ( ) {
1497
1488
let ctx = TestCtx :: new ( ) ;
1498
1489
insta:: assert_snapshot!(
1499
1490
ctx
@@ -1545,8 +1536,7 @@ mod snapshot {
1545
1536
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <target1>
1546
1537
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
1547
1538
[dist] rustc <target1>
1548
- [build] rustc 2 <host> -> std 2 <target1>
1549
- [dist] rustc 2 <host> -> std 2 <target1>
1539
+ [dist] rustc 1 <host> -> std 1 <target1>
1550
1540
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
1551
1541
[dist] rustc 1 <host> -> analysis 2 <target1>
1552
1542
[dist] src <>
@@ -1564,15 +1554,82 @@ mod snapshot {
1564
1554
[build] rustc 1 <host> -> cargo-miri 2 <target1>
1565
1555
[dist] rustc 1 <host> -> miri 2 <target1>
1566
1556
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
1567
- [dist] rustc 1 <host> -> std 1 <target1>
1568
1557
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
1569
1558
[dist] rustc 1 <host> -> extended 2 <target1>
1570
1559
[dist] reproducible-artifacts <target1>
1571
1560
" ) ;
1572
1561
}
1573
1562
1574
- // Enable dist cranelift tarball by default with `x dist` if cranelift is enabled in
1575
- // `rust.codegen-backends`.
1563
+ /// Simulates e.g. the powerpc64 builder, which is fully cross-compiled from x64, but it does
1564
+ /// not build docs. Crutically, it shouldn't build host stage 2 rustc.
1565
+ ///
1566
+ /// This is a regression test for <https://github.com/rust-lang/rust/issues/138123>
1567
+ /// and <https://github.com/rust-lang/rust/issues/138004>.
1568
+ #[ test]
1569
+ fn dist_all_cross_extended_no_docs ( ) {
1570
+ let ctx = TestCtx :: new ( ) ;
1571
+ let steps = ctx
1572
+ . config ( "dist" )
1573
+ . hosts ( & [ TEST_TRIPLE_1 ] )
1574
+ . targets ( & [ TEST_TRIPLE_1 ] )
1575
+ . args ( & [
1576
+ "--set" ,
1577
+ "rust.channel=nightly" ,
1578
+ "--set" ,
1579
+ "build.extended=true" ,
1580
+ "--set" ,
1581
+ "build.docs=false" ,
1582
+ ] )
1583
+ . get_steps ( ) ;
1584
+
1585
+ // Make sure that we don't build stage2 host rustc
1586
+ steps. assert_no_match ( |m| {
1587
+ m. name == "rustc"
1588
+ && m. built_by . map ( |b| b. stage ) == Some ( 1 )
1589
+ && * m. target . triple == host_target ( )
1590
+ } ) ;
1591
+
1592
+ insta:: assert_snapshot!(
1593
+ steps. render( ) , @r"
1594
+ [dist] mingw <target1>
1595
+ [build] llvm <host>
1596
+ [build] llvm <target1>
1597
+ [build] rustc 0 <host> -> rustc 1 <host>
1598
+ [build] rustc 0 <host> -> WasmComponentLd 1 <host>
1599
+ [build] rustc 1 <host> -> std 1 <target1>
1600
+ [build] rustc 1 <host> -> std 1 <host>
1601
+ [build] rustc 1 <host> -> rustc 2 <target1>
1602
+ [build] rustc 1 <host> -> WasmComponentLd 2 <target1>
1603
+ [build] rustdoc 2 <target1>
1604
+ [build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <target1>
1605
+ [build] rustc 0 <host> -> GenerateCopyright 1 <host>
1606
+ [build] rustc 0 <host> -> RustInstaller 1 <host>
1607
+ [dist] rustc <target1>
1608
+ [dist] rustc 1 <host> -> std 1 <target1>
1609
+ [dist] rustc 1 <host> -> rustc-dev 2 <target1>
1610
+ [dist] rustc 1 <host> -> analysis 2 <target1>
1611
+ [dist] src <>
1612
+ [build] rustc 1 <host> -> cargo 2 <target1>
1613
+ [dist] rustc 1 <host> -> cargo 2 <target1>
1614
+ [build] rustc 1 <host> -> rust-analyzer 2 <target1>
1615
+ [dist] rustc 1 <host> -> rust-analyzer 2 <target1>
1616
+ [build] rustc 1 <host> -> rustfmt 2 <target1>
1617
+ [build] rustc 1 <host> -> cargo-fmt 2 <target1>
1618
+ [dist] rustc 1 <host> -> rustfmt 2 <target1>
1619
+ [build] rustc 1 <host> -> clippy-driver 2 <target1>
1620
+ [build] rustc 1 <host> -> cargo-clippy 2 <target1>
1621
+ [dist] rustc 1 <host> -> clippy 2 <target1>
1622
+ [build] rustc 1 <host> -> miri 2 <target1>
1623
+ [build] rustc 1 <host> -> cargo-miri 2 <target1>
1624
+ [dist] rustc 1 <host> -> miri 2 <target1>
1625
+ [build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
1626
+ [dist] rustc 1 <host> -> extended 2 <target1>
1627
+ [dist] reproducible-artifacts <target1>
1628
+ " ) ;
1629
+ }
1630
+
1631
+ /// Enable dist cranelift tarball by default with `x dist` if cranelift is enabled in
1632
+ /// `rust.codegen-backends`.
1576
1633
#[ test]
1577
1634
fn dist_cranelift_by_default ( ) {
1578
1635
let ctx = TestCtx :: new ( ) ;
@@ -1619,8 +1676,7 @@ mod snapshot {
1619
1676
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
1620
1677
[dist] rustc <host>
1621
1678
[dist] rustc 1 <host> -> rustc_codegen_cranelift 2 <host>
1622
- [build] rustc 2 <host> -> std 2 <host>
1623
- [dist] rustc 2 <host> -> std 2 <host>
1679
+ [dist] rustc 1 <host> -> std 1 <host>
1624
1680
[dist] rustc 1 <host> -> rustc-dev 2 <host>
1625
1681
[dist] src <>
1626
1682
[dist] reproducible-artifacts <host>
@@ -2351,8 +2407,7 @@ mod snapshot {
2351
2407
[doc] rustc 1 <host> -> releases 2 <host>
2352
2408
[build] rustc 0 <host> -> RustInstaller 1 <host>
2353
2409
[dist] docs <host>
2354
- [build] rustc 2 <host> -> std 2 <host>
2355
- [dist] rustc 2 <host> -> std 2 <host>
2410
+ [dist] rustc 1 <host> -> std 1 <host>
2356
2411
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
2357
2412
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
2358
2413
[dist] rustc <host>
@@ -2426,6 +2481,21 @@ impl ExecutedSteps {
2426
2481
}
2427
2482
}
2428
2483
2484
+ /// Make sure that no metadata matches the given `func`.
2485
+ #[ track_caller]
2486
+ fn assert_no_match < F > ( & self , func : F )
2487
+ where
2488
+ F : Fn ( StepMetadata ) -> bool ,
2489
+ {
2490
+ for metadata in self . steps . iter ( ) . filter_map ( |s| s. metadata . clone ( ) ) {
2491
+ if func ( metadata. clone ( ) ) {
2492
+ panic ! (
2493
+ "Metadata {metadata:?} was found, even though it should have not been present"
2494
+ ) ;
2495
+ }
2496
+ }
2497
+ }
2498
+
2429
2499
fn contains ( & self , metadata : & StepMetadata ) -> bool {
2430
2500
self . steps
2431
2501
. iter ( )
0 commit comments