Skip to content

Commit 28af652

Browse files
Drop petgraph dependency from bootstrap
It was essentially unused, likely leftover from a previous refactoring iteration.
1 parent c64eecf commit 28af652

File tree

3 files changed

+1
-70
lines changed

3 files changed

+1
-70
lines changed

Cargo.lock

-23
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ dependencies = [
195195
"lazy_static 1.3.0",
196196
"libc",
197197
"num_cpus",
198-
"petgraph",
199198
"pretty_assertions",
200199
"serde",
201200
"serde_json",
@@ -1081,12 +1080,6 @@ dependencies = [
10811080
"redox_syscall",
10821081
]
10831082

1084-
[[package]]
1085-
name = "fixedbitset"
1086-
version = "0.1.9"
1087-
source = "registry+https://github.com/rust-lang/crates.io-index"
1088-
checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
1089-
10901083
[[package]]
10911084
name = "flate2"
10921085
version = "1.0.12"
@@ -2288,12 +2281,6 @@ dependencies = [
22882281
"vcpkg",
22892282
]
22902283

2291-
[[package]]
2292-
name = "ordermap"
2293-
version = "0.3.5"
2294-
source = "registry+https://github.com/rust-lang/crates.io-index"
2295-
checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
2296-
22972284
[[package]]
22982285
name = "ordslice"
22992286
version = "0.3.0"
@@ -2429,16 +2416,6 @@ dependencies = [
24292416
"sha-1",
24302417
]
24312418

2432-
[[package]]
2433-
name = "petgraph"
2434-
version = "0.4.13"
2435-
source = "registry+https://github.com/rust-lang/crates.io-index"
2436-
checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
2437-
dependencies = [
2438-
"fixedbitset",
2439-
"ordermap",
2440-
]
2441-
24422419
[[package]]
24432420
name = "phf"
24442421
version = "0.7.24"

src/bootstrap/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ serde_json = "1.0.2"
4747
toml = "0.5"
4848
lazy_static = "1.3.0"
4949
time = "0.1"
50-
petgraph = "0.4.13"
5150

5251
[dev-dependencies]
5352
pretty_assertions = "0.5"

src/bootstrap/builder.rs

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::any::Any;
22
use std::cell::{Cell, RefCell};
33
use std::collections::BTreeSet;
4-
use std::collections::HashMap;
54
use std::env;
65
use std::ffi::OsStr;
76
use std::fmt::Debug;
@@ -29,9 +28,6 @@ use crate::{Build, DocTests, Mode, GitRepo};
2928

3029
pub use crate::Compiler;
3130

32-
use petgraph::graph::NodeIndex;
33-
use petgraph::Graph;
34-
3531
pub struct Builder<'a> {
3632
pub build: &'a Build,
3733
pub top_stage: u32,
@@ -40,9 +36,6 @@ pub struct Builder<'a> {
4036
stack: RefCell<Vec<Box<dyn Any>>>,
4137
time_spent_on_dependencies: Cell<Duration>,
4238
pub paths: Vec<PathBuf>,
43-
graph_nodes: RefCell<HashMap<String, NodeIndex>>,
44-
graph: RefCell<Graph<String, bool>>,
45-
parent: Cell<Option<NodeIndex>>,
4639
}
4740

4841
impl<'a> Deref for Builder<'a> {
@@ -490,9 +483,6 @@ impl<'a> Builder<'a> {
490483
stack: RefCell::new(Vec::new()),
491484
time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
492485
paths: vec![],
493-
graph_nodes: RefCell::new(HashMap::new()),
494-
graph: RefCell::new(Graph::new()),
495-
parent: Cell::new(None),
496486
};
497487

498488
let builder = &builder;
@@ -535,17 +525,13 @@ impl<'a> Builder<'a> {
535525
stack: RefCell::new(Vec::new()),
536526
time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
537527
paths: paths.to_owned(),
538-
graph_nodes: RefCell::new(HashMap::new()),
539-
graph: RefCell::new(Graph::new()),
540-
parent: Cell::new(None),
541528
};
542529

543530
builder
544531
}
545532

546-
pub fn execute_cli(&self) -> Graph<String, bool> {
533+
pub fn execute_cli(&self) {
547534
self.run_step_descriptions(&Builder::get_step_descriptions(self.kind), &self.paths);
548-
self.graph.borrow().clone()
549535
}
550536

551537
pub fn default_doc(&self, paths: Option<&[PathBuf]>) {
@@ -1260,41 +1246,12 @@ impl<'a> Builder<'a> {
12601246
if let Some(out) = self.cache.get(&step) {
12611247
self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
12621248

1263-
{
1264-
let mut graph = self.graph.borrow_mut();
1265-
let parent = self.parent.get();
1266-
let us = *self
1267-
.graph_nodes
1268-
.borrow_mut()
1269-
.entry(format!("{:?}", step))
1270-
.or_insert_with(|| graph.add_node(format!("{:?}", step)));
1271-
if let Some(parent) = parent {
1272-
graph.add_edge(parent, us, false);
1273-
}
1274-
}
1275-
12761249
return out;
12771250
}
12781251
self.verbose(&format!("{}> {:?}", " ".repeat(stack.len()), step));
12791252
stack.push(Box::new(step.clone()));
12801253
}
12811254

1282-
let prev_parent = self.parent.get();
1283-
1284-
{
1285-
let mut graph = self.graph.borrow_mut();
1286-
let parent = self.parent.get();
1287-
let us = *self
1288-
.graph_nodes
1289-
.borrow_mut()
1290-
.entry(format!("{:?}", step))
1291-
.or_insert_with(|| graph.add_node(format!("{:?}", step)));
1292-
self.parent.set(Some(us));
1293-
if let Some(parent) = parent {
1294-
graph.add_edge(parent, us, true);
1295-
}
1296-
}
1297-
12981255
let (out, dur) = {
12991256
let start = Instant::now();
13001257
let zero = Duration::new(0, 0);
@@ -1305,8 +1262,6 @@ impl<'a> Builder<'a> {
13051262
(out, dur - deps)
13061263
};
13071264

1308-
self.parent.set(prev_parent);
1309-
13101265
if self.config.print_step_timings && dur > Duration::from_millis(100) {
13111266
println!(
13121267
"[TIMING] {:?} -- {}.{:03}",

0 commit comments

Comments
 (0)