summaryrefslogtreecommitdiff
path: root/tests/pack.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-10-28 00:17:08 +0200
committerLudovic Courtès <ludo@gnu.org>2018-11-06 23:21:23 +0100
commitb27ef1d46cfdc3c994b106241f99cd7142083d13 (patch)
tree2cca585abb389b6826b304c49e5ca9f21410540f /tests/pack.scm
parentec4c81fe32a90890a6190443248078ce7366503f (diff)
pack: Import (guix store database) only when '--localstatedir' is passed.
This is another way to address <https://bugs.gnu.org/32184>, which was previously addressed in commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * gnu/build/install.scm (register-closure): Move to... * gnu/build/vm.scm (register-closure): ... here. New procedure. * guix/scripts/pack.scm (self-contained-tarball)[build]: Remove now unneeded 'with-extensions' form and custom (guix config) module. * tests/guix-pack.sh: Revert the strategy from commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * tests/pack.scm ("self-contained-tarball"): Likewise.
Diffstat (limited to 'tests/pack.scm')
-rw-r--r--tests/pack.scm64
1 files changed, 30 insertions, 34 deletions
diff --git a/tests/pack.scm b/tests/pack.scm
index 4eb5be92ffa..6bd18bdee29 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -29,6 +29,9 @@
29 #:use-module (gnu packages bootstrap) 29 #:use-module (gnu packages bootstrap)
30 #:use-module (srfi srfi-64)) 30 #:use-module (srfi srfi-64))
31 31
32(define %store
33 (open-connection-for-tests))
34
32;; Globally disable grafts because they can trigger early builds. 35;; Globally disable grafts because they can trigger early builds.
33(%graft? #f) 36(%graft? #f)
34 37
@@ -48,40 +51,33 @@
48 51
49(test-begin "pack") 52(test-begin "pack")
50 53
51;; The following test needs guile-sqlite3, libgcrypt, etc. as a consequence of 54(unless (network-reachable?) (test-skip 1))
52;; commit c45477d2a1a651485feede20fe0f3d15aec48b39 and related changes. Thus, 55(test-assertm "self-contained-tarball" %store
53;; run it on the user's store, if it's available, on the grounds that these 56 (mlet* %store-monad
54;; dependencies may be already there, or we can get substitutes or build them 57 ((profile (profile-derivation (packages->manifest
55;; quite inexpensively; see <https://bugs.gnu.org/32184>. 58 (list %bootstrap-guile))
56 59 #:hooks '()
57(with-external-store store 60 #:locales? #f))
58 (unless store (test-skip 1)) 61 (tarball (self-contained-tarball "pack" profile
59 (test-assertm "self-contained-tarball" store 62 #:symlinks '(("/bin/Guile"
60 (mlet* %store-monad 63 -> "bin/guile"))
61 ((profile (profile-derivation (packages->manifest 64 #:compressor %gzip-compressor
62 (list %bootstrap-guile)) 65 #:archiver %tar-bootstrap))
63 #:hooks '() 66 (check (gexp->derivation
64 #:locales? #f)) 67 "check-tarball"
65 (tarball (self-contained-tarball "pack" profile 68 #~(let ((bin (string-append "." #$profile "/bin")))
66 #:symlinks '(("/bin/Guile" 69 (setenv "PATH"
67 -> "bin/guile")) 70 (string-append #$%tar-bootstrap "/bin"))
68 #:compressor %gzip-compressor 71 (system* "tar" "xvf" #$tarball)
69 #:archiver %tar-bootstrap)) 72 (mkdir #$output)
70 (check (gexp->derivation 73 (exit
71 "check-tarball" 74 (and (file-exists? (string-append bin "/guile"))
72 #~(let ((bin (string-append "." #$profile "/bin"))) 75 (string=? (string-append #$%bootstrap-guile "/bin")
73 (setenv "PATH" 76 (readlink bin))
74 (string-append #$%tar-bootstrap "/bin")) 77 (string=? (string-append ".." #$profile
75 (system* "tar" "xvf" #$tarball) 78 "/bin/guile")
76 (mkdir #$output) 79 (readlink "bin/Guile"))))))))
77 (exit 80 (built-derivations (list check))))
78 (and (file-exists? (string-append bin "/guile"))
79 (string=? (string-append #$%bootstrap-guile "/bin")
80 (readlink bin))
81 (string=? (string-append ".." #$profile
82 "/bin/guile")
83 (readlink "bin/Guile"))))))))
84 (built-derivations (list check)))))
85 81
86(test-end) 82(test-end)
87 83