From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: 01/03: guix: store: Add ensure-path.
Date: Fri, 27 Nov 2020 11:20:59 +0100 [thread overview]
Message-ID: <87wny7umlw.fsf@gnu.org> (raw)
In-Reply-To: <87o8jow6u5.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 23 Nov 2020 14:17:22 +0100")
Hi,
Mathieu Othacehe <othacehe@gnu.org> skribis:
>> 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.
>
> Why shouldn't it connect to the daemon? In the current implementation of
> the nix daemon, there's the following snippet:
>
> if (!missing.empty()) {
> Activity act(*logger, lvlTalkative, actUnknown, fmt("copying outputs from '%s'", storeUri));
> for (auto & i : missing)
> store->locksHeld.insert(store->printStorePath(i)); /* FIXME: ugly */
> copyPaths(ref<Store>(sshStore), store, missing, NoRepair, NoCheckSigs, NoSubstitute);
> }
>
> in build-remote.cc. So it looks like it connects to the store, add the
> outputs to locks held and import them, which is the behaviour I'm
> trying to replicate.
Yes but here ‘store’ is an instance of ‘LocalStore’ typically.
I’m referring to this bit in (guix nar):
(with-store store
(let loop ((name (temporary-store-file)))
;; Add NAME to the current process' roots. (Opening this connection to
;; the daemon allows us to reuse its code that deals with the
;; per-process roots file.)
(add-temp-root store name)
This is (I think) the only place where ‘guix offload’ connects to the
daemon, and it does so just because we don’t have an ‘add-temp-root’
implementation in Scheme.
>> Specifically it handles “nar bundles” (new name :-)). But probably you
>> can extract the relevant bits to import single nars, right?
>
> Yup you're right, it should be possible, but I'd rater let the daemon do
> it if possible.
Sure, but see ‘restore-one-item’ vs ‘restore-file-set’. Perhaps
‘restore-one-item’ already does what you want.
HTH,
Ludo’.
prev parent reply other threads:[~2020-11-27 10:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201122161938.30063.63195@vcs0.savannah.gnu.org>
[not found] ` <20201122161940.6485520981@vcs0.savannah.gnu.org>
2020-11-22 22:57 ` 01/03: guix: store: Add ensure-path Ludovic Courtès
2020-11-23 8:37 ` Christopher Baines
2020-11-23 9:11 ` Mathieu Othacehe
2020-11-23 11:34 ` Ludovic Courtès
2020-11-23 13:17 ` Mathieu Othacehe
2020-11-27 10:20 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wny7umlw.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=othacehe@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).