guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A capture-stdout wrapper procedure in (guix build utils)?


From: Felix Lechner
Subject: Re: A capture-stdout wrapper procedure in (guix build utils)?
Date: Sun, 21 Apr 2024 08:35:04 -0700

Hi Fabio,

On Sat, Apr 20 2024, Fabio Natali wrote:

> do you think it might be worth to add it (or a variation thereof) to
> '(guix build utils)'?

I use this [1] which gives the caller access to the exit status and is
also slightly shorter:

    (define (command-with-output-to-string/status* command)
      (let* ((input-pipe (apply open-pipe* OPEN_READ command))
         (output (get-string-all input-pipe))
         (exit-val (status:exit-val (close-pipe input-pipe))))
        (values output exit-val)))

It may be better, however, to finally fix Guile's 'system' and 'system*'
to work with 'with-output-to-string'. [2]

Kind regards
Felix

[1] 
https://codeberg.org/lechner/preambled-exec/src/commit/c5c498c3890f22cda070fe35b314f01982ebc885/test/simple-variable.scm#L28-L32
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43364



reply via email to

[Prev in Thread] Current Thread [Next in Thread]