11use std:: any:: Any ;
22use std:: cell:: { Cell , RefCell } ;
33use std:: collections:: BTreeSet ;
4- use std:: collections:: HashMap ;
54use std:: env;
65use std:: ffi:: OsStr ;
76use std:: fmt:: Debug ;
@@ -29,9 +28,6 @@ use crate::{Build, DocTests, Mode, GitRepo};
2928
3029pub use crate :: Compiler ;
3130
32- use petgraph:: graph:: NodeIndex ;
33- use petgraph:: Graph ;
34-
3531pub 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
4841impl < ' 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