GNU bug report logs - #43064
[PATCH] gexp: computed-file: Prevent mistakenly overriding default option values.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 27 Aug 2020 05:15:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 43064 <at> debbugs.gnu.org
Subject: [bug#43064] [PATCH v2] gexp: computed-file: Prevent mistakenly overriding default option values.
Date: Mon, 31 Aug 2020 15:34:46 +0200
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> In order to do so, default to an empty options list, and expose options whose
> default values are sensitive directly as keyword arguments.
>
> * guix/gexp.scm (computed-file): Extract the LOCAL-BUILD? parameter from the
> OPTIONS parameter to make it a stand-alone keyword argument.  Introduce an
> OPTIONS* binding which is obtained by combining the LOCAL-BUILD? keyword and
> its value with OPTIONS.
>
> Suggested-by: Ludovic Courtès <ludo <at> gnu.org>

[...]

>  (define* (computed-file name gexp
> -                        #:key guile (options '(#:local-build? #t)))
> +                        #:key guile (local-build? #t) (options '()))
>    "Return an object representing the store item NAME, a file or directory
> -computed by GEXP.  OPTIONS is a list of additional arguments to pass
> -to 'gexp->derivation'.
> +computed by GEXP.  When LOCAL-BUILD? is #t (the default), it ensures the
> +corresponding derivation is built locally.  OPTIONS may be used to pass
> +additional arguments to 'gexp->derivation'.
>  
>  This is the declarative counterpart of 'gexp->derivation'."

Please update doc/guix.texi as well.

Otherwise LGTM, thanks!

Ludo’.




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

Previous Next


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