Skip to content

Commit 536ce93

Browse files
committed
Auto merge of #8054 - jclulow:unix-progress, r=alexcrichton
enable progress bar on all UNIX platforms The progress bar rendered at the base of ongoing output from Cargo is presently only drawn on a subset of UNIX platforms: FreeBSD, Linux, and Mac OS. The functionality required is basic, and essentially universally available: `ioctl()`, `TIOCGWINSZ`, and `STDERR_FILENO`. When your platform is not in this list, the difference in behaviour is subtle and the exact mechanism is difficult to locate. It would be better to fail to build on new ports until these definitions become available in the libc crate for those platforms.
2 parents 5ba0ecc + 53094e3 commit 536ce93

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/cargo/core/shell.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl ColorChoice {
379379
}
380380
}
381381

382-
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))]
382+
#[cfg(unix)]
383383
mod imp {
384384
use super::Shell;
385385
use std::mem;
@@ -408,18 +408,6 @@ mod imp {
408408
}
409409
}
410410

411-
#[cfg(all(
412-
unix,
413-
not(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))
414-
))]
415-
mod imp {
416-
pub(super) use super::default_err_erase_line as err_erase_line;
417-
418-
pub fn stderr_width() -> Option<usize> {
419-
None
420-
}
421-
}
422-
423411
#[cfg(windows)]
424412
mod imp {
425413
use std::{cmp, mem, ptr};
@@ -476,13 +464,7 @@ mod imp {
476464
}
477465
}
478466

479-
#[cfg(any(
480-
all(
481-
unix,
482-
not(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))
483-
),
484-
windows,
485-
))]
467+
#[cfg(windows)]
486468
fn default_err_erase_line(shell: &mut Shell) {
487469
if let Some(max_width) = imp::stderr_width() {
488470
let blank = " ".repeat(max_width);

0 commit comments

Comments
 (0)