diff options
-rw-r--r-- | doc/cuirass.texi | 15 | ||||
-rw-r--r-- | src/cuirass/base.scm | 22 |
2 files changed, 27 insertions, 10 deletions
diff --git a/doc/cuirass.texi b/doc/cuirass.texi index fcebef6..b5b27e8 100644 --- a/doc/cuirass.texi +++ b/doc/cuirass.texi @@ -11,7 +11,8 @@ This manual is for Cuirass version @value{VERSION}, a build automation server. Copyright @copyright{} 2016, 2017 Mathieu Lirzin@* -Copyright @copyright{} 2017 Mathieu Othacehe +Copyright @copyright{} 2017 Mathieu Othacehe@* +Copyright @copyright{} 2018 Ludovic Courtès @quotation Permission is granted to copy, distribute and/or modify this document @@ -248,12 +249,16 @@ specification itself. The URL of the repository. @item load_path -This text field holds the name of the subdirectory in the checked out -repository that is passed to the @code{evaluate} tool as the Guile load -path. This directory is interpreted relative to the repository in the -Cuirass cache directory. This will usually be the current directory +This field holds a colon-separated list of directories that are +prepended to the Guile load path when evaluating @code{file} (see +below.) + +Each entry that is not an absolute file name is interpreted relative to +the source code checkout. Often, @code{load_path} has just one entry, @code{"."}. +When @code{load_path} is empty, the load path is left unchanged. + @item file The absolute name of the Scheme file containing PROC. diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index c9c5ec1..9e930d4 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -253,12 +253,24 @@ in SOURCE directory. Return a list of jobs." (#:system . ,(derivation-system drv)) ,@job))) + (define (tokenize str) + (string-tokenize str (char-set-complement (char-set #\:)))) + + (define load-path + (match (assq-ref spec #:load-path) + (#f + "") + ((= tokenize path) + (string-join (map (lambda (entry) + (if (string-prefix? "/" entry) + entry + (string-append source "/" entry))) + path) + ":")))) + (let* ((port (non-blocking-port - (open-pipe* OPEN_READ - "evaluate" - (string-append (%package-cachedir) "/" - (assq-ref spec #:name) "/" - (assq-ref spec #:load-path)) + (open-pipe* OPEN_READ "evaluate" + load-path (%guix-package-path) source (object->string spec)))) (result (match (read/non-blocking port) |