Subject: Re: bug#55360: [Installer] ‘guix systeminit’ displays dots instead of progress bars

From: Ludovic Courtès <[email-masked]>
Date: Mon, 18 Jul 2022 21:58:50 +0200

Hi!

Ludovic Courtès <[email-masked]> skribis:

> During installation, ‘guix system init’ displays dots instead of
> progress bars for downloads and such.
>
> This suggests that ‘display-download-progress’ gets #:tty? #f.  This may
> be a side effect of running it in a pipe in
> ‘run-external-command-with-handler’.

This was introduced by:

  commit 0b9fbbb4dd24f227c9a708561ba291f6169ad2e6
  Date:   Sat Jan 15 14:50:00 2022 +0100

      installer: Capture external commands output.

      * gnu/installer/utils.scm (run-external-command-with-handler,
      run-external-command-with-line-hooks): New variables.
      (run-command): Use run-external-command-with-line-hooks.

According to <https://issues.guix.gnu.org/53063#0-lineno9>, the goal was
(unsurprisingly) to log standard output of commands.

I’m not sure it’s a good idea for ‘guix system init’: we’d be logging
mostly progress bars, package names, and the likes to syslog—not super
useful.  So I’d suggest not capturing stdout of ‘guix system init’.

However, I wouldn’t mind factorizing the syslog facilities from
2cf65e1d543407bc7db43e7c7d39a215907efebc into, say, (guix syslog), and
have (guix scripts system) use it to log important events.

Thoughts?

What about using ‘run-external-command-with-line-hooks’ for other
commands though?  IIUC, the primary use case is file system tools.

My gut feeling is that the cost/benefit ratio isn’t worth it (the cost
here is complexity and maintenance burden of
‘run-external-command-with-handler’ & co.; the benefit is improved
logging).

WDYT?

I can hopefully dedicate a bit of time to this, but I need your
guidance, comrades.  :-)

Ludo’.