diff options
author | Marius Bakke <mbakke@fastmail.com> | 2020-04-08 13:00:50 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2020-04-08 13:00:50 +0200 |
commit | 27783023993f9272ce422868d14529159c4a5218 (patch) | |
tree | 9013b08aa39e497b1fd8e01a05254278d83f0ff7 /tests/store.scm | |
parent | be1e842ad78ac6c52fc7790f4a3ffd716673c111 (diff) | |
parent | ba6f2bda18ed19fa486a9c3e2c3baea6c66c6867 (diff) | |
download | guix-27783023993f9272ce422868d14529159c4a5218.tar guix-27783023993f9272ce422868d14529159c4a5218.tar.gz |
Merge branch 'master' into core-updates
Conflicts:
etc/news.scm
gnu/local.mk
gnu/packages/check.scm
gnu/packages/cross-base.scm
gnu/packages/gimp.scm
gnu/packages/java.scm
gnu/packages/mail.scm
gnu/packages/sdl.scm
gnu/packages/texinfo.scm
gnu/packages/tls.scm
gnu/packages/version-control.scm
Diffstat (limited to 'tests/store.scm')
-rw-r--r-- | tests/store.scm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm index 0458a34746..0e80ccc239 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -412,6 +412,33 @@ (build-derivations %store (list d2)) 'fail))) +(test-equal "with-build-handler + with-store" + 'success + ;; Check that STORE remains valid when the build handler invokes CONTINUE, + ;; even though 'with-build-handler' is outside the dynamic extent of + ;; 'with-store'. + (with-build-handler (lambda (continue store things mode) + (match things + ((drv) + (and (string-suffix? "thingie.drv" drv) + (not (port-closed? + (store-connection-socket store))) + (continue #t))))) + (with-store store + (let* ((b (add-text-to-store store "build" "echo $foo > $out" '())) + (s (add-to-store store "bash" #t "sha256" + (search-bootstrap-binary "bash" + (%current-system)))) + (d (derivation store "thingie" + s `("-e" ,b) + #:env-vars `(("foo" . ,(random-text))) + #:sources (list b s)))) + (build-derivations store (list d)) + + ;; Here STORE's socket should still be open. + (and (valid-path? store (derivation->output-path d)) + 'success))))) + (test-assert "map/accumulate-builds" (let* ((b (add-text-to-store %store "build" "echo $foo > $out" '())) (s (add-to-store %store "bash" #t "sha256" |