Skip to content

Commit 1191510

Browse files
Remove ONLY_BUILD_TARGETS.
All cases where it is used can be replaced by substituing run.host for run.builder.build.build; that is its only effect. As such, it is removable.
1 parent 604d4ce commit 1191510

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

src/bootstrap/builder.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
6060
/// Run this rule for all hosts without cross compiling.
6161
const ONLY_HOSTS: bool = false;
6262

63-
/// Run this rule for all targets, but only with the native host.
64-
const ONLY_BUILD_TARGETS: bool = false;
65-
6663
/// Only run this step with the build triple as host and target.
6764
const ONLY_BUILD: bool = false;
6865

@@ -101,7 +98,6 @@ pub struct RunConfig<'a> {
10198
struct StepDescription {
10299
default: bool,
103100
only_hosts: bool,
104-
only_build_targets: bool,
105101
only_build: bool,
106102
should_run: fn(ShouldRun) -> ShouldRun,
107103
make_run: fn(RunConfig),
@@ -138,7 +134,6 @@ impl StepDescription {
138134
StepDescription {
139135
default: S::DEFAULT,
140136
only_hosts: S::ONLY_HOSTS,
141-
only_build_targets: S::ONLY_BUILD_TARGETS,
142137
only_build: S::ONLY_BUILD,
143138
should_run: S::should_run,
144139
make_run: S::make_run,
@@ -155,7 +150,7 @@ impl StepDescription {
155150
self.name, builder.config.exclude);
156151
}
157152
let build = builder.build;
158-
let hosts = if self.only_build_targets || self.only_build {
153+
let hosts = if self.only_build {
159154
build.build_triple()
160155
} else {
161156
&build.hosts

src/bootstrap/dist.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub struct Docs {
7070
impl Step for Docs {
7171
type Output = PathBuf;
7272
const DEFAULT: bool = true;
73-
const ONLY_BUILD_TARGETS: bool = true;
7473

7574
fn should_run(run: ShouldRun) -> ShouldRun {
7675
run.path("src/doc")
@@ -271,7 +270,6 @@ pub struct Mingw {
271270
impl Step for Mingw {
272271
type Output = Option<PathBuf>;
273272
const DEFAULT: bool = true;
274-
const ONLY_BUILD_TARGETS: bool = true;
275273

276274
fn should_run(run: ShouldRun) -> ShouldRun {
277275
run.never()
@@ -331,7 +329,6 @@ impl Step for Rustc {
331329
type Output = PathBuf;
332330
const DEFAULT: bool = true;
333331
const ONLY_HOSTS: bool = true;
334-
const ONLY_BUILD_TARGETS: bool = true;
335332

336333
fn should_run(run: ShouldRun) -> ShouldRun {
337334
run.path("src/librustc")
@@ -561,15 +558,14 @@ pub struct Std {
561558
impl Step for Std {
562559
type Output = PathBuf;
563560
const DEFAULT: bool = true;
564-
const ONLY_BUILD_TARGETS: bool = true;
565561

566562
fn should_run(run: ShouldRun) -> ShouldRun {
567563
run.path("src/libstd")
568564
}
569565

570566
fn make_run(run: RunConfig) {
571567
run.builder.ensure(Std {
572-
compiler: run.builder.compiler(run.builder.top_stage, run.host),
568+
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
573569
target: run.target,
574570
});
575571
}
@@ -638,7 +634,6 @@ pub struct Analysis {
638634
impl Step for Analysis {
639635
type Output = PathBuf;
640636
const DEFAULT: bool = true;
641-
const ONLY_BUILD_TARGETS: bool = true;
642637

643638
fn should_run(run: ShouldRun) -> ShouldRun {
644639
let builder = run.builder;
@@ -647,7 +642,7 @@ impl Step for Analysis {
647642

648643
fn make_run(run: RunConfig) {
649644
run.builder.ensure(Analysis {
650-
compiler: run.builder.compiler(run.builder.top_stage, run.host),
645+
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
651646
target: run.target,
652647
});
653648
}
@@ -755,8 +750,6 @@ impl Step for Src {
755750
type Output = PathBuf;
756751
const DEFAULT: bool = true;
757752
const ONLY_HOSTS: bool = true;
758-
const ONLY_BUILD_TARGETS: bool = true;
759-
const ONLY_BUILD: bool = true;
760753

761754
fn should_run(run: ShouldRun) -> ShouldRun {
762755
run.path("src")
@@ -851,8 +844,6 @@ impl Step for PlainSourceTarball {
851844
type Output = PathBuf;
852845
const DEFAULT: bool = true;
853846
const ONLY_HOSTS: bool = true;
854-
const ONLY_BUILD_TARGETS: bool = true;
855-
const ONLY_BUILD: bool = true;
856847

857848
fn should_run(run: ShouldRun) -> ShouldRun {
858849
let builder = run.builder;
@@ -1007,7 +998,6 @@ pub struct Cargo {
1007998

1008999
impl Step for Cargo {
10091000
type Output = PathBuf;
1010-
const ONLY_BUILD_TARGETS: bool = true;
10111001
const ONLY_HOSTS: bool = true;
10121002

10131003
fn should_run(run: ShouldRun) -> ShouldRun {
@@ -1095,7 +1085,6 @@ pub struct Rls {
10951085

10961086
impl Step for Rls {
10971087
type Output = Option<PathBuf>;
1098-
const ONLY_BUILD_TARGETS: bool = true;
10991088
const ONLY_HOSTS: bool = true;
11001089

11011090
fn should_run(run: ShouldRun) -> ShouldRun {
@@ -1177,7 +1166,6 @@ pub struct Rustfmt {
11771166

11781167
impl Step for Rustfmt {
11791168
type Output = Option<PathBuf>;
1180-
const ONLY_BUILD_TARGETS: bool = true;
11811169
const ONLY_HOSTS: bool = true;
11821170

11831171
fn should_run(run: ShouldRun) -> ShouldRun {
@@ -1263,7 +1251,6 @@ pub struct Extended {
12631251
impl Step for Extended {
12641252
type Output = ();
12651253
const DEFAULT: bool = true;
1266-
const ONLY_BUILD_TARGETS: bool = true;
12671254
const ONLY_HOSTS: bool = true;
12681255

12691256
fn should_run(run: ShouldRun) -> ShouldRun {
@@ -1274,7 +1261,7 @@ impl Step for Extended {
12741261
fn make_run(run: RunConfig) {
12751262
run.builder.ensure(Extended {
12761263
stage: run.builder.top_stage,
1277-
host: run.host,
1264+
host: run.builder.build.build,
12781265
target: run.target,
12791266
});
12801267
}
@@ -1692,9 +1679,7 @@ pub struct HashSign;
16921679

16931680
impl Step for HashSign {
16941681
type Output = ();
1695-
const ONLY_BUILD_TARGETS: bool = true;
16961682
const ONLY_HOSTS: bool = true;
1697-
const ONLY_BUILD: bool = true;
16981683

16991684
fn should_run(run: ShouldRun) -> ShouldRun {
17001685
run.path("hash-and-sign")

src/bootstrap/install.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ macro_rules! install {
161161
impl Step for $name {
162162
type Output = ();
163163
const DEFAULT: bool = true;
164-
const ONLY_BUILD_TARGETS: bool = true;
165164
const ONLY_HOSTS: bool = $only_hosts;
166165
$(const $c: bool = true;)*
167166

@@ -174,7 +173,7 @@ macro_rules! install {
174173
run.builder.ensure($name {
175174
stage: run.builder.top_stage,
176175
target: run.target,
177-
host: run.host,
176+
host: run.builder.build.build,
178177
});
179178
}
180179

0 commit comments

Comments
 (0)