unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Marius Bakke <marius@gnu.org>
Cc: 57717@debbugs.gnu.org
Subject: [bug#57717] [DRAFT PATCH core-updates] build-systems: Pass #:allowed-references and #:disallowed-references to builders.
Date: Sun, 11 Sep 2022 16:12:44 +0200	[thread overview]
Message-ID: <87bkrmyp7n.fsf@gnu.org> (raw)
In-Reply-To: <20220910152604.3459-1-marius@gnu.org> (Marius Bakke's message of "Sat, 10 Sep 2022 17:26:04 +0200")

Hi,

Marius Bakke <marius@gnu.org> skribis:

> * guix/build-system/gnu.scm (gnu-build, gnu-cross-build)[builder]: Pass
> along #:allowed-references and #:disallowed-references.
> * guix/build-system/meson.scm (meson-build, meson-cross-build)[builder]: Likewise.
> ---
> Hello Guix,
>
> This is an untested patch that makes #:allowed-references
> and #:disallowed-references available to build-side code.
>
> The intention is to make it easier to use these properties directly when
> e.g. wrapping.  Consider the following:
>
> (arguments
>  (list
>   #:disallowed-references (list (gexp-input glib "bin")
>                                 (gexp-input inkscape/stable))
>   #:phases
>   #~(modify-phases %standard-phases
>      (replace 'glib-or-gtk-wrap
>        (let ((wrap (assoc-ref %standard-phases 'glib-or-gtk-wrap)))
>          (lambda* (#:key inputs outputs disallowed-references
>                    #:allow-other-keys)
>                  (wrap #:inputs (filter (match-lambda
>                                           ((label . output)
>                                            (not (member output
>                                                         disallowed-references))))
>                                         inputs)
>                        #:outputs outputs)))))))
>
>
> This way we don't have to build the list of disallowed references twice,
> which is difficult without labels in the case of e.g. `(,glib "bin").

Why not.

The only possible drawback I can think of is that it could hide errors:
since things listed in #:disallowed-references are automatically removed
from wrappers, you could end up successfully building a wrapper that
lacks items without noticing.  But yeah, maybe that’s a questionable
scenario.

> +                           #:allowed-references #$allowed-references
> +                           #:disallowed-references #$disallowed-references

Maxime raised a good point on this one, but I think you can write:

  #:disallowed-references '#$disallowed-references

This will work whether ‘disallowed-references’ is #f or a list.

Thanks!

Ludo’.




      parent reply	other threads:[~2022-09-11 14:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-10 15:26 [bug#57717] [DRAFT PATCH core-updates] build-systems: Pass #:allowed-references and #:disallowed-references to builders Marius Bakke
2022-09-10 16:27 ` Maxime Devos
2022-09-10 16:32 ` Maxime Devos
2022-09-10 16:34   ` Maxime Devos
2022-09-11 14:12 ` Ludovic Courtès [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=87bkrmyp7n.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=57717@debbugs.gnu.org \
    --cc=marius@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).