Skip to content

Commit e7fb246

Browse files
committed
Stabilize -Zcompile-progress.
Closes #2536.
1 parent b0679d5 commit e7fb246

File tree

5 files changed

+4
-41
lines changed

5 files changed

+4
-41
lines changed

src/bin/cargo/cli.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Available unstable (nightly-only) flags:
3434
-Z offline -- Offline mode that does not perform network requests
3535
-Z unstable-options -- Allow the usage of unstable options such as --registry
3636
-Z config-profile -- Read profiles from .cargo/config files
37-
-Z compile-progress -- Display a progress bar while compiling
3837
3938
Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
4039
);

src/cargo/core/compiler/job_queue.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ impl<'a> JobQueue<'a> {
237237
// currently a pretty big task. This is issue #5695.
238238
let mut error = None;
239239
let mut progress = Progress::with_style("Building", ProgressStyle::Ratio, cx.bcx.config);
240-
if !cx.bcx.config.cli_unstable().compile_progress {
241-
progress.disable();
242-
}
243240
let total = self.queue.len();
244241
loop {
245242
// Dequeue as much work as we can, learning about everything

src/cargo/core/compiler/mod.rs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use serde_json;
1010

1111
use core::manifest::TargetSourcePath;
1212
use core::profiles::{Lto, Profile};
13-
use core::shell::ColorChoice;
1413
use core::{PackageId, Target};
1514
use util::errors::{CargoResult, CargoResultExt, Internal};
1615
use util::paths;
@@ -241,8 +240,6 @@ fn rustc<'a, 'cfg>(
241240
.unwrap_or_else(|| cx.bcx.config.cwd())
242241
.to_path_buf();
243242

244-
let should_capture_output = cx.bcx.config.cli_unstable().compile_progress;
245-
246243
return Ok(Work::new(move |state| {
247244
// Only at runtime have we discovered what the extra -L and -l
248245
// arguments are for native libraries, so we process those here. We
@@ -292,12 +289,7 @@ fn rustc<'a, 'cfg>(
292289
} else if build_plan {
293290
state.build_plan(buildkey, rustc.clone(), outputs.clone());
294291
} else {
295-
let exec_result = if should_capture_output {
296-
exec.exec_and_capture_output(rustc, &package_id, &target, mode, state)
297-
} else {
298-
exec.exec(rustc, &package_id, &target, mode)
299-
};
300-
exec_result
292+
exec.exec_and_capture_output(rustc, &package_id, &target, mode, state)
301293
.map_err(Internal::new)
302294
.chain_err(|| format!("Could not compile `{}`.", name))?;
303295
}
@@ -629,8 +621,6 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
629621
let package_id = unit.pkg.package_id().clone();
630622
let target = unit.target.clone();
631623

632-
let should_capture_output = cx.bcx.config.cli_unstable().compile_progress;
633-
634624
Ok(Work::new(move |state| {
635625
if let Some(output) = build_state.outputs.lock().unwrap().get(&key) {
636626
for cfg in output.cfgs.iter() {
@@ -649,10 +639,8 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
649639
&mut |line| json_stderr(line, &package_id, &target),
650640
false,
651641
).map(drop)
652-
} else if should_capture_output {
653-
state.capture_output(&rustdoc, false).map(drop)
654642
} else {
655-
rustdoc.exec()
643+
state.capture_output(&rustdoc, false).map(drop)
656644
};
657645
exec_result.chain_err(|| format!("Could not document `{}`.", name))?;
658646
Ok(())
@@ -709,12 +697,9 @@ fn add_cap_lints(bcx: &BuildContext, unit: &Unit, cmd: &mut ProcessBuilder) {
709697
}
710698

711699
fn add_color(bcx: &BuildContext, cmd: &mut ProcessBuilder) {
712-
let capture_output = bcx.config.cli_unstable().compile_progress;
713700
let shell = bcx.config.shell();
714-
if capture_output || shell.color_choice() != ColorChoice::CargoAuto {
715-
let color = if shell.supports_color() { "always" } else { "never" };
716-
cmd.args(&["--color", color]);
717-
}
701+
let color = if shell.supports_color() { "always" } else { "never" };
702+
cmd.args(&["--color", color]);
718703
}
719704

720705
fn add_error_format(bcx: &BuildContext, cmd: &mut ProcessBuilder) {

src/cargo/core/features.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ pub struct CliUnstable {
318318
pub package_features: bool,
319319
pub advanced_env: bool,
320320
pub config_profile: bool,
321-
pub compile_progress: bool,
322321
}
323322

324323
impl CliUnstable {
@@ -355,7 +354,6 @@ impl CliUnstable {
355354
"package-features" => self.package_features = true,
356355
"advanced-env" => self.advanced_env = true,
357356
"config-profile" => self.config_profile = true,
358-
"compile-progress" => self.compile_progress = true,
359357
_ => bail!("unknown `-Z` flag specified: {}", k),
360358
}
361359

src/doc/src/reference/unstable.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -294,22 +294,6 @@ Example:
294294
cargo +nightly build --build-plan -Z unstable-options
295295
```
296296

297-
### Compile progress
298-
* Tracking Issue: [rust-lang/cargo#2536](https://github.com/rust-lang/cargo/issues/2536)
299-
300-
The `-Z compile-progress` flag enables a progress bar while compiling.
301-
302-
```console
303-
$ cargo +nightly build -Z compile-progress
304-
Compiling libc v0.2.41
305-
Compiling void v1.0.2
306-
Compiling lazy_static v1.0.1
307-
Compiling regex v1.0.0
308-
Compiling ucd-util v0.1.1
309-
Compiling utf8-ranges v1.0.0
310-
Building [=======> ] 2/14: libc, regex, uc...
311-
```
312-
313297
### default-run
314298
* Original issue: [#2200](https://github.com/rust-lang/cargo/issues/2200)
315299

0 commit comments

Comments
 (0)