diff options
| author | bors <bors@rust-lang.org> | 2019-02-13 10:27:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-13 10:27:50 +0000 |
| commit | c005afcb1ea399ac60f20c784c0833757bb84bc5 (patch) | |
| tree | 401a42623e17c54b5943fadc22aaa2e59b03ff4b /src/bootstrap/builder.rs | |
| parent | ccd23b95e5077a89a2ce35d09cbd4141ccc94f58 (diff) | |
| parent | bb23b175e97b5f0c18440bb04efcb562f9026813 (diff) | |
| download | rust-c005afcb1ea399ac60f20c784c0833757bb84bc5.tar.gz rust-c005afcb1ea399ac60f20c784c0833757bb84bc5.zip | |
Auto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichton
Fixes rustdoc in stage 0, stage 1
When a request for rustdoc is passed for stage 0, x.py build --stage 0
src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we
return the rustdoc for that compiler (i.e., the beta rustdoc).
This fixes stage 0 of https://github.com/rust-lang/rust/issues/52186 as well as being part of general workflow improvements (making stage 0 testing for std work) for rustbuild.
The stage 1 fix (second commit) completely resolves the problem, so this fixes https://github.com/rust-lang/rust/issues/52186.
Diffstat (limited to 'src/bootstrap/builder.rs')
| -rw-r--r-- | src/bootstrap/builder.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 78ba1d376be..9d037dad9cc 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -677,10 +677,9 @@ impl<'a> Builder<'a> { let compiler = self.compiler(self.top_stage, host); cmd.env("RUSTC_STAGE", compiler.stage.to_string()) .env("RUSTC_SYSROOT", self.sysroot(compiler)) - .env( - "RUSTDOC_LIBDIR", - self.sysroot_libdir(compiler, self.config.build), - ) + // Note that this is *not* the sysroot_libdir because rustdoc must be linked + // equivalently to rustc. + .env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler)) .env("CFG_RELEASE_CHANNEL", &self.config.channel) .env("RUSTDOC_REAL", self.rustdoc(host)) .env("RUSTDOC_CRATE_VERSION", self.rust_version()) @@ -874,7 +873,7 @@ impl<'a> Builder<'a> { } else { &maybe_sysroot }; - let libdir = sysroot.join(libdir(&compiler.host)); + let libdir = self.rustc_libdir(compiler); // Customize the compiler we're running. Specify the compiler to cargo // as our shim and then pass it some various options used to configure @@ -916,7 +915,7 @@ impl<'a> Builder<'a> { cargo.env("RUSTC_ERROR_FORMAT", error_format); } if cmd != "build" && cmd != "check" && cmd != "rustc" && want_rustdoc { - cargo.env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.config.build)); + cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler)); } if mode.is_tool() { |
