guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 01/03: guix: store: Add ensure-path.


From: Ludovic Courtès
Subject: Re: 01/03: guix: store: Add ensure-path.
Date: Mon, 23 Nov 2020 12:34:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

>> 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.

So perhaps we should adjust the docstring to reflect that?

>> 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:
>
> (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))))
>
> 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.

Yeah, ‘guix offload’ should not connect to the daemon.  It does so
currently for one thing (registering GC roots IIRC), which should be
done in Scheme instead.

> At first, I planned to use "restore-file-set" from (guix nar) but it
> only handles nar files produced by "guix archive --export".

Specifically it handles “nar bundles” (new name :-)).  But probably you
can extract the relevant bits to import single nars, right?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]