1
1
use std:: any:: Any ;
2
2
use std:: cell:: { Cell , RefCell } ;
3
3
use std:: collections:: BTreeSet ;
4
- use std:: collections:: HashMap ;
5
4
use std:: env;
6
5
use std:: ffi:: OsStr ;
7
6
use std:: fmt:: Debug ;
@@ -29,9 +28,6 @@ use crate::{Build, DocTests, Mode, GitRepo};
29
28
30
29
pub use crate :: Compiler ;
31
30
32
- use petgraph:: graph:: NodeIndex ;
33
- use petgraph:: Graph ;
34
-
35
31
pub struct Builder < ' a > {
36
32
pub build : & ' a Build ,
37
33
pub top_stage : u32 ,
@@ -40,9 +36,6 @@ pub struct Builder<'a> {
40
36
stack : RefCell < Vec < Box < dyn Any > > > ,
41
37
time_spent_on_dependencies : Cell < Duration > ,
42
38
pub paths : Vec < PathBuf > ,
43
- graph_nodes : RefCell < HashMap < String , NodeIndex > > ,
44
- graph : RefCell < Graph < String , bool > > ,
45
- parent : Cell < Option < NodeIndex > > ,
46
39
}
47
40
48
41
impl < ' a > Deref for Builder < ' a > {
@@ -490,9 +483,6 @@ impl<'a> Builder<'a> {
490
483
stack : RefCell :: new ( Vec :: new ( ) ) ,
491
484
time_spent_on_dependencies : Cell :: new ( Duration :: new ( 0 , 0 ) ) ,
492
485
paths : vec ! [ ] ,
493
- graph_nodes : RefCell :: new ( HashMap :: new ( ) ) ,
494
- graph : RefCell :: new ( Graph :: new ( ) ) ,
495
- parent : Cell :: new ( None ) ,
496
486
} ;
497
487
498
488
let builder = & builder;
@@ -535,17 +525,13 @@ impl<'a> Builder<'a> {
535
525
stack : RefCell :: new ( Vec :: new ( ) ) ,
536
526
time_spent_on_dependencies : Cell :: new ( Duration :: new ( 0 , 0 ) ) ,
537
527
paths : paths. to_owned ( ) ,
538
- graph_nodes : RefCell :: new ( HashMap :: new ( ) ) ,
539
- graph : RefCell :: new ( Graph :: new ( ) ) ,
540
- parent : Cell :: new ( None ) ,
541
528
} ;
542
529
543
530
builder
544
531
}
545
532
546
- pub fn execute_cli ( & self ) -> Graph < String , bool > {
533
+ pub fn execute_cli ( & self ) {
547
534
self . run_step_descriptions ( & Builder :: get_step_descriptions ( self . kind ) , & self . paths ) ;
548
- self . graph . borrow ( ) . clone ( )
549
535
}
550
536
551
537
pub fn default_doc ( & self , paths : Option < & [ PathBuf ] > ) {
@@ -1260,41 +1246,12 @@ impl<'a> Builder<'a> {
1260
1246
if let Some ( out) = self . cache . get ( & step) {
1261
1247
self . verbose ( & format ! ( "{}c {:?}" , " " . repeat( stack. len( ) ) , step) ) ;
1262
1248
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
-
1276
1249
return out;
1277
1250
}
1278
1251
self . verbose ( & format ! ( "{}> {:?}" , " " . repeat( stack. len( ) ) , step) ) ;
1279
1252
stack. push ( Box :: new ( step. clone ( ) ) ) ;
1280
1253
}
1281
1254
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
-
1298
1255
let ( out, dur) = {
1299
1256
let start = Instant :: now ( ) ;
1300
1257
let zero = Duration :: new ( 0 , 0 ) ;
@@ -1305,8 +1262,6 @@ impl<'a> Builder<'a> {
1305
1262
( out, dur - deps)
1306
1263
} ;
1307
1264
1308
- self . parent . set ( prev_parent) ;
1309
-
1310
1265
if self . config . print_step_timings && dur > Duration :: from_millis ( 100 ) {
1311
1266
println ! (
1312
1267
"[TIMING] {:?} -- {}.{:03}" ,
0 commit comments