summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-15 16:57:12 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-15 16:57:12 +0200
commit4aea820f0954fce4d076718072faf211f62f3f9d (patch)
treee1f6952bfe18778da074657a6745093e06c8d07f
parentcbd059d1017bc22723f1e5293cc8f20dea640fff (diff)
guix build: Fix relative file name canonicalization for '--root'.
Fixes <https://bugs.gnu.org/35271>. Reported by rendaw <7e9wc56emjakcm@s.rendaw.me>. * 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.
-rw-r--r--guix/scripts/build.scm2
-rw-r--r--tests/guix-build.sh7
2 files changed, 8 insertions, 1 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 28864435df9..fc0c0e2ad36 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -119,7 +119,7 @@ found. Return #f if no build log was found."
119 (let* ((root (if (string-prefix? "/" root) 119 (let* ((root (if (string-prefix? "/" root)
120 root 120 root
121 (string-append (canonicalize-path (dirname root)) 121 (string-append (canonicalize-path (dirname root))
122 "/" root)))) 122 "/" (basename root)))))
123 (catch 'system-error 123 (catch 'system-error
124 (lambda () 124 (lambda ()
125 (match paths 125 (match paths
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 66bf6be8d0c..d479296ef1e 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -183,6 +183,13 @@ then false; else true; fi
183 183
184rm -f "$result" 184rm -f "$result"
185 185
186# Check relative file name canonicalization: <https://bugs.gnu.org/35271>.
187mkdir "$result"
188guix build -r "$result/x" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
189test -x "$result/x/bin/guile"
190rm "$result/x"
191rmdir "$result"
192
186# Cross building. 193# Cross building.
187guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes 194guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
188 195