Build rustdoc for cross-compiled targets

This isn't an issue for most folks who use x.py dist, which will directly depend
on this. But for x.py build, if we don't properly set target here rustdoc will
not be built.

Currently, there is not a default-on step for generating a rustc for a given
target either, so we will fail to build a rustc as well.
This commit is contained in:
Mark Rousskov 2020-09-16 12:47:26 -04:00
parent 7e24136996
commit bd4e0af0b5

View file

@ -471,7 +471,11 @@ impl Step for Rustdoc {
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Rustdoc {
compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()),
// Note: this is somewhat unique in that we actually want a *target*
// compiler here, because rustdoc *is* a compiler. We won't be using
// this as the compiler to build with, but rather this is "what
// compiler are we producing"?
compiler: run.builder.compiler(run.builder.top_stage, run.target),
});
}