unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Leo Famulari <leo@famulari.name>, Guix Devel <guix-devel@gnu.org>
Subject: Re: Adding plumbing subcommand 'derivation'?
Date: Mon, 22 Apr 2024 02:11:43 +0200	[thread overview]
Message-ID: <87o7a26ytc.fsf@gmail.com> (raw)
In-Reply-To: <878r19h2lw.fsf@gnu.org>

Hi,

On ven., 19 avril 2024 at 16:02, Ludovic Courtès <ludo@gnu.org> wrote:

> We should see how that fits into the set of tools we already have, in
> particular the (guix derivations) interface and the REPL meta-commands.
>
> My gut feeling, with a Schemer bias, is that we’d rather enrich the
> Scheme API and/or REPL than add more commands (this is not Nix :-)).
>
> But I don’t know, maybe we can have both?

Yes, I think that’s orthogonal and a good idea.

Maybe a new plumbing generic subcommand, as “guix inspect” or “guix
store”, where showing the fields of a derivation would be a
sub-subcommand.  For instance, diffing two derivations from the
command-line seems helpful when  debugging – I often do that with Emacs
exploiting buffer facilities. :-)

In addition, it could be helpful to improve the readability for the
pretty-printer.  Other said, somehow redesign this:

--8<---------------cut here---------------start------------->8---
(set-record-type-printer! <derivation>
                          (lambda (drv port)
                            (format port "#<derivation ~a => ~a ~a>"
                                    (derivation-file-name drv)
                                    (string-join
                                     (map (match-lambda
                                           ((_ . output)
                                            (derivation-output-path output)))
                                          (derivation-outputs drv)))
                                    (number->string (object-address drv) 16))))
--8<---------------cut here---------------end--------------->8---

It looks like a plan. ;-)

Cheers,
simon


      reply	other threads:[~2024-04-22 13:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 18:28 Guix extension to display derivation (and rewrite fixed-output) Simon Tournier
2024-04-13  0:04 ` Leo Famulari
2024-04-13 10:32   ` Adding plumbing subcommand 'derivation'? Simon Tournier
2024-04-15 18:54     ` Leo Famulari
2024-04-18  8:40     ` Ricardo Wurmus
2024-04-18 12:57       ` Christina O'Donnell
2024-04-18 13:28         ` Christina O'Donnell
2024-04-19 14:02     ` Ludovic Courtès
2024-04-22  0:11       ` Simon Tournier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7a26ytc.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).