Skip to content

Commit

Permalink
rustbuild: Assert extended builds don't dist too much
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton committed May 28, 2019
1 parent f7cc467 commit 59291dc
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 113 deletions.
27 changes: 14 additions & 13 deletions src/bootstrap/builder.rs
Expand Up @@ -1371,7 +1371,7 @@ mod __test {

assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[dist::Docs { stage: 2, host: a },]
&[dist::Docs { host: a },]
);
assert_eq!(
first(builder.cache.all::<dist::Mingw>()),
Expand Down Expand Up @@ -1405,8 +1405,8 @@ mod __test {
assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[
dist::Docs { stage: 2, host: a },
dist::Docs { stage: 2, host: b },
dist::Docs { host: a },
dist::Docs { host: b },
]
);
assert_eq!(
Expand Down Expand Up @@ -1447,8 +1447,8 @@ mod __test {
assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[
dist::Docs { stage: 2, host: a },
dist::Docs { stage: 2, host: b },
dist::Docs { host: a },
dist::Docs { host: b },
]
);
assert_eq!(
Expand Down Expand Up @@ -1488,6 +1488,7 @@ mod __test {
let b = INTERNER.intern_str("B");
let mut build = Build::new(configure(&["B"], &[]));
build.config.docs = false;
build.config.extended = true;
build.hosts = vec![b];
let mut builder = Builder::new(&build);
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
Expand Down Expand Up @@ -1528,9 +1529,9 @@ mod __test {
assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[
dist::Docs { stage: 2, host: a },
dist::Docs { stage: 2, host: b },
dist::Docs { stage: 2, host: c },
dist::Docs { host: a },
dist::Docs { host: b },
dist::Docs { host: c },
]
);
assert_eq!(
Expand Down Expand Up @@ -1587,9 +1588,9 @@ mod __test {
assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[
dist::Docs { stage: 2, host: a },
dist::Docs { stage: 2, host: b },
dist::Docs { stage: 2, host: c },
dist::Docs { host: a },
dist::Docs { host: b },
dist::Docs { host: c },
]
);
assert_eq!(
Expand Down Expand Up @@ -1633,8 +1634,8 @@ mod __test {
assert_eq!(
first(builder.cache.all::<dist::Docs>()),
&[
dist::Docs { stage: 2, host: a },
dist::Docs { stage: 2, host: b },
dist::Docs { host: a },
dist::Docs { host: b },
]
);
assert_eq!(
Expand Down

0 comments on commit 59291dc

Please sign in to comment.