@@ -53,6 +53,7 @@ fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool {
53
53
#[ derive( Debug , PartialOrd , Ord , Copy , Clone , Hash , PartialEq , Eq ) ]
54
54
pub struct Docs {
55
55
pub host : TargetSelection ,
56
+ pub prepare_only : bool ,
56
57
}
57
58
58
59
impl Step for Docs {
@@ -65,7 +66,7 @@ impl Step for Docs {
65
66
}
66
67
67
68
fn make_run ( run : RunConfig < ' _ > ) {
68
- run. builder . ensure ( Docs { host : run. target } ) ;
69
+ run. builder . ensure ( Docs { host : run. target , prepare_only : false } ) ;
69
70
}
70
71
71
72
/// Builds the `rust-docs` installer component.
@@ -77,6 +78,7 @@ impl Step for Docs {
77
78
78
79
let mut tarball = Tarball :: new ( builder, "rust-docs" , & host. triple ) ;
79
80
tarball. set_product_name ( "Rust Documentation" ) ;
81
+ tarball. is_prepare_only ( self . prepare_only ) ;
80
82
tarball. add_bulk_dir ( & builder. doc_out ( host) , dest) ;
81
83
tarball. add_file ( & builder. src . join ( "src/doc/robots.txt" ) , dest, 0o644 ) ;
82
84
Some ( tarball. generate ( ) )
@@ -351,6 +353,7 @@ impl Step for Mingw {
351
353
#[ derive( Debug , PartialOrd , Ord , Copy , Clone , Hash , PartialEq , Eq ) ]
352
354
pub struct Rustc {
353
355
pub compiler : Compiler ,
356
+ pub prepare_only : bool ,
354
357
}
355
358
356
359
impl Step for Rustc {
@@ -363,16 +366,19 @@ impl Step for Rustc {
363
366
}
364
367
365
368
fn make_run ( run : RunConfig < ' _ > ) {
366
- run. builder
367
- . ensure ( Rustc { compiler : run. builder . compiler ( run. builder . top_stage , run. target ) } ) ;
369
+ run. builder . ensure ( Rustc {
370
+ compiler : run. builder . compiler ( run. builder . top_stage , run. target ) ,
371
+ prepare_only : false ,
372
+ } ) ;
368
373
}
369
374
370
375
/// Creates the `rustc` installer component.
371
376
fn run ( self , builder : & Builder < ' _ > ) -> GeneratedTarball {
372
377
let compiler = self . compiler ;
373
378
let host = self . compiler . host ;
374
379
375
- let tarball = Tarball :: new ( builder, "rustc" , & host. triple ) ;
380
+ let mut tarball = Tarball :: new ( builder, "rustc" , & host. triple ) ;
381
+ tarball. is_prepare_only ( self . prepare_only ) ;
376
382
377
383
// Prepare the rustc "image", what will actually end up getting installed
378
384
prepare_image ( builder, compiler, tarball. image_dir ( ) ) ;
@@ -620,6 +626,7 @@ fn copy_target_libs(builder: &Builder<'_>, target: TargetSelection, image: &Path
620
626
pub struct Std {
621
627
pub compiler : Compiler ,
622
628
pub target : TargetSelection ,
629
+ pub prepare_only : bool ,
623
630
}
624
631
625
632
impl Step for Std {
@@ -638,6 +645,7 @@ impl Step for Std {
638
645
run. target ,
639
646
) ,
640
647
target : run. target ,
648
+ prepare_only : false ,
641
649
} ) ;
642
650
}
643
651
@@ -652,6 +660,7 @@ impl Step for Std {
652
660
builder. ensure ( compile:: Std :: new ( compiler, target) ) ;
653
661
654
662
let mut tarball = Tarball :: new ( builder, "rust-std" , & target. triple ) ;
663
+ tarball. is_prepare_only ( self . prepare_only ) ;
655
664
tarball. include_target_in_component_name ( true ) ;
656
665
657
666
let compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
@@ -870,7 +879,9 @@ fn copy_src_dirs(
870
879
}
871
880
872
881
#[ derive( Debug , PartialOrd , Ord , Copy , Clone , Hash , PartialEq , Eq ) ]
873
- pub struct Src ;
882
+ pub struct Src {
883
+ pub prepare_only : bool ,
884
+ }
874
885
875
886
impl Step for Src {
876
887
/// The output path of the src installer tarball
@@ -883,7 +894,7 @@ impl Step for Src {
883
894
}
884
895
885
896
fn make_run ( run : RunConfig < ' _ > ) {
886
- run. builder . ensure ( Src ) ;
897
+ run. builder . ensure ( Src { prepare_only : false } ) ;
887
898
}
888
899
889
900
/// Creates the `rust-src` installer component
@@ -892,7 +903,8 @@ impl Step for Src {
892
903
builder. update_submodule ( & Path :: new ( "src/llvm-project" ) ) ;
893
904
}
894
905
895
- let tarball = Tarball :: new_targetless ( builder, "rust-src" ) ;
906
+ let mut tarball = Tarball :: new_targetless ( builder, "rust-src" ) ;
907
+ tarball. is_prepare_only ( self . prepare_only ) ;
896
908
897
909
// A lot of tools expect the rust-src component to be entirely in this directory, so if you
898
910
// change that (e.g. by adding another directory `lib/rustlib/src/foo` or
@@ -1034,6 +1046,7 @@ impl Step for PlainSourceTarball {
1034
1046
pub struct Cargo {
1035
1047
pub compiler : Compiler ,
1036
1048
pub target : TargetSelection ,
1049
+ pub prepare_only : bool ,
1037
1050
}
1038
1051
1039
1052
impl Step for Cargo {
@@ -1054,6 +1067,7 @@ impl Step for Cargo {
1054
1067
run. target ,
1055
1068
) ,
1056
1069
target : run. target ,
1070
+ prepare_only : false ,
1057
1071
} ) ;
1058
1072
}
1059
1073
@@ -1068,6 +1082,7 @@ impl Step for Cargo {
1068
1082
// Prepare the image directory
1069
1083
let mut tarball = Tarball :: new ( builder, "cargo" , & target. triple ) ;
1070
1084
tarball. set_overlay ( OverlayKind :: Cargo ) ;
1085
+ tarball. is_prepare_only ( self . prepare_only ) ;
1071
1086
1072
1087
tarball. add_file ( & cargo, "bin" , 0o755 ) ;
1073
1088
tarball. add_file ( etc. join ( "_cargo" ) , "share/zsh/site-functions" , 0o644 ) ;
@@ -1127,6 +1142,7 @@ impl Step for Rls {
1127
1142
pub struct RustAnalyzer {
1128
1143
pub compiler : Compiler ,
1129
1144
pub target : TargetSelection ,
1145
+ pub prepare_only : bool ,
1130
1146
}
1131
1147
1132
1148
impl Step for RustAnalyzer {
@@ -1147,6 +1163,7 @@ impl Step for RustAnalyzer {
1147
1163
run. target ,
1148
1164
) ,
1149
1165
target : run. target ,
1166
+ prepare_only : false ,
1150
1167
} ) ;
1151
1168
}
1152
1169
@@ -1160,6 +1177,7 @@ impl Step for RustAnalyzer {
1160
1177
1161
1178
let mut tarball = Tarball :: new ( builder, "rust-analyzer" , & target. triple ) ;
1162
1179
tarball. set_overlay ( OverlayKind :: RustAnalyzer ) ;
1180
+ tarball. is_prepare_only ( self . prepare_only ) ;
1163
1181
tarball. is_preview ( true ) ;
1164
1182
tarball. add_file ( rust_analyzer, "bin" , 0o755 ) ;
1165
1183
tarball. add_legal_and_readme_to ( "share/doc/rust-analyzer" ) ;
@@ -1171,6 +1189,7 @@ impl Step for RustAnalyzer {
1171
1189
pub struct Clippy {
1172
1190
pub compiler : Compiler ,
1173
1191
pub target : TargetSelection ,
1192
+ pub prepare_only : bool ,
1174
1193
}
1175
1194
1176
1195
impl Step for Clippy {
@@ -1191,6 +1210,7 @@ impl Step for Clippy {
1191
1210
run. target ,
1192
1211
) ,
1193
1212
target : run. target ,
1213
+ prepare_only : false ,
1194
1214
} ) ;
1195
1215
}
1196
1216
@@ -1210,6 +1230,7 @@ impl Step for Clippy {
1210
1230
1211
1231
let mut tarball = Tarball :: new ( builder, "clippy" , & target. triple ) ;
1212
1232
tarball. set_overlay ( OverlayKind :: Clippy ) ;
1233
+ tarball. is_prepare_only ( self . prepare_only ) ;
1213
1234
tarball. is_preview ( true ) ;
1214
1235
tarball. add_file ( clippy, "bin" , 0o755 ) ;
1215
1236
tarball. add_file ( cargoclippy, "bin" , 0o755 ) ;
@@ -1222,6 +1243,7 @@ impl Step for Clippy {
1222
1243
pub struct Miri {
1223
1244
pub compiler : Compiler ,
1224
1245
pub target : TargetSelection ,
1246
+ pub prepare_only : bool ,
1225
1247
}
1226
1248
1227
1249
impl Step for Miri {
@@ -1242,6 +1264,7 @@ impl Step for Miri {
1242
1264
run. target ,
1243
1265
) ,
1244
1266
target : run. target ,
1267
+ prepare_only : false ,
1245
1268
} ) ;
1246
1269
}
1247
1270
@@ -1262,6 +1285,7 @@ impl Step for Miri {
1262
1285
let mut tarball = Tarball :: new ( builder, "miri" , & target. triple ) ;
1263
1286
tarball. set_overlay ( OverlayKind :: Miri ) ;
1264
1287
tarball. is_preview ( true ) ;
1288
+ tarball. is_prepare_only ( self . prepare_only ) ;
1265
1289
tarball. add_file ( miri, "bin" , 0o755 ) ;
1266
1290
tarball. add_file ( cargomiri, "bin" , 0o755 ) ;
1267
1291
tarball. add_legal_and_readme_to ( "share/doc/miri" ) ;
@@ -1273,6 +1297,7 @@ impl Step for Miri {
1273
1297
pub struct CodegenBackend {
1274
1298
pub compiler : Compiler ,
1275
1299
pub backend : Interned < String > ,
1300
+ pub prepare_only : bool ,
1276
1301
}
1277
1302
1278
1303
impl Step for CodegenBackend {
@@ -1293,6 +1318,7 @@ impl Step for CodegenBackend {
1293
1318
run. builder . ensure ( CodegenBackend {
1294
1319
compiler : run. builder . compiler ( run. builder . top_stage , run. target ) ,
1295
1320
backend,
1321
+ prepare_only : false ,
1296
1322
} ) ;
1297
1323
}
1298
1324
}
@@ -1338,6 +1364,7 @@ impl Step for CodegenBackend {
1338
1364
panic ! ( "Unknown backend rustc_codegen_{}" , backend) ;
1339
1365
}
1340
1366
tarball. is_preview ( true ) ;
1367
+ tarball. is_prepare_only ( self . prepare_only ) ;
1341
1368
tarball. add_legal_and_readme_to ( format ! ( "share/doc/rustc_codegen_{}" , backend) ) ;
1342
1369
1343
1370
let src = builder. sysroot ( compiler) ;
@@ -1369,6 +1396,7 @@ impl Step for CodegenBackend {
1369
1396
pub struct Rustfmt {
1370
1397
pub compiler : Compiler ,
1371
1398
pub target : TargetSelection ,
1399
+ pub prepare_only : bool ,
1372
1400
}
1373
1401
1374
1402
impl Step for Rustfmt {
@@ -1389,6 +1417,7 @@ impl Step for Rustfmt {
1389
1417
run. target ,
1390
1418
) ,
1391
1419
target : run. target ,
1420
+ prepare_only : false ,
1392
1421
} ) ;
1393
1422
}
1394
1423
@@ -1405,6 +1434,7 @@ impl Step for Rustfmt {
1405
1434
let mut tarball = Tarball :: new ( builder, "rustfmt" , & target. triple ) ;
1406
1435
tarball. set_overlay ( OverlayKind :: Rustfmt ) ;
1407
1436
tarball. is_preview ( true ) ;
1437
+ tarball. is_prepare_only ( self . prepare_only ) ;
1408
1438
tarball. add_file ( rustfmt, "bin" , 0o755 ) ;
1409
1439
tarball. add_file ( cargofmt, "bin" , 0o755 ) ;
1410
1440
tarball. add_legal_and_readme_to ( "share/doc/rustfmt" ) ;
@@ -1416,6 +1446,7 @@ impl Step for Rustfmt {
1416
1446
pub struct RustDemangler {
1417
1447
pub compiler : Compiler ,
1418
1448
pub target : TargetSelection ,
1449
+ pub prepare_only : bool ,
1419
1450
}
1420
1451
1421
1452
impl Step for RustDemangler {
@@ -1441,6 +1472,7 @@ impl Step for RustDemangler {
1441
1472
run. target ,
1442
1473
) ,
1443
1474
target : run. target ,
1475
+ prepare_only : false ,
1444
1476
} ) ;
1445
1477
}
1446
1478
@@ -1463,6 +1495,7 @@ impl Step for RustDemangler {
1463
1495
let mut tarball = Tarball :: new ( builder, "rust-demangler" , & target. triple ) ;
1464
1496
tarball. set_overlay ( OverlayKind :: RustDemangler ) ;
1465
1497
tarball. is_preview ( true ) ;
1498
+ tarball. is_prepare_only ( self . prepare_only ) ;
1466
1499
tarball. add_file ( & rust_demangler, "bin" , 0o755 ) ;
1467
1500
tarball. add_legal_and_readme_to ( "share/doc/rust-demangler" ) ;
1468
1501
Some ( tarball. generate ( ) )
@@ -1517,27 +1550,33 @@ impl Step for Extended {
1517
1550
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering
1518
1551
// the std files during uninstall. To do this ensure that rustc comes
1519
1552
// before rust-std in the list below.
1520
- tarballs. push ( builder. ensure ( Rustc { compiler : builder. compiler ( stage, target) } ) ) ;
1521
- tarballs. push ( builder. ensure ( Std { compiler, target } ) . expect ( "missing std" ) ) ;
1553
+ tarballs. push (
1554
+ builder
1555
+ . ensure ( Rustc { compiler : builder. compiler ( stage, target) , prepare_only : false } ) ,
1556
+ ) ;
1557
+ tarballs. push (
1558
+ builder. ensure ( Std { compiler, target, prepare_only : false } ) . expect ( "missing std" ) ,
1559
+ ) ;
1522
1560
1523
1561
if target. ends_with ( "windows-gnu" ) {
1524
1562
tarballs. push ( builder. ensure ( Mingw { host : target } ) . expect ( "missing mingw" ) ) ;
1525
1563
}
1526
1564
1527
- add_component ! ( "rust-docs" => Docs { host: target } ) ;
1565
+ add_component ! ( "rust-docs" => Docs { host: target, prepare_only : false } ) ;
1528
1566
add_component ! ( "rust-json-docs" => JsonDocs { host: target } ) ;
1529
- add_component ! ( "rust-demangler" => RustDemangler { compiler, target } ) ;
1530
- add_component ! ( "cargo" => Cargo { compiler, target } ) ;
1531
- add_component ! ( "rustfmt" => Rustfmt { compiler, target } ) ;
1567
+ add_component ! ( "rust-demangler" => RustDemangler { compiler, target, prepare_only : false } ) ;
1568
+ add_component ! ( "cargo" => Cargo { compiler, target, prepare_only : false } ) ;
1569
+ add_component ! ( "rustfmt" => Rustfmt { compiler, target, prepare_only : false } ) ;
1532
1570
add_component ! ( "rls" => Rls { compiler, target } ) ;
1533
- add_component ! ( "rust-analyzer" => RustAnalyzer { compiler, target } ) ;
1534
- add_component ! ( "llvm-components" => LlvmTools { target } ) ;
1535
- add_component ! ( "clippy" => Clippy { compiler, target } ) ;
1536
- add_component ! ( "miri" => Miri { compiler, target } ) ;
1571
+ add_component ! ( "rust-analyzer" => RustAnalyzer { compiler, target, prepare_only : false } ) ;
1572
+ add_component ! ( "llvm-components" => LlvmTools { target, prepare_only : false } ) ;
1573
+ add_component ! ( "clippy" => Clippy { compiler, target, prepare_only : false } ) ;
1574
+ add_component ! ( "miri" => Miri { compiler, target, prepare_only : false } ) ;
1537
1575
add_component ! ( "analysis" => Analysis { compiler, target } ) ;
1538
1576
add_component ! ( "rustc-codegen-cranelift" => CodegenBackend {
1539
1577
compiler: builder. compiler( stage, target) ,
1540
1578
backend: INTERNER . intern_str( "cranelift" ) ,
1579
+ prepare_only: false
1541
1580
} ) ;
1542
1581
1543
1582
let etc = builder. src . join ( "src/etc/installer" ) ;
@@ -2123,6 +2162,7 @@ pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection
2123
2162
#[ derive( Clone , Debug , Eq , Hash , PartialEq ) ]
2124
2163
pub struct LlvmTools {
2125
2164
pub target : TargetSelection ,
2165
+ pub prepare_only : bool ,
2126
2166
}
2127
2167
2128
2168
impl Step for LlvmTools {
@@ -2137,7 +2177,7 @@ impl Step for LlvmTools {
2137
2177
}
2138
2178
2139
2179
fn make_run ( run : RunConfig < ' _ > ) {
2140
- run. builder . ensure ( LlvmTools { target : run. target } ) ;
2180
+ run. builder . ensure ( LlvmTools { target : run. target , prepare_only : false } ) ;
2141
2181
}
2142
2182
2143
2183
fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
@@ -2156,6 +2196,7 @@ impl Step for LlvmTools {
2156
2196
let mut tarball = Tarball :: new ( builder, "llvm-tools" , & target. triple ) ;
2157
2197
tarball. set_overlay ( OverlayKind :: LLVM ) ;
2158
2198
tarball. is_preview ( true ) ;
2199
+ tarball. is_prepare_only ( self . prepare_only ) ;
2159
2200
2160
2201
// Prepare the image directory
2161
2202
let src_bindir = builder. llvm_out ( target) . join ( "bin" ) ;
0 commit comments