Skip to content

Commit cc11d50

Browse files
committed
Auto merge of #5698 - alexcrichton:no-progress-sad, r=kennytm
Disable progress bar for build in Cargo This is primarily blocked on #5695 which unfortunately doesn't have a great fix today, so disable it for now while we try to work out a better solution. Closes #5695 Closes #5697
2 parents b02cd42 + 0102387 commit cc11d50

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/cargo/core/compiler/job_queue.rs

+14
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,22 @@ impl<'a> JobQueue<'a> {
180180
// After a job has finished we update our internal state if it was
181181
// successful and otherwise wait for pending work to finish if it failed
182182
// and then immediately return.
183+
//
184+
// TODO: the progress bar should be re-enabled but unfortunately it's
185+
// difficult to do so right now due to how compiler error messages
186+
// work. Cargo doesn't redirect stdout/stderr of compiler
187+
// processes so errors are not captured, and Cargo doesn't know
188+
// when an error is being printed, meaning that a progress bar
189+
// will get jumbled up in the output! To reenable this progress
190+
// bar we'll need to probably capture the stderr of rustc and
191+
// capture compiler error messages, but that also means
192+
// reproducing rustc's styling of error messages which is
193+
// currently a pretty big task. This is issue #5695. Note that
194+
// when reenabling it'd also probably be good to fix #5697 while
195+
// we're at it.
183196
let mut error = None;
184197
let mut progress = Progress::with_style("Building", ProgressStyle::Ratio, cx.bcx.config);
198+
progress.disable();
185199
let total = self.queue.len();
186200
loop {
187201
// Dequeue as much work as we can, learning about everything

src/cargo/util/progress.rs

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ impl<'cfg> Progress<'cfg> {
5858
}
5959
}
6060

61+
pub fn disable(&mut self) {
62+
self.state = None;
63+
}
64+
6165
pub fn new(name: &str, cfg: &'cfg Config) -> Progress<'cfg> {
6266
Self::with_style(name, ProgressStyle::Percentage, cfg)
6367
}

0 commit comments

Comments
 (0)