Skip to content

Commit 186cb6f

Browse files
committed
test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent b661310 commit 186cb6f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ impl Step for Rustdoc {
638638
}
639639

640640
let bin_rustdoc = || {
641+
let mut compiler = self.compiler;
642+
compiler.stage += 1;
643+
641644
let sysroot = builder.sysroot(compiler);
642645
let bindir = sysroot.join("bin");
643646
t!(fs::create_dir_all(&bindir));
@@ -694,7 +697,7 @@ impl Step for Rustdoc {
694697
});
695698

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

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

+4-8
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;
@@ -491,6 +491,8 @@ impl Builder<'_> {
491491
build_stamp::clear_if_dirty(self, &out_dir, &backend);
492492
}
493493

494+
// RUSTC AND TOOL DOWNGRADES MISMATCH
495+
let rustdoc_path = self.rustc(compiler).parent().unwrap().join("rustdoc");
494496
if cmd_kind == Kind::Doc {
495497
let my_out = match mode {
496498
// This is the intended out directory for compiler documentation.
@@ -504,8 +506,7 @@ impl Builder<'_> {
504506
}
505507
_ => panic!("doc mode {mode:?} not expected"),
506508
};
507-
let rustdoc = self.rustdoc(compiler);
508-
build_stamp::clear_if_dirty(self, &my_out, &rustdoc);
509+
build_stamp::clear_if_dirty(self, &my_out, &rustdoc_path);
509510
}
510511

511512
let profile_var = |name: &str| cargo_profile_var(name, &self.config);
@@ -801,11 +802,6 @@ impl Builder<'_> {
801802
build_stamp::clear_if_dirty(self, &out_dir, &self.rustc(compiler));
802803
}
803804

804-
let rustdoc_path = match cmd_kind {
805-
Kind::Doc | Kind::Test | Kind::MiriTest => self.rustdoc(compiler),
806-
_ => PathBuf::from("/path/to/nowhere/rustdoc/not/required"),
807-
};
808-
809805
// Customize the compiler we're running. Specify the compiler to cargo
810806
// as our shim and then pass it some various options used to configure
811807
// how the actual compiler itself is called.

0 commit comments

Comments
 (0)