Skip to content

Commit a68d531

Browse files
Add toolstate checking into bootstrap
This is not yet actually used by CI, but implements the logic for checking that tools are properly building on beta/stable and during beta cutoff week. This attempts to mirror the checking functionality in src/ci/docker/x86_64-gnu-tools/checktools.sh, and called scripts. It does not attempt to run the relevant steps (that functionality was originally desired to be moved into bootstrap as well, but doing so proved more difficult than expected). This is intended as a way to centralize and make clearer the logic involved in toolstate checking. In particular, the previous logic was spread across numerous python and shell scripts in such a way that made interpretation quite difficult.
1 parent 8960acf commit a68d531

File tree

3 files changed

+406
-27
lines changed

3 files changed

+406
-27
lines changed

src/bootstrap/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ impl<'a> Builder<'a> {
368368
check::Rustdoc
369369
),
370370
Kind::Test => describe!(
371+
crate::toolstate::ToolStateCheck,
371372
test::Tidy,
372373
test::Ui,
373374
test::CompileFail,

src/bootstrap/lib.rs

-27
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ mod job {
169169
pub use crate::config::Config;
170170
use crate::flags::Subcommand;
171171
use crate::cache::{Interned, INTERNER};
172-
use crate::toolstate::ToolState;
173172

174173
const LLVM_TOOLS: &[&str] = &[
175174
"llvm-nm", // used to inspect binaries; it shows symbol names, their sizes and visibility
@@ -1074,32 +1073,6 @@ impl Build {
10741073
}
10751074
}
10761075

1077-
/// Updates the actual toolstate of a tool.
1078-
///
1079-
/// The toolstates are saved to the file specified by the key
1080-
/// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
1081-
/// done. The file is updated immediately after this function completes.
1082-
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
1083-
if let Some(ref path) = self.config.save_toolstates {
1084-
if let Some(parent) = path.parent() {
1085-
// Ensure the parent directory always exists
1086-
t!(std::fs::create_dir_all(parent));
1087-
}
1088-
let mut file = t!(fs::OpenOptions::new()
1089-
.create(true)
1090-
.read(true)
1091-
.write(true)
1092-
.open(path));
1093-
1094-
let mut current_toolstates: HashMap<Box<str>, ToolState> =
1095-
serde_json::from_reader(&mut file).unwrap_or_default();
1096-
current_toolstates.insert(tool.into(), state);
1097-
t!(file.seek(SeekFrom::Start(0)));
1098-
t!(file.set_len(0));
1099-
t!(serde_json::to_writer(file, &current_toolstates));
1100-
}
1101-
}
1102-
11031076
fn in_tree_crates(&self, root: &str) -> Vec<&Crate> {
11041077
let mut ret = Vec::new();
11051078
let mut list = vec![INTERNER.intern_str(root)];

0 commit comments

Comments
 (0)