[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 01/03: guix: store: Add ensure-path.
From: |
Mathieu Othacehe |
Subject: |
Re: 01/03: guix: store: Add ensure-path. |
Date: |
Mon, 23 Nov 2020 10:11:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hey,
> Looking at LocalStore::ensurePath, I don’t think a GC root is made.
> You have to call ‘add-temp-root’ if you want that to happen, no?
Yes, I think we do indeed.
> However ‘ensure-path’ can substitute the store item, which I suppose
> means you can substitute .drv files without building them, am I right?
Yes I'm using it this way:
--8<---------------cut here---------------start------------->8---
(define (add-to-store outputs url)
(with-store store
(for-each (lambda (output)
(add-to-locks-held store output)
(add-substitute-url store url)
(ensure-path store output))
(map derivation-output-path outputs))))
--8<---------------cut here---------------end--------------->8---
to fetch substitutes without building derivations. The painful part is
that I have to use my own custom RPC: AddToLocksHeld, so that I can add
the substitute to the store even if the output lock is held.
At first, I planned to use "restore-file-set" from (guix nar) but it
only handles nar files produced by "guix archive --export".
Thanks,
Mathieu