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 #29 received at 71941 <at> debbugs.gnu.org (full text, mbox):

From: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
To: 71941 <at> debbugs.gnu.org
Cc: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
Subject: [PATCH v4 1/3] guix: fix: 'map-derivation' not handling directories
Date: Sat,  1 Mar 2025 19:06:08 +0100
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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index ffa69e924c..d84d1a391c 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2021, 2023-2024 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016, 2017 Mathieu Lirzin <mthl <at> gnu.org>
+;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1074,8 +1075,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)))))
                                 (derivation-sources drv)))
 
              ;; Now augment the lists of initials and replacements.

base-commit: 256bee7d0b72df2d471e1db071500e7635462ad7
-- 
2.48.1





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.