diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-12-10 11:21:14 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-12-15 17:32:09 +0100 |
commit | 2718c29c3fb9f9de2ec897248ad49ae11ca39b7a (patch) | |
tree | 6698852d62943afa23f01f8fbeec8033db9c7ef7 /tests | |
parent | ed7d02f7c198970ce3fe94bcee47592963326446 (diff) | |
download | guix-2718c29c3fb9f9de2ec897248ad49ae11ca39b7a.tar guix-2718c29c3fb9f9de2ec897248ad49ae11ca39b7a.tar.gz |
nar: Deduplicate files right as they are restored.
This avoids having to traverse and re-read the files that we have just
restored, thereby reducing I/O.
* guix/serialization.scm (dump-file): New procedure.
(restore-file): Add #:dump-file parameter and honor it.
* guix/store/deduplication.scm (tee, dump-file/deduplicate): New
procedures.
* guix/nar.scm (restore-one-item): Pass #:dump-file to 'restore-file'.
(finalize-store-file): Pass #:deduplicate? #f to 'register-items'.
* tests/nar.scm <top level>: Call 'setenv' to set "NIX_STORE".
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nar.scm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/nar.scm b/tests/nar.scm index 59616659c8..ba4881caaa 100644 --- a/tests/nar.scm +++ b/tests/nar.scm @@ -452,6 +452,9 @@ (false-if-exception (rm-rf %test-dir)) (setlocale LC_ALL locale))))) +;; XXX: Tell the 'deduplicate' procedure what store we're actually using. +(setenv "NIX_STORE" (%store-prefix)) + (test-assert "restore-file-set (signed, valid)" (with-store store (let* ((texts (unfold (cut >= <> 10) |