aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-02-03 11:26:25 +0100
committerLudovic Courtès <ludo@gnu.org>2017-02-04 02:13:43 +0100
commitad167d028e97dca1937ad6ae3d89d2c4de997754 (patch)
tree8fe4f5a176f540ab7af9adb4e031ea07bd2f1cb6
parentcf98d342b0899be3b72438d2dd5a2350f0f78f33 (diff)
downloadpatches-ad167d028e97dca1937ad6ae3d89d2c4de997754.tar
patches-ad167d028e97dca1937ad6ae3d89d2c4de997754.tar.gz
file-systems: Remove dependency on (guix store).
(gnu system file-systems) is used on the "build" side since commit 5970e8e248f6327c41c83b86bb2c89be7c3b1b4e. * gnu/system/file-systems.scm: Remove dependency on (guix store). (%store-prefix): New procedure. * tests/file-systems.scm ("does not pull (guix config)"): New test.
-rw-r--r--gnu/system/file-systems.scm15
-rw-r--r--tests/file-systems.scm8
2 files changed, 22 insertions, 1 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index b2721f2389..708d53d0a1 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -19,7 +19,6 @@
(define-module (gnu system file-systems)
#:use-module (ice-9 match)
#:use-module (guix records)
- #:use-module (guix store)
#:use-module ((gnu build file-systems)
#:select (string->uuid uuid->string))
#:re-export (string->uuid
@@ -97,6 +96,20 @@
(dependencies file-system-dependencies ; list of <file-system>
(default '()))) ; or <mapped-device>
+;; Note: This module is used both on the build side and on the host side.
+;; Arrange not to pull (guix store) and (guix config) because the latter
+;; differs from user to user.
+(define (%store-prefix)
+ "Return the store prefix."
+ (cond ((resolve-module '(guix store) #:ensure #f)
+ =>
+ (lambda (store)
+ ((module-ref store '%store-prefix))))
+ ((getenv "NIX_STORE")
+ => identity)
+ (else
+ "/gnu/store")))
+
(define %not-slash
(char-set-complement (char-set #\/)))
diff --git a/tests/file-systems.scm b/tests/file-systems.scm
index fd1599e132..467ee8ca5d 100644
--- a/tests/file-systems.scm
+++ b/tests/file-systems.scm
@@ -18,6 +18,7 @@
(define-module (test-file-systems)
#:use-module (guix store)
+ #:use-module (guix modules)
#:use-module (gnu system file-systems)
#:use-module (srfi srfi-64)
#:use-module (rnrs bytevectors))
@@ -72,4 +73,11 @@
(device "/foo")
(flags '(bind-mount read-only)))))))))
+(test-assert "does not pull (guix config)"
+ ;; This module is meant both for the host side and "build side", so make
+ ;; sure it doesn't pull in (guix config), which depends on the user's
+ ;; config.
+ (not (member '(guix config)
+ (source-module-closure '((gnu system file-systems))))))
+
(test-end)