@@ -14,7 +14,7 @@ use core::{PackageId, Target};
1414use handle_error;
1515use util:: { internal, profile, CargoResult , CargoResultExt , ProcessBuilder } ;
1616use util:: { Config , DependencyQueue , Dirty , Fresh , Freshness } ;
17- use util:: Progress ;
17+ use util:: { Progress , ProgressStyle } ;
1818
1919use super :: job:: Job ;
2020use super :: { BuildContext , BuildPlan , CompileMode , Context , Kind , Unit } ;
@@ -29,7 +29,7 @@ pub struct JobQueue<'a> {
2929 queue : DependencyQueue < Key < ' a > , Vec < ( Job , Freshness ) > > ,
3030 tx : Sender < Message < ' a > > ,
3131 rx : Receiver < Message < ' a > > ,
32- active : HashSet < Key < ' a > > ,
32+ active : Vec < Key < ' a > > ,
3333 pending : HashMap < Key < ' a > , PendingBuild > ,
3434 compiled : HashSet < & ' a PackageId > ,
3535 documented : HashSet < & ' a PackageId > ,
@@ -99,7 +99,7 @@ impl<'a> JobQueue<'a> {
9999 queue : DependencyQueue :: new ( ) ,
100100 tx,
101101 rx,
102- active : HashSet :: new ( ) ,
102+ active : Vec :: new ( ) ,
103103 pending : HashMap :: new ( ) ,
104104 compiled : HashSet :: new ( ) ,
105105 documented : HashSet :: new ( ) ,
@@ -181,7 +181,7 @@ impl<'a> JobQueue<'a> {
181181 // successful and otherwise wait for pending work to finish if it failed
182182 // and then immediately return.
183183 let mut error = None ;
184- let mut progress = Progress :: new ( "Building" , cx. bcx . config ) ;
184+ let mut progress = Progress :: with_style ( "Building" , ProgressStyle :: Ratio , cx. bcx . config ) ;
185185 let queue_len = self . queue . len ( ) ;
186186 loop {
187187 // Dequeue as much work as we can, learning about everything
@@ -227,11 +227,10 @@ impl<'a> JobQueue<'a> {
227227 tokens. truncate ( self . active . len ( ) - 1 ) ;
228228
229229 let count = queue_len - self . queue . len ( ) ;
230- let mut active_names = self . active . iter ( ) . map ( |key| match key. mode {
230+ let active_names = self . active . iter ( ) . map ( |key| match key. mode {
231231 CompileMode :: Doc { .. } => format ! ( "{}(doc)" , key. pkg. name( ) ) ,
232232 _ => key. pkg . name ( ) . to_string ( ) ,
233233 } ) . collect :: < Vec < _ > > ( ) ;
234- active_names. sort_unstable ( ) ;
235234 drop ( progress. tick_now ( count, queue_len, format ! ( ": {}" , active_names. join( ", " ) ) ) ) ;
236235 let event = self . rx . recv ( ) . unwrap ( ) ;
237236 progress. clear ( ) ;
@@ -259,7 +258,10 @@ impl<'a> JobQueue<'a> {
259258 Message :: Finish ( key, result) => {
260259 info ! ( "end: {:?}" , key) ;
261260
262- self . active . remove ( & key) ;
261+ // self.active.remove_item(&key); // <- switch to this when stabilized.
262+ if let Some ( pos) = self . active . iter ( ) . position ( |k| * k == key) {
263+ self . active . remove ( pos) ;
264+ }
263265 if !self . active . is_empty ( ) {
264266 assert ! ( !tokens. is_empty( ) ) ;
265267 drop ( tokens. pop ( ) ) ;
@@ -349,7 +351,7 @@ impl<'a> JobQueue<'a> {
349351 ) -> CargoResult < ( ) > {
350352 info ! ( "start: {:?}" , key) ;
351353
352- self . active . insert ( key) ;
354+ self . active . push ( key) ;
353355 * self . counts . get_mut ( key. pkg ) . unwrap ( ) -= 1 ;
354356
355357 let my_tx = self . tx . clone ( ) ;
0 commit comments