File tree 4 files changed +22
-1
lines changed 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Available unstable (nightly-only) flags:
22
22
-Z offline -- Offline mode that does not perform network requests
23
23
-Z unstable-options -- Allow the usage of unstable options such as --registry
24
24
-Z config-profile -- Read profiles from .cargo/config files
25
+ -Z compile-progress -- Display a progress bar while compiling
25
26
26
27
Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
27
28
) ;
Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ impl<'a> JobQueue<'a> {
195
195
// we're at it.
196
196
let mut error = None ;
197
197
let mut progress = Progress :: with_style ( "Building" , ProgressStyle :: Ratio , cx. bcx . config ) ;
198
- progress. disable ( ) ;
198
+ if !cx. bcx . config . cli_unstable ( ) . compile_progress {
199
+ progress. disable ( ) ;
200
+ }
199
201
let total = self . queue . len ( ) ;
200
202
loop {
201
203
// Dequeue as much work as we can, learning about everything
Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ pub struct CliUnstable {
311
311
pub package_features : bool ,
312
312
pub advanced_env : bool ,
313
313
pub config_profile : bool ,
314
+ pub compile_progress : bool ,
314
315
}
315
316
316
317
impl CliUnstable {
@@ -347,6 +348,7 @@ impl CliUnstable {
347
348
"package-features" => self . package_features = true ,
348
349
"advanced-env" => self . advanced_env = true ,
349
350
"config-profile" => self . config_profile = true ,
351
+ "compile-progress" => self . compile_progress = true ,
350
352
_ => bail ! ( "unknown `-Z` flag specified: {}" , k) ,
351
353
}
352
354
Original file line number Diff line number Diff line change @@ -292,3 +292,19 @@ Example:
292
292
```
293
293
cargo +nightly build --build-plan -Z unstable-options
294
294
```
295
+
296
+ ### Compile progress
297
+ * Tracking Issue: [ rust-lang/cargo #2536 ] ( https://github.com/rust-lang/cargo/issues/2536 )
298
+
299
+ The ` -Z compile-progress ` flag enables a progress bar while compiling.
300
+
301
+ ``` console
302
+ $ cargo +nightly build -Z compile-progress
303
+ Compiling libc v0.2.41
304
+ Compiling void v1.0.2
305
+ Compiling lazy_static v1.0.1
306
+ Compiling regex v1.0.0
307
+ Compiling ucd-util v0.1.1
308
+ Compiling utf8-ranges v1.0.0
309
+ Building [=======> ] 2/14: libc, regex, uc...
310
+ ```
You can’t perform that action at this time.
0 commit comments