unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 46031@debbugs.gnu.org
Subject: [bug#46031] services: cuirass: Add "simple-cuirass-services".
Date: Sat, 20 Feb 2021 11:59:38 +0100	[thread overview]
Message-ID: <874ki7j97p.fsf@gnu.org> (raw)
In-Reply-To: <87czxxz767.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 22 Jan 2021 09:50:56 +0100")

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> Here is a service that provides some syntactic sugar over the (complex)
> Cuirass configuration.  It uses Guix Channels to declare Cuirass inputs.
>
> In the future, it would be nice if Cuirass could operate directly on
> Channels. For now, this service only act as a translation layer for
> people willing to setup a simple Cuirass instance.

I had overlooked these patches; that’s really nice!

> +@lisp
> +(simple-cuirass-services
> + (simple-cuirass-configuration
> +  (build (list
> +          (build-manifest
> +           (channel-name 'conf)
> +           (manifest "guix/manifest.scm"))))
> +  (channels (cons* (channel
> +                    (name 'my-guix)
> +                    (url "https://my-git-repo/guix.git"))
> +                   (channel
> +                    (name 'conf)
> +                    (url "https://my-git-repo/conf.git"))
> +                   %default-channels))
> +  (non-package-channels '(conf))))
> +@end lisp

I wonder if it would make sense to allow users to pass directly a
manifest, as in (pseudo syntax):

  (simple-cuirass-configuration
    (build (list (build-manifest … (local-file "my-manifest.scm"))))
    (channels …))

It’d be less expressive (you’d have to reconfigure when you change the
manifest), but perhaps easier to set up.  WDYT?

> +  (define (config->spec config)
> +    (match-record config <simple-cuirass-configuration>
> +      (build channels non-package-channels systems)
> +      `((#:name . "simple-config")
> +        (#:load-path-inputs . ("guix"))
> +        (#:package-path-inputs . ,(package-path channels
> +                                                non-package-channels))
> +        (#:proc-input . "guix")
> +        (#:proc-file . "build-aux/cuirass/gnu-system.scm")
> +        (#:proc . cuirass-jobs)
> +        (#:proc-args . ((systems . ,systems)
> +                        ,@(if (eq? build 'all)
> +                              '()
> +                              `((subset . "manifests")
> +                                (manifests . ,(format-manifests build))))))
> +        (#:inputs  . ,(map channel->input channels))
> +        (#:build-outputs . ())
> +        (#:priority . 1))))
> +
> +  (list
> +   (service cuirass-service-type
> +            (cuirass-configuration
> +             (inherit cuirass)
> +             (specifications #~(list
> +                                '#$(config->spec config)))))

What about exposing ‘simple-cuirass-configuration->specs’, and document
it such that one can do:

  (service cuirass-service-type
           (cuirass-configuration
             (specifications
              (simple-cuirass-configuration->specs config))))

or even:

  (service cuirass-service-type
           (compile-simple-cuirass-configuration config))

?

That way, the relationship between “simple” and “not simple” would be
clearer.

Thanks,
Ludo’.




  parent reply	other threads:[~2021-02-20 11:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  8:50 [bug#46031] services: cuirass: Add "simple-cuirass-services" Mathieu Othacehe
2021-01-22 16:37 ` Jonathan Brielmaier
2021-01-22 17:55   ` Mathieu Othacehe
2021-01-24 13:47     ` Jonathan Brielmaier
2021-01-29 11:39       ` Mathieu Othacehe
2021-02-02 22:43         ` Jonathan Brielmaier
2021-02-19 19:16           ` bug#46031: " Mathieu Othacehe
2021-02-19 21:35             ` [bug#46031] " Jonathan Brielmaier
2021-02-22  8:53               ` Mathieu Othacehe
2021-02-20 10:59 ` Ludovic Courtès [this message]
2021-02-22  8:50   ` Mathieu Othacehe
2021-02-22 12:59     ` Ludovic Courtès
2021-02-23  8:48       ` Mathieu Othacehe
2021-02-23  9:29         ` Ludovic Courtès
2021-02-23 13:30           ` Mathieu Othacehe
2021-02-23 17:42             ` 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

  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=874ki7j97p.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=46031@debbugs.gnu.org \
    --cc=othacehe@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).