Skip to content

Commit fb0ea00

Browse files
committed
test
Signed-off-by: onur-ozkan <[email protected]>
1 parent cc6f786 commit fb0ea00

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/bootstrap/src/core/build_steps/tool.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,9 @@ impl Step for Rustdoc {
625625
}
626626

627627
let bin_rustdoc = || {
628+
let mut compiler = self.compiler;
629+
compiler.stage += 1;
630+
628631
let sysroot = builder.sysroot(compiler);
629632
let bindir = sysroot.join("bin");
630633
t!(fs::create_dir_all(&bindir));
@@ -681,7 +684,7 @@ impl Step for Rustdoc {
681684
});
682685

683686
// don't create a stage0-sysroot/bin directory.
684-
if compiler.stage > 0 {
687+
if compiler.stage > 0 || self.compiler.is_downgraded_already() {
685688
if builder.config.rust_debuginfo_level_tools == DebuginfoLevel::None {
686689
// Due to LTO a lot of debug info from C++ dependencies such as jemalloc can make it into
687690
// our final binaries

src/bootstrap/src/core/builder/cargo.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::env;
22
use std::ffi::{OsStr, OsString};
3-
use std::path::{Path, PathBuf};
3+
use std::path::Path;
44

55
use super::{Builder, Kind};
66
use crate::core::build_steps::tool::SourceType;
@@ -456,7 +456,7 @@ impl Builder<'_> {
456456
/// commands to be run with Miri.
457457
fn cargo(
458458
&self,
459-
compiler: Compiler,
459+
mut compiler: Compiler,
460460
mode: Mode,
461461
source_type: SourceType,
462462
target: TargetSelection,
@@ -473,6 +473,7 @@ impl Builder<'_> {
473473
build_stamp::clear_if_dirty(self, &out_dir, &backend);
474474
}
475475

476+
let rustdoc_path = self.rustc(compiler).parent().unwrap().join("rustdoc");
476477
if cmd_kind == Kind::Doc {
477478
let my_out = match mode {
478479
// This is the intended out directory for compiler documentation.
@@ -486,8 +487,7 @@ impl Builder<'_> {
486487
}
487488
_ => panic!("doc mode {mode:?} not expected"),
488489
};
489-
let rustdoc = self.rustdoc(compiler);
490-
build_stamp::clear_if_dirty(self, &my_out, &rustdoc);
490+
build_stamp::clear_if_dirty(self, &my_out, &rustdoc_path);
491491
}
492492

493493
let profile_var = |name: &str| cargo_profile_var(name, &self.config);
@@ -779,11 +779,6 @@ impl Builder<'_> {
779779
build_stamp::clear_if_dirty(self, &out_dir, &self.rustc(compiler));
780780
}
781781

782-
let rustdoc_path = match cmd_kind {
783-
Kind::Doc | Kind::Test | Kind::MiriTest => self.rustdoc(compiler),
784-
_ => PathBuf::from("/path/to/nowhere/rustdoc/not/required"),
785-
};
786-
787782
// Customize the compiler we're running. Specify the compiler to cargo
788783
// as our shim and then pass it some various options used to configure
789784
// how the actual compiler itself is called.

0 commit comments

Comments
 (0)