Skip to content

Commit 06246bf

Browse files
authored
Rollup merge of rust-lang#145324 - Kobzol:bootstrap-host-only, r=jieyouxu
Rename and document `ONLY_HOSTS` in bootstrap Everytime I examined the `ONLY_HOSTS` flag of bootstrap steps, I was utterly confused. Why is it called ONLY_HOSTS? How does the fact that it is skipped if `--target` is passed, but `--host` is not (which was not accurate) help me? The reality of the flag is that if it is true, the targets for which the given Step will be built is determined based on the `--host` flag, while if it is false, it is determined based on the `--target` flag, that's pretty much it. The previous comment was just a (not very helpful and not even accurate) corollary of that. I clarified the comment, and also renamed the flag to `IS_HOST` (happy to brainstorm better names, but the doc. comment change is IMO the main improvement). r? ``@jieyouxu``
2 parents ebd4a10 + e08c755 commit 06246bf

File tree

14 files changed

+119
-119
lines changed

14 files changed

+119
-119
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Rustc {
172172

173173
impl Step for Rustc {
174174
type Output = ();
175-
const ONLY_HOSTS: bool = true;
175+
const IS_HOST: bool = true;
176176
const DEFAULT: bool = true;
177177

178178
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -324,7 +324,7 @@ pub struct CodegenBackend {
324324

325325
impl Step for CodegenBackend {
326326
type Output = ();
327-
const ONLY_HOSTS: bool = true;
327+
const IS_HOST: bool = true;
328328
const DEFAULT: bool = true;
329329

330330
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -410,7 +410,7 @@ macro_rules! tool_check_step {
410410

411411
impl Step for $name {
412412
type Output = ();
413-
const ONLY_HOSTS: bool = true;
413+
const IS_HOST: bool = true;
414414
/// Most of the tool-checks using this macro are run by default.
415415
const DEFAULT: bool = true $( && $default )?;
416416

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl Rustc {
256256

257257
impl Step for Rustc {
258258
type Output = ();
259-
const ONLY_HOSTS: bool = true;
259+
const IS_HOST: bool = true;
260260
const DEFAULT: bool = true;
261261

262262
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ impl Step for Rustc {
959959
/// uplifting it from stage Y, causing the other stage to fail when attempting to link with
960960
/// stage X which was never actually built.
961961
type Output = u32;
962-
const ONLY_HOSTS: bool = true;
962+
const IS_HOST: bool = true;
963963
const DEFAULT: bool = false;
964964

965965
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1501,7 +1501,7 @@ pub struct GccCodegenBackend {
15011501
impl Step for GccCodegenBackend {
15021502
type Output = GccCodegenBackendOutput;
15031503

1504-
const ONLY_HOSTS: bool = true;
1504+
const IS_HOST: bool = true;
15051505

15061506
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15071507
run.alias("rustc_codegen_gcc").alias("cg_gcc")
@@ -1575,7 +1575,7 @@ pub struct CraneliftCodegenBackend {
15751575

15761576
impl Step for CraneliftCodegenBackend {
15771577
type Output = BuildStamp;
1578-
const ONLY_HOSTS: bool = true;
1578+
const IS_HOST: bool = true;
15791579

15801580
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15811581
run.alias("rustc_codegen_cranelift").alias("cg_clif")
@@ -1919,7 +1919,7 @@ pub struct Assemble {
19191919

19201920
impl Step for Assemble {
19211921
type Output = Compiler;
1922-
const ONLY_HOSTS: bool = true;
1922+
const IS_HOST: bool = true;
19231923

19241924
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
19251925
run.path("compiler/rustc").path("compiler")

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub struct RustcDocs {
140140
impl Step for RustcDocs {
141141
type Output = Option<GeneratedTarball>;
142142
const DEFAULT: bool = true;
143-
const ONLY_HOSTS: bool = true;
143+
const IS_HOST: bool = true;
144144

145145
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
146146
let builder = run.builder;
@@ -402,7 +402,7 @@ pub struct Rustc {
402402
impl Step for Rustc {
403403
type Output = GeneratedTarball;
404404
const DEFAULT: bool = true;
405-
const ONLY_HOSTS: bool = true;
405+
const IS_HOST: bool = true;
406406

407407
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
408408
run.alias("rustc")
@@ -794,7 +794,7 @@ pub struct RustcDev {
794794
impl Step for RustcDev {
795795
type Output = Option<GeneratedTarball>;
796796
const DEFAULT: bool = true;
797-
const ONLY_HOSTS: bool = true;
797+
const IS_HOST: bool = true;
798798

799799
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
800800
run.alias("rustc-dev")
@@ -1024,7 +1024,7 @@ impl Step for Src {
10241024
/// The output path of the src installer tarball
10251025
type Output = GeneratedTarball;
10261026
const DEFAULT: bool = true;
1027-
const ONLY_HOSTS: bool = true;
1027+
const IS_HOST: bool = true;
10281028

10291029
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
10301030
run.alias("rust-src")
@@ -1085,7 +1085,7 @@ impl Step for PlainSourceTarball {
10851085
/// Produces the location of the tarball generated
10861086
type Output = GeneratedTarball;
10871087
const DEFAULT: bool = true;
1088-
const ONLY_HOSTS: bool = true;
1088+
const IS_HOST: bool = true;
10891089

10901090
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
10911091
let builder = run.builder;
@@ -1233,7 +1233,7 @@ pub struct Cargo {
12331233
impl Step for Cargo {
12341234
type Output = Option<GeneratedTarball>;
12351235
const DEFAULT: bool = true;
1236-
const ONLY_HOSTS: bool = true;
1236+
const IS_HOST: bool = true;
12371237

12381238
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
12391239
let default = should_build_extended_tool(run.builder, "cargo");
@@ -1287,7 +1287,7 @@ pub struct RustAnalyzer {
12871287
impl Step for RustAnalyzer {
12881288
type Output = Option<GeneratedTarball>;
12891289
const DEFAULT: bool = true;
1290-
const ONLY_HOSTS: bool = true;
1290+
const IS_HOST: bool = true;
12911291

12921292
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
12931293
let default = should_build_extended_tool(run.builder, "rust-analyzer");
@@ -1330,7 +1330,7 @@ pub struct Clippy {
13301330
impl Step for Clippy {
13311331
type Output = Option<GeneratedTarball>;
13321332
const DEFAULT: bool = true;
1333-
const ONLY_HOSTS: bool = true;
1333+
const IS_HOST: bool = true;
13341334

13351335
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
13361336
let default = should_build_extended_tool(run.builder, "clippy");
@@ -1378,7 +1378,7 @@ pub struct Miri {
13781378
impl Step for Miri {
13791379
type Output = Option<GeneratedTarball>;
13801380
const DEFAULT: bool = true;
1381-
const ONLY_HOSTS: bool = true;
1381+
const IS_HOST: bool = true;
13821382

13831383
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
13841384
let default = should_build_extended_tool(run.builder, "miri");
@@ -1428,7 +1428,7 @@ pub struct CraneliftCodegenBackend {
14281428
impl Step for CraneliftCodegenBackend {
14291429
type Output = Option<GeneratedTarball>;
14301430
const DEFAULT: bool = true;
1431-
const ONLY_HOSTS: bool = true;
1431+
const IS_HOST: bool = true;
14321432

14331433
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
14341434
// We only want to build the cranelift backend in `x dist` if the backend was enabled
@@ -1519,7 +1519,7 @@ pub struct Rustfmt {
15191519
impl Step for Rustfmt {
15201520
type Output = Option<GeneratedTarball>;
15211521
const DEFAULT: bool = true;
1522-
const ONLY_HOSTS: bool = true;
1522+
const IS_HOST: bool = true;
15231523

15241524
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15251525
let default = should_build_extended_tool(run.builder, "rustfmt");
@@ -1564,7 +1564,7 @@ pub struct Extended {
15641564
impl Step for Extended {
15651565
type Output = ();
15661566
const DEFAULT: bool = true;
1567-
const ONLY_HOSTS: bool = true;
1567+
const IS_HOST: bool = true;
15681568

15691569
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15701570
let builder = run.builder;
@@ -2301,7 +2301,7 @@ pub struct LlvmTools {
23012301

23022302
impl Step for LlvmTools {
23032303
type Output = Option<GeneratedTarball>;
2304-
const ONLY_HOSTS: bool = true;
2304+
const IS_HOST: bool = true;
23052305
const DEFAULT: bool = true;
23062306

23072307
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -2406,7 +2406,7 @@ pub struct LlvmBitcodeLinker {
24062406
impl Step for LlvmBitcodeLinker {
24072407
type Output = Option<GeneratedTarball>;
24082408
const DEFAULT: bool = true;
2409-
const ONLY_HOSTS: bool = true;
2409+
const IS_HOST: bool = true;
24102410

24112411
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
24122412
let default = should_build_extended_tool(run.builder, "llvm-bitcode-linker");
@@ -2458,7 +2458,7 @@ pub struct RustDev {
24582458
impl Step for RustDev {
24592459
type Output = Option<GeneratedTarball>;
24602460
const DEFAULT: bool = true;
2461-
const ONLY_HOSTS: bool = true;
2461+
const IS_HOST: bool = true;
24622462

24632463
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
24642464
run.alias("rust-dev")
@@ -2561,7 +2561,7 @@ pub struct Bootstrap {
25612561
impl Step for Bootstrap {
25622562
type Output = Option<GeneratedTarball>;
25632563
const DEFAULT: bool = false;
2564-
const ONLY_HOSTS: bool = true;
2564+
const IS_HOST: bool = true;
25652565

25662566
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
25672567
run.alias("bootstrap")
@@ -2601,7 +2601,7 @@ pub struct BuildManifest {
26012601
impl Step for BuildManifest {
26022602
type Output = GeneratedTarball;
26032603
const DEFAULT: bool = false;
2604-
const ONLY_HOSTS: bool = true;
2604+
const IS_HOST: bool = true;
26052605

26062606
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
26072607
run.alias("build-manifest")
@@ -2633,7 +2633,7 @@ pub struct ReproducibleArtifacts {
26332633
impl Step for ReproducibleArtifacts {
26342634
type Output = Option<GeneratedTarball>;
26352635
const DEFAULT: bool = true;
2636-
const ONLY_HOSTS: bool = true;
2636+
const IS_HOST: bool = true;
26372637

26382638
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
26392639
run.alias("reproducible-artifacts")

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl Rustc {
830830
impl Step for Rustc {
831831
type Output = ();
832832
const DEFAULT: bool = true;
833-
const ONLY_HOSTS: bool = true;
833+
const IS_HOST: bool = true;
834834

835835
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
836836
let builder = run.builder;
@@ -975,7 +975,7 @@ macro_rules! tool_doc {
975975
impl Step for $tool {
976976
type Output = ();
977977
const DEFAULT: bool = true;
978-
const ONLY_HOSTS: bool = true;
978+
const IS_HOST: bool = true;
979979

980980
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
981981
let builder = run.builder;
@@ -1139,7 +1139,7 @@ pub struct ErrorIndex {
11391139
impl Step for ErrorIndex {
11401140
type Output = ();
11411141
const DEFAULT: bool = true;
1142-
const ONLY_HOSTS: bool = true;
1142+
const IS_HOST: bool = true;
11431143

11441144
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
11451145
let builder = run.builder;
@@ -1181,7 +1181,7 @@ pub struct UnstableBookGen {
11811181
impl Step for UnstableBookGen {
11821182
type Output = ();
11831183
const DEFAULT: bool = true;
1184-
const ONLY_HOSTS: bool = true;
1184+
const IS_HOST: bool = true;
11851185

11861186
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
11871187
let builder = run.builder;
@@ -1248,7 +1248,7 @@ impl RustcBook {
12481248
impl Step for RustcBook {
12491249
type Output = ();
12501250
const DEFAULT: bool = true;
1251-
const ONLY_HOSTS: bool = true;
1251+
const IS_HOST: bool = true;
12521252

12531253
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
12541254
let builder = run.builder;

src/bootstrap/src/core/build_steps/gcc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl GccOutput {
4747
impl Step for Gcc {
4848
type Output = GccOutput;
4949

50-
const ONLY_HOSTS: bool = true;
50+
const IS_HOST: bool = true;
5151

5252
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
5353
run.path("src/gcc").alias("gcc")

0 commit comments

Comments
 (0)