Subject: [PATCH 1/2] scripts: build: Canonicalize 'load-path' option.

From: zimoun <[email-masked]>
Date: Mon, 27 Jul 2020 23:47:53 +0200

Fixes <https://bugs.gnu.org/42543>.
Reported by Jack Hill <[email-masked]>.

* guix/scripts/build.scm (%standard-build-options): Canonicalize 'load-path'.
---
 guix/scripts/build.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 8ff2fd1910..f41221dd43 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2013 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Ricardo Wurmus <[email-masked]>
+;;; Copyright © 2020 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -568,10 +569,11 @@ talking to a remote daemon\n")))
   (list (option '(#\L "load-path") #t #f
                 (lambda (opt name arg result . rest)
                   ;; XXX: Imperatively modify the search paths.
-                  (%package-module-path (cons arg (%package-module-path)))
-                  (%patch-path (cons arg (%patch-path)))
-                  (set! %load-path (cons arg %load-path))
-                  (set! %load-compiled-path (cons arg %load-compiled-path))
+                  (let ((path (canonicalize-path arg)))
+                    (%package-module-path (cons path (%package-module-path)))
+                    (%patch-path (cons path (%patch-path)))
+                    (set! %load-path (cons path %load-path))
+                    (set! %load-compiled-path (cons path %load-compiled-path)))
 
                   (apply values (cons result rest))))
         (option '(#\K "keep-failed") #f #f

base-commit: 7b58d009a952e0c36446a0a5d06582f1e9822bb6
-- 
2.26.2