Subject: [PATCH v4 14/14] DRAFT gexp: No symlinks for ‘imported-files/derivation’.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 28 Feb 2025 15:29:33 +0100

DRAFT: Wait for <https://issues.guix.gnu.org/76376>.

* guix/gexp.scm (imported-files/derivation): Pass #:recursive? #f to
‘interned-file’ and call ‘readlink*’ on ‘file-name’.

Change-Id: Idc5b59cd8f0c1217e84c7cbfba64d97d5999429f
---
 guix/gexp.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index ad51bc55b78..ddd2e1a0812 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1584,8 +1584,9 @@ (define* (imported-files/derivation files
   (define file-pair
     (match-lambda
      ((final-path . (? string? file-name))
-      (mlet %store-monad ((file (interned-file file-name
-                                               (basename final-path))))
+      (mlet %store-monad ((file (interned-file (readlink* file-name)
+                                               (basename final-path)
+                                               #:recursive? #f)))
         (return (list final-path file))))
      ((final-path . file-like)
       (mlet %store-monad ((file (lower-object file-like system)))
-- 
2.48.1