Skip to content

Commit 59291dc

Browse files
committed
rustbuild: Assert extended builds don't dist too much
This extends a test in the previous commit to assert that we don't build extra rustc compilers even when the "extended" option is set to true. This involved some internal refactoring to have more judicious usage of `compiler_for`, added in the previous commit, as well. Various `dist::*` targets were refactored to be parameterized with a `Compiler` instead of a `stage`/`host`, and then the various parameters within the `Extended` target were tweaked to ensure that we don't ever accidentally ask for a stage2 build compiler when we're distributing something.
1 parent f7cc467 commit 59291dc

File tree

3 files changed

+126
-113
lines changed

3 files changed

+126
-113
lines changed

src/bootstrap/builder.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ mod __test {
13711371

13721372
assert_eq!(
13731373
first(builder.cache.all::<dist::Docs>()),
1374-
&[dist::Docs { stage: 2, host: a },]
1374+
&[dist::Docs { host: a },]
13751375
);
13761376
assert_eq!(
13771377
first(builder.cache.all::<dist::Mingw>()),
@@ -1405,8 +1405,8 @@ mod __test {
14051405
assert_eq!(
14061406
first(builder.cache.all::<dist::Docs>()),
14071407
&[
1408-
dist::Docs { stage: 2, host: a },
1409-
dist::Docs { stage: 2, host: b },
1408+
dist::Docs { host: a },
1409+
dist::Docs { host: b },
14101410
]
14111411
);
14121412
assert_eq!(
@@ -1447,8 +1447,8 @@ mod __test {
14471447
assert_eq!(
14481448
first(builder.cache.all::<dist::Docs>()),
14491449
&[
1450-
dist::Docs { stage: 2, host: a },
1451-
dist::Docs { stage: 2, host: b },
1450+
dist::Docs { host: a },
1451+
dist::Docs { host: b },
14521452
]
14531453
);
14541454
assert_eq!(
@@ -1488,6 +1488,7 @@ mod __test {
14881488
let b = INTERNER.intern_str("B");
14891489
let mut build = Build::new(configure(&["B"], &[]));
14901490
build.config.docs = false;
1491+
build.config.extended = true;
14911492
build.hosts = vec![b];
14921493
let mut builder = Builder::new(&build);
14931494
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
@@ -1528,9 +1529,9 @@ mod __test {
15281529
assert_eq!(
15291530
first(builder.cache.all::<dist::Docs>()),
15301531
&[
1531-
dist::Docs { stage: 2, host: a },
1532-
dist::Docs { stage: 2, host: b },
1533-
dist::Docs { stage: 2, host: c },
1532+
dist::Docs { host: a },
1533+
dist::Docs { host: b },
1534+
dist::Docs { host: c },
15341535
]
15351536
);
15361537
assert_eq!(
@@ -1587,9 +1588,9 @@ mod __test {
15871588
assert_eq!(
15881589
first(builder.cache.all::<dist::Docs>()),
15891590
&[
1590-
dist::Docs { stage: 2, host: a },
1591-
dist::Docs { stage: 2, host: b },
1592-
dist::Docs { stage: 2, host: c },
1591+
dist::Docs { host: a },
1592+
dist::Docs { host: b },
1593+
dist::Docs { host: c },
15931594
]
15941595
);
15951596
assert_eq!(
@@ -1633,8 +1634,8 @@ mod __test {
16331634
assert_eq!(
16341635
first(builder.cache.all::<dist::Docs>()),
16351636
&[
1636-
dist::Docs { stage: 2, host: a },
1637-
dist::Docs { stage: 2, host: b },
1637+
dist::Docs { host: a },
1638+
dist::Docs { host: b },
16381639
]
16391640
);
16401641
assert_eq!(

0 commit comments

Comments
 (0)