Skip to content

Commit 0531431

Browse files
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 fe29e7b + a43def7 commit 0531431

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
@@ -180,7 +180,7 @@ impl Rustc {
180180

181181
impl Step for Rustc {
182182
type Output = ();
183-
const ONLY_HOSTS: bool = true;
183+
const IS_HOST: bool = true;
184184
const DEFAULT: bool = true;
185185

186186
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -326,7 +326,7 @@ pub struct CodegenBackend {
326326

327327
impl Step for CodegenBackend {
328328
type Output = ();
329-
const ONLY_HOSTS: bool = true;
329+
const IS_HOST: bool = true;
330330
const DEFAULT: bool = true;
331331

332332
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -412,7 +412,7 @@ macro_rules! tool_check_step {
412412

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub struct Rustc {
190190

191191
impl Step for Rustc {
192192
type Output = ();
193-
const ONLY_HOSTS: bool = true;
193+
const IS_HOST: bool = true;
194194
const DEFAULT: bool = true;
195195

196196
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
@@ -995,7 +995,7 @@ impl Step for Rustc {
995995
/// uplifting it from stage Y, causing the other stage to fail when attempting to link with
996996
/// stage X which was never actually built.
997997
type Output = u32;
998-
const ONLY_HOSTS: bool = true;
998+
const IS_HOST: bool = true;
999999
const DEFAULT: bool = false;
10001000

10011001
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1550,7 +1550,7 @@ pub struct GccCodegenBackend {
15501550

15511551
impl Step for GccCodegenBackend {
15521552
type Output = BuildStamp;
1553-
const ONLY_HOSTS: bool = true;
1553+
const IS_HOST: bool = true;
15541554

15551555
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15561556
run.alias("rustc_codegen_gcc").alias("cg_gcc")
@@ -1630,7 +1630,7 @@ pub struct CraneliftCodegenBackend {
16301630

16311631
impl Step for CraneliftCodegenBackend {
16321632
type Output = BuildStamp;
1633-
const ONLY_HOSTS: bool = true;
1633+
const IS_HOST: bool = true;
16341634

16351635
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
16361636
run.alias("rustc_codegen_cranelift").alias("cg_clif")
@@ -1994,7 +1994,7 @@ pub struct Assemble {
19941994

19951995
impl Step for Assemble {
19961996
type Output = Compiler;
1997-
const ONLY_HOSTS: bool = true;
1997+
const IS_HOST: bool = true;
19981998

19991999
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
20002000
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")
@@ -782,7 +782,7 @@ pub struct RustcDev {
782782
impl Step for RustcDev {
783783
type Output = Option<GeneratedTarball>;
784784
const DEFAULT: bool = true;
785-
const ONLY_HOSTS: bool = true;
785+
const IS_HOST: bool = true;
786786

787787
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
788788
run.alias("rustc-dev")
@@ -1012,7 +1012,7 @@ impl Step for Src {
10121012
/// The output path of the src installer tarball
10131013
type Output = GeneratedTarball;
10141014
const DEFAULT: bool = true;
1015-
const ONLY_HOSTS: bool = true;
1015+
const IS_HOST: bool = true;
10161016

10171017
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
10181018
run.alias("rust-src")
@@ -1073,7 +1073,7 @@ impl Step for PlainSourceTarball {
10731073
/// Produces the location of the tarball generated
10741074
type Output = GeneratedTarball;
10751075
const DEFAULT: bool = true;
1076-
const ONLY_HOSTS: bool = true;
1076+
const IS_HOST: bool = true;
10771077

10781078
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
10791079
let builder = run.builder;
@@ -1221,7 +1221,7 @@ pub struct Cargo {
12211221
impl Step for Cargo {
12221222
type Output = Option<GeneratedTarball>;
12231223
const DEFAULT: bool = true;
1224-
const ONLY_HOSTS: bool = true;
1224+
const IS_HOST: bool = true;
12251225

12261226
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
12271227
let default = should_build_extended_tool(run.builder, "cargo");
@@ -1275,7 +1275,7 @@ pub struct RustAnalyzer {
12751275
impl Step for RustAnalyzer {
12761276
type Output = Option<GeneratedTarball>;
12771277
const DEFAULT: bool = true;
1278-
const ONLY_HOSTS: bool = true;
1278+
const IS_HOST: bool = true;
12791279

12801280
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
12811281
let default = should_build_extended_tool(run.builder, "rust-analyzer");
@@ -1318,7 +1318,7 @@ pub struct Clippy {
13181318
impl Step for Clippy {
13191319
type Output = Option<GeneratedTarball>;
13201320
const DEFAULT: bool = true;
1321-
const ONLY_HOSTS: bool = true;
1321+
const IS_HOST: bool = true;
13221322

13231323
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
13241324
let default = should_build_extended_tool(run.builder, "clippy");
@@ -1366,7 +1366,7 @@ pub struct Miri {
13661366
impl Step for Miri {
13671367
type Output = Option<GeneratedTarball>;
13681368
const DEFAULT: bool = true;
1369-
const ONLY_HOSTS: bool = true;
1369+
const IS_HOST: bool = true;
13701370

13711371
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
13721372
let default = should_build_extended_tool(run.builder, "miri");
@@ -1416,7 +1416,7 @@ pub struct CraneliftCodegenBackend {
14161416
impl Step for CraneliftCodegenBackend {
14171417
type Output = Option<GeneratedTarball>;
14181418
const DEFAULT: bool = true;
1419-
const ONLY_HOSTS: bool = true;
1419+
const IS_HOST: bool = true;
14201420

14211421
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
14221422
// We only want to build the cranelift backend in `x dist` if the backend was enabled
@@ -1507,7 +1507,7 @@ pub struct Rustfmt {
15071507
impl Step for Rustfmt {
15081508
type Output = Option<GeneratedTarball>;
15091509
const DEFAULT: bool = true;
1510-
const ONLY_HOSTS: bool = true;
1510+
const IS_HOST: bool = true;
15111511

15121512
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15131513
let default = should_build_extended_tool(run.builder, "rustfmt");
@@ -1552,7 +1552,7 @@ pub struct Extended {
15521552
impl Step for Extended {
15531553
type Output = ();
15541554
const DEFAULT: bool = true;
1555-
const ONLY_HOSTS: bool = true;
1555+
const IS_HOST: bool = true;
15561556

15571557
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
15581558
let builder = run.builder;
@@ -2289,7 +2289,7 @@ pub struct LlvmTools {
22892289

22902290
impl Step for LlvmTools {
22912291
type Output = Option<GeneratedTarball>;
2292-
const ONLY_HOSTS: bool = true;
2292+
const IS_HOST: bool = true;
22932293
const DEFAULT: bool = true;
22942294

22952295
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -2394,7 +2394,7 @@ pub struct LlvmBitcodeLinker {
23942394
impl Step for LlvmBitcodeLinker {
23952395
type Output = Option<GeneratedTarball>;
23962396
const DEFAULT: bool = true;
2397-
const ONLY_HOSTS: bool = true;
2397+
const IS_HOST: bool = true;
23982398

23992399
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
24002400
let default = should_build_extended_tool(run.builder, "llvm-bitcode-linker");
@@ -2446,7 +2446,7 @@ pub struct RustDev {
24462446
impl Step for RustDev {
24472447
type Output = Option<GeneratedTarball>;
24482448
const DEFAULT: bool = true;
2449-
const ONLY_HOSTS: bool = true;
2449+
const IS_HOST: bool = true;
24502450

24512451
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
24522452
run.alias("rust-dev")
@@ -2549,7 +2549,7 @@ pub struct Bootstrap {
25492549
impl Step for Bootstrap {
25502550
type Output = Option<GeneratedTarball>;
25512551
const DEFAULT: bool = false;
2552-
const ONLY_HOSTS: bool = true;
2552+
const IS_HOST: bool = true;
25532553

25542554
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
25552555
run.alias("bootstrap")
@@ -2589,7 +2589,7 @@ pub struct BuildManifest {
25892589
impl Step for BuildManifest {
25902590
type Output = GeneratedTarball;
25912591
const DEFAULT: bool = false;
2592-
const ONLY_HOSTS: bool = true;
2592+
const IS_HOST: bool = true;
25932593

25942594
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
25952595
run.alias("build-manifest")
@@ -2621,7 +2621,7 @@ pub struct ReproducibleArtifacts {
26212621
impl Step for ReproducibleArtifacts {
26222622
type Output = Option<GeneratedTarball>;
26232623
const DEFAULT: bool = true;
2624-
const ONLY_HOSTS: bool = true;
2624+
const IS_HOST: bool = true;
26252625

26262626
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
26272627
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
@@ -31,7 +31,7 @@ pub struct GccOutput {
3131
impl Step for Gcc {
3232
type Output = GccOutput;
3333

34-
const ONLY_HOSTS: bool = true;
34+
const IS_HOST: bool = true;
3535

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

0 commit comments

Comments
 (0)