all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Why is "append" the activation service's "compose" procedure?
Date: Thu, 29 Mar 2018 09:32:19 +0200	[thread overview]
Message-ID: <878tabs5fg.fsf@gmail.com> (raw)
In-Reply-To: <87zi2vdm6r.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 26 Mar 2018 15:02:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 2494 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Chris Marusich <cmmarusich@gmail.com> skribis:
>
>> The fold-services procedure always applies the "compose" procedure to a
>> single list.  So why does the activation-service-type use the append
>> procedure as its "compose" procedure?  Wouldn't it more accurately
>> reflect our intent if we used the identity procedure instead?
>
> Yes, you’re right here as well.  :-)
>
> ‘boot-service-type’ has the same problem.
>
> Can you fix both?

I've done this in commit 7874e9e047219cce5ae339e57cd76f158bc19f63.

By the way, I noticed that the cups-service-type also uses "append" as
its "compose" procedure.  I think this is suspicious.  The comment in
the code says:

    ;; Extensions consist of lists of packages (representing CUPS
    ;; drivers, etc) that we just concatenate.
    (compose append)

However, that doesn't seem to be what's going on in the "extend"
procedure that follows it:

    ;; Add extension packages by augmenting the cups-configuration
    ;; 'extensions' field.
    (extend
     (lambda (config extensions)
       (cond
        ((cups-configuration? config)
         (cups-configuration
          (inherit config)
          (extensions
           (append (cups-configuration-extensions config)
                   extensions))))
        (else
         (opaque-cups-configuration
          (inherit config)
          (extensions
           (append (opaque-cups-configuration-extensions config)
                   extensions)))))))

Since there are no examples of extensions of the cups-service-type in
the Guix source tree, I'm not really sure what the intended behavior is.
If the "compute" procedure of any <service-extension> object that
extends the cups-service-type is intended to return a single package,
then my guess is that the "compose" procedure above should really be
identity, not append, in order to more accurately reveal the intent.
However, if the "compute" procedure is intended to return a list of
packages, then my guess is that the cups-service-type may not be
functioning as intended, and to fix it we will need to change the
"compose" procedure to concatenate.

Can someone who is familiar with the cups-service-type clarify what the
"compute" procedure of an extension of the cups-service-type is actually
supposed to return?  I've CC'd Andy, who originally added the
cups-service-type, in the hope that he might respond.

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-03-29  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 10:17 Why is "append" the activation service's "compose" procedure? Chris Marusich
2018-03-26 13:02 ` Ludovic Courtès
2018-03-29  7:32   ` Chris Marusich [this message]
2018-03-29 11:25     ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=878tabs5fg.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.