guix-commits
[Top][All Lists]
Advanced

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

02/11: linux-container: 'eval/container' correctly passes -L and -C flag


From: guix-commits
Subject: 02/11: linux-container: 'eval/container' correctly passes -L and -C flags.
Date: Wed, 18 Sep 2019 17:10:37 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 96b35998e610c7fc37bf87bf9e07e63d3bebd0a3
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 18 15:11:40 2019 +0200

    linux-container: 'eval/container' correctly passes -L and -C flags.
    
    This fixes a type error.
    
    * gnu/system/linux-container.scm (eval/container): Use 'append-map', not
    'map'.
    * tests/containers.scm ("eval/container, non-empty load path"): New test.
---
 gnu/system/linux-container.scm | 12 +++++++-----
 tests/containers.scm           | 27 +++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index c6124cd..2ab679f 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -257,11 +257,13 @@ effects."
                                            (lowered-gexp-guile lowered))
                                           "/bin/guile")
                            "guile"
-                           (append (map (lambda (directory) `("-L" ,directory))
-                                        (lowered-gexp-load-path lowered))
-                                   (map (lambda (directory) `("-C" ,directory))
-                                        (lowered-gexp-load-compiled-path
-                                         lowered))
+                           (append (append-map (lambda (directory)
+                                                 `("-L" ,directory))
+                                               (lowered-gexp-load-path 
lowered))
+                                   (append-map (lambda (directory)
+                                                 `("-C" ,directory))
+                                               (lowered-gexp-load-compiled-path
+                                                lowered))
                                    (list "-c"
                                          (object->string
                                           (lowered-gexp-sexp 
lowered))))))))))))
diff --git a/tests/containers.scm b/tests/containers.scm
index c6c738f..01fbcbb 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -269,4 +269,31 @@
                       (lset= string=? (cons* "." ".." (map basename reqs))
                              (pk (call-with-input-file result read))))))))))
 
+(test-assert "eval/container, non-empty load path"
+  (call-with-temporary-directory
+   (lambda (directory)
+     (define store
+       (open-connection-for-tests))
+     (define result
+       (string-append directory "/r"))
+     (define requisites*
+       (store-lift requisites))
+
+     (mkdir result)
+     (run-with-store store
+       (mlet %store-monad ((status (eval/container
+                                    (with-imported-modules '((guix build 
utils))
+                                      #~(begin
+                                          (use-modules (guix build utils))
+                                          (mkdir-p "/result/a/b/c")))
+                                    #:mappings
+                                    (list (file-system-mapping
+                                           (source result)
+                                           (target "/result")
+                                           (writable? #t))))))
+         (close-connection store)
+         (return (and (zero? status)
+                      (file-is-directory?
+                       (string-append result "/a/b/c")))))))))
+
 (test-end)



reply via email to

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