about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-10 16:50:45 +0000
committerbors <bors@rust-lang.org>2019-12-10 16:50:45 +0000
commit7dbfb0a8ca4ab74ee3111e57a024f9e6257ce37c (patch)
treef92b20477121841db7a87c9537a73bc0b7526544 /src/bootstrap/lib.rs
parent8960acf023d6739a601ae83cfc3d4ac30a85893e (diff)
parent97d936423c914c4e3402bfecfd6943e1edf23815 (diff)
Auto merge of #66681 - Mark-Simulacrum:toolstate-into-bootstrap, r=pietroalbini
Move toolstate checking into bootstrap

This intends no functional changes, merely translates the spread of shell/python into Rust.

One problematic area that I'd like to avoid but wasn't quite able to figure out how is the master branch script which is still in bash/python -- I cared less about that since it is orthogonal to the actual checking that we're doing, though as-is we're duplicating some code across Rust and that script.

r? @kennytm or maybe @pietroalbini
Diffstat (limited to 'src/bootstrap/lib.rs')
-rw-r--r--src/bootstrap/lib.rs27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 7ea2bb126a6..1f4a4f923e0 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -169,7 +169,6 @@ mod job {
 pub use crate::config::Config;
 use crate::flags::Subcommand;
 use crate::cache::{Interned, INTERNER};
-use crate::toolstate::ToolState;
 
 const LLVM_TOOLS: &[&str] = &[
     "llvm-nm", // used to inspect binaries; it shows symbol names, their sizes and visibility
@@ -1074,32 +1073,6 @@ impl Build {
         }
     }
 
-    /// Updates the actual toolstate of a tool.
-    ///
-    /// The toolstates are saved to the file specified by the key
-    /// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
-    /// done. The file is updated immediately after this function completes.
-    pub fn save_toolstate(&self, tool: &str, state: ToolState) {
-        if let Some(ref path) = self.config.save_toolstates {
-            if let Some(parent) = path.parent() {
-                // Ensure the parent directory always exists
-                t!(std::fs::create_dir_all(parent));
-            }
-            let mut file = t!(fs::OpenOptions::new()
-                .create(true)
-                .read(true)
-                .write(true)
-                .open(path));
-
-            let mut current_toolstates: HashMap<Box<str>, ToolState> =
-                serde_json::from_reader(&mut file).unwrap_or_default();
-            current_toolstates.insert(tool.into(), state);
-            t!(file.seek(SeekFrom::Start(0)));
-            t!(file.set_len(0));
-            t!(serde_json::to_writer(file, &current_toolstates));
-        }
-    }
-
     fn in_tree_crates(&self, root: &str) -> Vec<&Crate> {
         let mut ret = Vec::new();
         let mut list = vec![INTERNER.intern_str(root)];