Skip to content

Commit cb5df50

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

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Diff for: 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

Diff for: src/bootstrap/src/core/builder/cargo.rs

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

494+
let rustdoc_path = self.rustc(compiler).parent().unwrap().join("rustdoc");
494495
if cmd_kind == Kind::Doc {
495496
let my_out = match mode {
496497
// This is the intended out directory for compiler documentation.
@@ -504,8 +505,7 @@ impl Builder<'_> {
504505
}
505506
_ => panic!("doc mode {mode:?} not expected"),
506507
};
507-
let rustdoc = self.rustdoc(compiler);
508-
build_stamp::clear_if_dirty(self, &my_out, &rustdoc);
508+
build_stamp::clear_if_dirty(self, &my_out, &rustdoc_path);
509509
}
510510

511511
let profile_var = |name: &str| cargo_profile_var(name, &self.config);
@@ -801,11 +801,6 @@ impl Builder<'_> {
801801
build_stamp::clear_if_dirty(self, &out_dir, &self.rustc(compiler));
802802
}
803803

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-
809804
// Customize the compiler we're running. Specify the compiler to cargo
810805
// as our shim and then pass it some various options used to configure
811806
// how the actual compiler itself is called.

0 commit comments

Comments
 (0)