NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.06k stars 1.47k forks source link

Problem with "nix build" line wrapping #1780

Open jwiegley opened 6 years ago

jwiegley commented 6 years ago

I like the new status display while "nix build" runs, but it seems to want to print everything on tremendously long lines: > 200 characters. And when the terminal isn't that wide, it causes the line to repeat, so that I end up with displays like:

[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapping './bin/xdvi' and patching shebang '/nix/store/hiv85an0qyzj6ps88f5pvkbbdj8238nj-bash-4.4-p12/bin/[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building texlive-combined-2017: Wrapp[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
building brotli-1.0.2 on ssh://johnw@[3/3/20 built, 19/20 copied (88.1/117.6 MiB), 1.0/11.2 MiB DL]
error: interrupted by the user

(I've added returns here so you can get a feel for what I'm seeing).

It would be nice if it used two or more lines to show updating status: one for statistics, one for current package, one for current phase, one for current activity, etc.

edolstra commented 6 years ago

Actually it queries the terminal size and truncates lines to that size. But it might be getting something wrong (in particular ANSI escape handling have bugs).

jwiegley commented 6 years ago

@edolstra For now I have a workaround: tput rmam, which disables line-wrapping in iTerm2.

It would still be nice if, instead of truncation, we could see individual status lines from each of the parallel builds, sort of like how httrack displays its progress when in curses mode.

vcunat commented 6 years ago

The lines from the builds show for me, but it's all done to fit within a single line, so it's not much use for multiple parallel builds...

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info