@@ -14,7 +14,7 @@ use core::{PackageId, Target};
14
14
use handle_error;
15
15
use util:: { internal, profile, CargoResult , CargoResultExt , ProcessBuilder } ;
16
16
use util:: { Config , DependencyQueue , Dirty , Fresh , Freshness } ;
17
- use util:: Progress ;
17
+ use util:: { Progress , ProgressStyle } ;
18
18
19
19
use super :: job:: Job ;
20
20
use super :: { BuildContext , BuildPlan , CompileMode , Context , Kind , Unit } ;
@@ -29,7 +29,7 @@ pub struct JobQueue<'a> {
29
29
queue : DependencyQueue < Key < ' a > , Vec < ( Job , Freshness ) > > ,
30
30
tx : Sender < Message < ' a > > ,
31
31
rx : Receiver < Message < ' a > > ,
32
- active : HashSet < Key < ' a > > ,
32
+ active : Vec < Key < ' a > > ,
33
33
pending : HashMap < Key < ' a > , PendingBuild > ,
34
34
compiled : HashSet < & ' a PackageId > ,
35
35
documented : HashSet < & ' a PackageId > ,
@@ -99,7 +99,7 @@ impl<'a> JobQueue<'a> {
99
99
queue : DependencyQueue :: new ( ) ,
100
100
tx,
101
101
rx,
102
- active : HashSet :: new ( ) ,
102
+ active : Vec :: new ( ) ,
103
103
pending : HashMap :: new ( ) ,
104
104
compiled : HashSet :: new ( ) ,
105
105
documented : HashSet :: new ( ) ,
@@ -181,7 +181,7 @@ impl<'a> JobQueue<'a> {
181
181
// successful and otherwise wait for pending work to finish if it failed
182
182
// and then immediately return.
183
183
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 ) ;
185
185
let queue_len = self . queue . len ( ) ;
186
186
loop {
187
187
// Dequeue as much work as we can, learning about everything
@@ -227,11 +227,10 @@ impl<'a> JobQueue<'a> {
227
227
tokens. truncate ( self . active . len ( ) - 1 ) ;
228
228
229
229
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 {
231
231
CompileMode :: Doc { .. } => format ! ( "{}(doc)" , key. pkg. name( ) ) ,
232
232
_ => key. pkg . name ( ) . to_string ( ) ,
233
233
} ) . collect :: < Vec < _ > > ( ) ;
234
- active_names. sort_unstable ( ) ;
235
234
drop ( progress. tick_now ( count, queue_len, format ! ( ": {}" , active_names. join( ", " ) ) ) ) ;
236
235
let event = self . rx . recv ( ) . unwrap ( ) ;
237
236
progress. clear ( ) ;
@@ -259,7 +258,10 @@ impl<'a> JobQueue<'a> {
259
258
Message :: Finish ( key, result) => {
260
259
info ! ( "end: {:?}" , key) ;
261
260
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
+ }
263
265
if !self . active . is_empty ( ) {
264
266
assert ! ( !tokens. is_empty( ) ) ;
265
267
drop ( tokens. pop ( ) ) ;
@@ -349,7 +351,7 @@ impl<'a> JobQueue<'a> {
349
351
) -> CargoResult < ( ) > {
350
352
info ! ( "start: {:?}" , key) ;
351
353
352
- self . active . insert ( key) ;
354
+ self . active . push ( key) ;
353
355
* self . counts . get_mut ( key. pkg ) . unwrap ( ) -= 1 ;
354
356
355
357
let my_tx = self . tx . clone ( ) ;
0 commit comments