guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit b1df38994d89cbbc7b7b5e0174b072f5a441ee97
Author: Maxim Cournoyer <maxim.courno...@gmail.com>
AuthorDate: Thu Nov 28 21:16:39 2024 +0900

    build/pyproject: Really merge directories in install phase.
    
    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.
    
    Solving #596.
    
    * guix/build/pyproject-build-system.scm (install)
    <merge-directories>: Use copy-recursively instead of rename-file.
    
    Change-Id: Iceb8609a86f29b17e5fbe6a9629339d0bc26e11f
    Signed-off-by: Sharlatan Hellseher <sharlata...@gmail.com>
---
 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 947d240114..4ad3a0d701 100644
--- a/guix/build/pyproject-build-system.scm
+++ b/guix/build/pyproject-build-system.scm
@@ -201,8 +201,13 @@ builder.build_wheel(sys.argv[3], 
config_settings=config_settings)"
                   (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

Reply via email to