[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extract tools from guix scripts
From: |
Ludovic Courtès |
Subject: |
Re: extract tools from guix scripts |
Date: |
Sat, 10 Mar 2018 00:32:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Ricardo Wurmus <address@hidden> skribis:
> under “guix/scripts” there are a couple of tools that are really useful,
> such as “guix challenge”. While they are great for the command line,
> I’d really like to use them from within Guile.
>
> Using “(guix-challenge)” directly is cumbersome, because I need to
> provide an argument list “args”, which is then parsed internally.
> Instead, I’d like to be able to say
>
> (challenge #:urls (list "a" "b")
> #:packages (list foo bar baz))
>
> and have it produce some report values. Then “guix-challenge” could be
> implemented in terms of “challenge”.
I think ‘compare-contents’ in (guix scripts challenge) is close to what
you want, no? See tests/challenge.scm for example usage.
The short-lived reproducibility.html generator also used it:
http://git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website/www/packages.scm?id=ae2d0209cc44e25a45cab0abcc9d85172fd48dca#n545
> The same might be useful for “guix-build” or “guix-environment”.
I agree with this sentiment!
Then it’s a matter of defining an appropriate API. For instance, all
‘guix-build’ does is UI stuff around (guix store) and (guix packages).
There’s a higher-level ‘build-package’ procedure in (guix scripts).
IMO a good interface can’t just be a Schemey variant of the CLI, because
often the CLI papers over a number of details that a good API should
expose.
Ludo’.