GNU bug report logs - #74582
[PATCH python-team 0/4] Fix edge case in pyproject-build-system

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 28 Nov 2024 08:06:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 74582 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH python-team 1/4] build/pyproject: Really merge directories in
 install phase.
Date: Thu, 28 Nov 2024 21:16:39 +0900
Using rename-file, the destination had to be empty otherwise it would error
out.  By using copy-recursively, a directory can be copied onto a pre-existing
directory, really merging them.  This problem manifested itself attempting to
build the python-pyre package.

* guix/build/pyproject-build-system.scm (install)
<merge-directories>: Use copy-recursively instead of rename-file.

Change-Id: Iceb8609a86f29b17e5fbe6a9629339d0bc26e11f
---
 guix/build/pyproject-build-system.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm
index c69ccc9d64..03992d915f 100644
--- a/guix/build/pyproject-build-system.scm
+++ b/guix/build/pyproject-build-system.scm
@@ -194,8 +194,13 @@ (define* (install #:key inputs outputs #:allow-other-keys)
                   (format #t "~a/~a -> ~a/~a~%"
                           source file destination file)
                   (mkdir-p destination)
-                  (rename-file (string-append source "/" file)
-                               (string-append destination "/" file))
+                  ;; Use 'copy-recursively' rather than 'rename-file' to guard
+                  ;; against the odd case where DESTINATION is a non-empty
+                  ;; directory, which may happen when using hybrid Python
+                  ;; build systems.
+                  (copy-recursively (string-append source "/" file)
+                                    (string-append destination "/" file))
+                  (delete-file-recursively (string-append source "/" file))
                   (when post-move
                     (post-move file)))
                 (scandir source
-- 
2.46.0





This bug report was last modified 40 days ago.

Previous Next


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