guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: guix build: Fix relative file name canonicalization for '--root'.


From: guix-commits
Subject: 01/03: guix build: Fix relative file name canonicalization for '--root'.
Date: Mon, 15 Apr 2019 12:06:20 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 4aea820f0954fce4d076718072faf211f62f3f9d
Author: Ludovic Court├Ęs <address@hidden>
Date:   Mon Apr 15 16:57:12 2019 +0200

    guix build: Fix relative file name canonicalization for '--root'.
    
    Fixes <https://bugs.gnu.org/35271>.
    Reported by rendaw <address@hidden>.
    
    * guix/scripts/build.scm (register-root): When ROOT is a relative file
    name, append the basename of ROOT, not ROOT itself.
    * tests/guix-build.sh: Add test.
---
 guix/scripts/build.scm | 2 +-
 tests/guix-build.sh    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 2886443..fc0c0e2 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -119,7 +119,7 @@ found.  Return #f if no build log was found."
   (let* ((root (if (string-prefix? "/" root)
                    root
                    (string-append (canonicalize-path (dirname root))
-                                  "/" root))))
+                                  "/" (basename root)))))
     (catch 'system-error
       (lambda ()
         (match paths
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 66bf6be..d479296 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -183,6 +183,13 @@ then false; else true; fi
 
 rm -f "$result"
 
+# Check relative file name canonicalization: <https://bugs.gnu.org/35271>.
+mkdir "$result"
+guix build -r "$result/x" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
+test -x "$result/x/bin/guile"
+rm "$result/x"
+rmdir "$result"
+
 # Cross building.
 guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]