all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Caleb Ristvedt <caleb.ristvedt@cune.org>
Cc: guix-devel@gnu.org
Subject: Re: 02/09: guix: store: Make register-items transactional, register drv outputs
Date: Wed, 06 Mar 2019 14:14:08 +0100	[thread overview]
Message-ID: <877edcjgbj.fsf@gnu.org> (raw)
In-Reply-To: <87o97gcc3w.fsf@cune.org> (Caleb Ristvedt's message of "Wed, 13 Feb 2019 02:43:31 -0600")

Hi reepca!

Caleb Ristvedt <caleb.ristvedt@cune.org> skribis:

> Changes made, though I'm not quite sure about this part:
>
>> Could you add a test in tests/store-database.scm for this bit?
>>
>>> +        (when (derivation-path? real-file-name)
>>> +          (register-derivation-outputs))
>
> Should that be a separate test or an extension of "register-path"?
> Currently I'm doing the latter. And it looks ugly.

It’s part of ‘register-path’, so it’s a test of ‘register-path’, sure.
If you think it’s nicer to test it separately, you can write a separate
test.

>> Could you send updated patches?
>
> From 5ae8c31826f06f4ad0b52a4d7b0cd6c4abc64a20 Mon Sep 17 00:00:00 2001
> From: Caleb Ristvedt <caleb.ristvedt@cune.org>
> Date: Wed, 30 Jan 2019 17:03:38 -0600
> Subject: [PATCH 1/2] guix: store: Make register-items transactional.
>
> * guix/store/database.scm (SQLITE_BUSY, register-output-sql): new variables
>   (add-references): don't try finalizing after each use, only after all the
>   uses (otherwise a finalized statement would be used if #:cache? was #f).
>   (call-with-transaction): New procedure.
>   (register-items): Use call-with-transaction to prevent broken intermediate
>   states from being visible.
>
> * .dir-locals.el (call-with-transaction): indent it.

I applied this one (I updated the copyright year for you and tweaked the
commit log.)

> From adba9061739cd9afff9d404f871f66ce36147dd2 Mon Sep 17 00:00:00 2001
> From: Caleb Ristvedt <caleb.ristvedt@cune.org>
> Date: Wed, 13 Feb 2019 02:19:42 -0600
> Subject: [PATCH 2/2] guix: store: Register derivation outputs.
>
> * guix/store/database.scm (register-output-sql, derivation-outputs-sql): new
>   variables.
>   (registered-derivation-outputs): new procedure.
>   ((guix derivations), (guix store)): used for <derivation> and
>   derivation-path?, respectively.
>   (register-items): if item is a derivation, also register its outputs.
>
> * tests/store-database.scm (register-path): first register a dummy derivation
>   for the test file, and check that its outputs are registered in the
>   DerivationOutputs table and are equal to what was specified in the dummy
>   derivation.
> ---
>  guix/store/database.scm  | 41 ++++++++++++++++++++++++++++++++++++++++
>  tests/store-database.scm | 30 ++++++++++++++++++++++++++++-
>  2 files changed, 70 insertions(+), 1 deletion(-)
>
> diff --git a/guix/store/database.scm b/guix/store/database.scm
> index af7f82b049..b89d81d770 100644
> --- a/guix/store/database.scm
> +++ b/guix/store/database.scm
> @@ -21,6 +21,8 @@
>    #:use-module (sqlite3)
>    #:use-module (guix config)
>    #:use-module (guix serialization)
> +  #:use-module (guix derivations)
> +  #:use-module (guix store)

A problem is that we should not pull in these two modules here, because
they are conceptually at a higher level (they have to do with talking to
a separate daemon process.)

So perhaps a first step would be to re-arrange things, probably along
these lines:

  • Move the .drv parsing code and the <derivation> record type from
    (guix derivations) to, say, (guix store derivations).

  • Re-export all these bindings from (guix derivations).

  • Move ‘store-path?’, ‘derivation-path?’ & co. (everything below line
    1745 in guix/store.scm) to, say, (guix store files).  Re-export
    appropriately so the API remains unchanged.

At this point, (guix store …) modules won’t have to use (guix store) and
(guix derivations) at all.

How does that sound?

Thanks,
Ludo’.

  reply	other threads:[~2019-03-06 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190204192241.15758.66035@vcs0.savannah.gnu.org>
     [not found] ` <20190204192243.A58BA20B45@vcs0.savannah.gnu.org>
2019-02-04 23:14   ` 01/09: patches: honor NIX_STORE in site.py Ludovic Courtès
2019-02-07  0:07     ` [bug#34358] [PATCH] gnu: python@2.7: Honor NIX_STORE Caleb Ristvedt
2021-09-26  2:31       ` Sarah Morgensen
2021-09-27 16:25         ` bug#34358: " Ludovic Courtès
     [not found] ` <20190204192243.D1BD820B84@vcs0.savannah.gnu.org>
2019-02-09 22:09   ` 02/09: guix: store: Make register-items transactional, register drv outputs Ludovic Courtès
2019-02-13  8:43     ` Caleb Ristvedt
2019-03-06 13:14       ` Ludovic Courtès [this message]
2019-04-01 17:53         ` Caleb Ristvedt
2019-04-01 19:43           ` Ludovic Courtès
2019-04-04 16:20           ` Ludovic Courtès
2019-04-06 23:57             ` Caleb Ristvedt

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877edcjgbj.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=caleb.ristvedt@cune.org \
    --cc=guix-devel@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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.