store: 'with-store' doesn't close the store upon abort.
authorLudovic Courtès <ludo@gnu.org>
Sat, 4 Apr 2020 15:36:31 +0000 (17:36 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sat, 4 Apr 2020 16:52:35 +0000 (18:52 +0200)
commit8ed597f4a261fe188de82cd1f5daed83dba948eb
tree11a5d45ad494bf6d0244fd3248664c536e9fa333
parentd8c8bfcc1f7c2e8226abebc6227261c8617f90d0
store: 'with-store' doesn't close the store upon abort.

Fixes <https://bugs.gnu.org/40428>.
Reported by Marius Bakke <mbakke@fastmail.com> and 白い熊.

Regression introduced with the first uses of 'with-build-handler' in
commit 62195b9a8fd6846117c5d7698842748300d13e31 and subsequent.

* guix/store.scm (call-with-store): Use 'catch #t' instead of
'dynamic-wind'.  This ensures STORE remains open when a non-local exit
other than an exception occurs, such as an abort to the build handler
prompt.
* tests/store.scm ("with-build-handler + with-store"): New test.
guix/store.scm
tests/store.scm