hydra: Make sure we add an absolute file name to the load path.

Previously, under Cuirass, we'd add "build-aux/cuirass/../hydra/../..".
But then, commit c45477d2a1 added this
in (gnu system vm):

         (local-file (search-path %load-path
                                  "guix/store/schema.sql"))

Since 'search-path' would not return an absolute file name, 'local-file'
would try to resolve that relative to "gnu/system", leading to:

  ERROR: In procedure force:
  In procedure canonicalize-path: No such file or directory: "/gnu/store/…-guix-ce573b1/gnu/system/build-aux/cuirass/../hydra/../../guix/store/schema.sql

* build-aux/hydra/gnu-system.scm <top level>: Canonicalize DIR before
adding it to %LOAD-PATH.
This commit is contained in:
Ludovic Courtès 2018-06-15 09:33:07 +02:00
parent 265048cc89
commit 7b0449712e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@
(and=> (assoc-ref (current-source-location) 'filename) (and=> (assoc-ref (current-source-location) 'filename)
(lambda (file) (lambda (file)
(let ((dir (string-append (dirname file) "/../.."))) (let ((dir (canonicalize-path
(string-append (dirname file) "/../.."))))
(format (current-error-port) "prepending ~s to the load path~%" (format (current-error-port) "prepending ~s to the load path~%"
dir) dir)
(set! %load-path (cons dir %load-path)))))) (set! %load-path (cons dir %load-path))))))