Rollup merge of #67489 - Mark-Simulacrum:drop-petgraph, r=Centril

Drop petgraph dependency from bootstrap

It was essentially unused, likely leftover from a previous refactoring iteration. This should hopefully help reduce bootstrap build times a little, dropping petgraph, fixedbitset, and ordermap from the dependency set.

r? @alexcrichton
This commit is contained in:
Mazdak Farrokhzad 2019-12-21 19:07:40 +01:00 committed by GitHub
commit 2135cc48e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 70 deletions

View File

@ -195,7 +195,6 @@ dependencies = [
"lazy_static 1.3.0", "lazy_static 1.3.0",
"libc", "libc",
"num_cpus", "num_cpus",
"petgraph",
"pretty_assertions", "pretty_assertions",
"serde", "serde",
"serde_json", "serde_json",
@ -1081,12 +1080,6 @@ dependencies = [
"redox_syscall", "redox_syscall",
] ]
[[package]]
name = "fixedbitset"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.12" version = "1.0.12"
@ -2288,12 +2281,6 @@ dependencies = [
"vcpkg", "vcpkg",
] ]
[[package]]
name = "ordermap"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
[[package]] [[package]]
name = "ordslice" name = "ordslice"
version = "0.3.0" version = "0.3.0"
@ -2429,16 +2416,6 @@ dependencies = [
"sha-1", "sha-1",
] ]
[[package]]
name = "petgraph"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
dependencies = [
"fixedbitset",
"ordermap",
]
[[package]] [[package]]
name = "phf" name = "phf"
version = "0.7.24" version = "0.7.24"

View File

@ -47,7 +47,6 @@ serde_json = "1.0.2"
toml = "0.5" toml = "0.5"
lazy_static = "1.3.0" lazy_static = "1.3.0"
time = "0.1" time = "0.1"
petgraph = "0.4.13"
[dev-dependencies] [dev-dependencies]
pretty_assertions = "0.5" pretty_assertions = "0.5"

View File

@ -1,7 +1,6 @@
use std::any::Any; use std::any::Any;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::collections::BTreeSet; use std::collections::BTreeSet;
use std::collections::HashMap;
use std::env; use std::env;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fmt::Debug; use std::fmt::Debug;
@ -29,9 +28,6 @@ use crate::{Build, DocTests, Mode, GitRepo};
pub use crate::Compiler; pub use crate::Compiler;
use petgraph::graph::NodeIndex;
use petgraph::Graph;
pub struct Builder<'a> { pub struct Builder<'a> {
pub build: &'a Build, pub build: &'a Build,
pub top_stage: u32, pub top_stage: u32,
@ -40,9 +36,6 @@ pub struct Builder<'a> {
stack: RefCell<Vec<Box<dyn Any>>>, stack: RefCell<Vec<Box<dyn Any>>>,
time_spent_on_dependencies: Cell<Duration>, time_spent_on_dependencies: Cell<Duration>,
pub paths: Vec<PathBuf>, pub paths: Vec<PathBuf>,
graph_nodes: RefCell<HashMap<String, NodeIndex>>,
graph: RefCell<Graph<String, bool>>,
parent: Cell<Option<NodeIndex>>,
} }
impl<'a> Deref for Builder<'a> { impl<'a> Deref for Builder<'a> {
@ -490,9 +483,6 @@ impl<'a> Builder<'a> {
stack: RefCell::new(Vec::new()), stack: RefCell::new(Vec::new()),
time_spent_on_dependencies: Cell::new(Duration::new(0, 0)), time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
paths: vec![], paths: vec![],
graph_nodes: RefCell::new(HashMap::new()),
graph: RefCell::new(Graph::new()),
parent: Cell::new(None),
}; };
let builder = &builder; let builder = &builder;
@ -535,17 +525,13 @@ impl<'a> Builder<'a> {
stack: RefCell::new(Vec::new()), stack: RefCell::new(Vec::new()),
time_spent_on_dependencies: Cell::new(Duration::new(0, 0)), time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
paths: paths.to_owned(), paths: paths.to_owned(),
graph_nodes: RefCell::new(HashMap::new()),
graph: RefCell::new(Graph::new()),
parent: Cell::new(None),
}; };
builder builder
} }
pub fn execute_cli(&self) -> Graph<String, bool> { pub fn execute_cli(&self) {
self.run_step_descriptions(&Builder::get_step_descriptions(self.kind), &self.paths); self.run_step_descriptions(&Builder::get_step_descriptions(self.kind), &self.paths);
self.graph.borrow().clone()
} }
pub fn default_doc(&self, paths: Option<&[PathBuf]>) { pub fn default_doc(&self, paths: Option<&[PathBuf]>) {
@ -1260,41 +1246,12 @@ impl<'a> Builder<'a> {
if let Some(out) = self.cache.get(&step) { if let Some(out) = self.cache.get(&step) {
self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step)); self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
{
let mut graph = self.graph.borrow_mut();
let parent = self.parent.get();
let us = *self
.graph_nodes
.borrow_mut()
.entry(format!("{:?}", step))
.or_insert_with(|| graph.add_node(format!("{:?}", step)));
if let Some(parent) = parent {
graph.add_edge(parent, us, false);
}
}
return out; return out;
} }
self.verbose(&format!("{}> {:?}", " ".repeat(stack.len()), step)); self.verbose(&format!("{}> {:?}", " ".repeat(stack.len()), step));
stack.push(Box::new(step.clone())); stack.push(Box::new(step.clone()));
} }
let prev_parent = self.parent.get();
{
let mut graph = self.graph.borrow_mut();
let parent = self.parent.get();
let us = *self
.graph_nodes
.borrow_mut()
.entry(format!("{:?}", step))
.or_insert_with(|| graph.add_node(format!("{:?}", step)));
self.parent.set(Some(us));
if let Some(parent) = parent {
graph.add_edge(parent, us, true);
}
}
let (out, dur) = { let (out, dur) = {
let start = Instant::now(); let start = Instant::now();
let zero = Duration::new(0, 0); let zero = Duration::new(0, 0);
@ -1305,8 +1262,6 @@ impl<'a> Builder<'a> {
(out, dur - deps) (out, dur - deps)
}; };
self.parent.set(prev_parent);
if self.config.print_step_timings && dur > Duration::from_millis(100) { if self.config.print_step_timings && dur > Duration::from_millis(100) {
println!( println!(
"[TIMING] {:?} -- {}.{:03}", "[TIMING] {:?} -- {}.{:03}",