unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>, 57704@debbugs.gnu.org
Subject: [bug#57704] [PATCH v3] guix: Filter unspecified inputs when sanitizing.
Date: Sat, 10 Sep 2022 12:19:32 +0200	[thread overview]
Message-ID: <d3341dcd-fee3-204d-7949-6df5333bc5ea@telenet.be> (raw)
In-Reply-To: <1b98ce69769d0366503c7fb7f956da7fa9ec5132.camel@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2185 bytes --]

> Am Samstag, dem 10.09.2022 um 02:33 +0200 schrieb Maxime Devos:
>> The docstring is nice, but with documentation, I meant the manual, 
>> presumably in ‘(guix)package Reference’, maybe also in the packaging 
>> tutorial in the cookbook.
> I don't see the current practice documented, so I think we're actually
> good on this front.

That sounds bad to me -- the undocumented surface should be decreased, 
not increased.  Also, it is actually documented a little:

      ‘inputs’ (default: ‘'()’)
      ‘native-inputs’ (default: ‘'()’)
      ‘propagated-inputs’ (default: ‘'()’)
           These fields list dependencies of the package.  Each element
           of these lists is either a package, origin, or other
           “file-like object” (*note G-Expressions::); [...]

#false (or, in this case, *unspecified*) is neither a package, origin or 
other file-like object.  Maybe you can add that #false is also allowed 
but ignored?

On 10-09-2022 09:41, Liliana Marie Prikler wrote:
>            inputs)
> -        (else (map add-input-label inputs))))
> +        (else (filter-map (lambda (input)
> +                            (if (unspecified? input) #f
> +                                (add-input-label input)))
> +                          inputs))))

(when cond ...) / (unless cond ...) returning *unspecified* when (not 
cond)/cond is an implementation detail:

   * The return values(s) when (not cond)/cond is not documented in
     (guile)Conditionals
   * maybe: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56799#17

     There is an interest in letting it return zero values instead of
     *unspecified*, see e.g. 
https://scheme-reports.scheme-reports.narkive.com/QSQtJSAh/unspecified-values
     and a ‘bug’ on bugs.gnu.org I cannot find anymore about actually
     doing this change.

     By assuming that when/unless returns *unspecified* here, an
     additional backwards-compatibility concern is introduced.

As such, I don't think relying on this to be a good idea.

Alternative proposal: instead of (when cond package), maybe
(and cond package)?

Greetings,
Maxime

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2022-09-10 10:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 15:56 [bug#57704] [PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing Liliana Marie Prikler
2022-09-09 15:56 ` [bug#57704] [PATCH v2] " Liliana Marie Prikler
2022-09-10  0:33   ` Maxime Devos
2022-09-10  6:40     ` Liliana Marie Prikler
2022-09-10  7:44       ` Liliana Marie Prikler
2022-09-09 18:54 ` [bug#57704] [PATCH core-updates] " Maxime Devos
2022-09-10  7:41 ` [bug#57704] [PATCH v3] guix: Filter unspecified " Liliana Marie Prikler
2022-09-10 10:19   ` Maxime Devos [this message]
2022-09-26 20:51 ` [bug#57704] [PATCH core-updates] guix: packages: Remove #f from " Ludovic Courtès
2024-01-20 20:43   ` Maxim Cournoyer

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=d3341dcd-fee3-204d-7949-6df5333bc5ea@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=57704@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /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).