GNU bug report logs - #46031
services: cuirass: Add "simple-cuirass-services".

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <othacehe <at> gnu.org>

Date: Fri, 22 Jan 2021 08:52:02 UTC

Severity: normal

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 46031 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 46031 <at> debbugs.gnu.org
Subject: Re: bug#46031: services: cuirass: Add "simple-cuirass-services".
Date: Sat, 20 Feb 2021 11:59:38 +0100
Hi,

Mathieu Othacehe <othacehe <at> 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’.




This bug report was last modified 4 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.