summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-09 23:01:02 +0200
committerLudovic Courtès <ludo@gnu.org>2014-04-09 23:01:02 +0200
commit9132b9bd72304e6fe659b3cb31700bdc49696caf (patch)
tree3bf008325b3da489cb14970d252d095a46b479d7
parent9bf404e9e678a8779a04f552f53994cc5d02656a (diff)
downloadgnu-guix-9132b9bd72304e6fe659b3cb31700bdc49696caf.tar
gnu-guix-9132b9bd72304e6fe659b3cb31700bdc49696caf.tar.gz
nar: 'restore-file-set' registers the temporary result as a GC root.
* guix/nar.scm (temporary-store-directory): Use 'add-indirect-root', not 'add-temp-root'. Reported by Andreas Enge <andreas@enge.fr> at <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00161.html>.
-rw-r--r--guix/nar.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/nar.scm b/guix/nar.scm
index 5b602df90b..ce69163a8a 100644
--- a/guix/nar.scm
+++ b/guix/nar.scm
@@ -339,8 +339,10 @@ protected from garbage collection."
(let* ((template (string-append (%store-prefix) "/guix-XXXXXX"))
(port (mkstemp! template)))
(close-port port)
+
+ ;; Make sure TEMPLATE is not collected while we populate it.
(with-store store
- (add-temp-root store template))
+ (add-indirect-root store template))
;; There's a small window during which the GC could delete the file. Try
;; again if that happens.