GNU bug report logs - #71941
Broken `map-derivation' procedure

Previous Next

Package: guix;

Reported by: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>

Date: Thu, 4 Jul 2024 15:06:02 UTC

Severity: normal

Full log


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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, 71941 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>,
 Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>
Subject: Re: bug#71941: Broken `map-derivation' procedure
Date: Tue, 25 Feb 2025 18:23:12 +0100
Hi Sergio,

Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com> skribis:

> The `map-derivation` procedure was trying to process directories as files.
> When a derivation had a 'module import' directory as input, it threw an
> exception since it tried to open it as a file.
>
> Change-Id: I9b766f9aaa03ea9307f73e8abb36bc347af4b5e6
> ---
>  guix/derivations.scm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/guix/derivations.scm b/guix/derivations.scm
> index bef98cd26a..9c019a35bb 100644
> --- a/guix/derivations.scm
> +++ b/guix/derivations.scm
> @@ -1074,8 +1074,10 @@ (define* (map-derivation store drv mapping
>                                      ((_ . replacement)
>                                       replacement)
>                                      (#f
> -                                     (substitute-file source
> -                                                      initial replacements))))
> +                                     (if (file-is-directory? source)
> +                                         source
> +                                         (substitute-file source
> +                                                          initial replacements)))))

Could you add a unit test for this specific case?

Bonus points if you come up with a commit log that follows our
conventions.  :-)  (I can do it on your behalf if you’re not sure.)

Thanks,
Ludo’.




This bug report was last modified 110 days ago.

Previous Next


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