unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 38754@debbugs.gnu.org
Subject: [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter.
Date: Sun, 15 Mar 2020 21:35:28 +0000	[thread overview]
Message-ID: <87mu8hcndr.fsf@cbaines.net> (raw)
In-Reply-To: <87lfqsxsxn.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Hi Chris!
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> Christopher Baines <mail@cbaines.net> skribis:
>>>
>>>> +    (with-store store
>>>> +      (parameterize
>>>> +          ((%lint-checker-store-connection store))
>>>
>>> Actually it means that now ‘guix lint’ systematically connects to the
>>> daemon.
>>
>> I guess that's the effect, were you meaning this would make a better
>> message in the commit?
>
> I mean that it’s a visible change.  Before, you could run all the
> linters but this one without having a daemon running; now you need a
> daemon up and running.

Ah, yeah, that's a good point.

>>> I wonder if we could arrange to open the connection lazily, and to
>>> somehow carry state across linter invocations.  Perhaps
>>> ‘check-derivation’ should be monadic, with a field in <checker>
>>> indicating that.  Sounds complicated though.
>>>
>>> Thoughts?
>>
>> I did wonder if the code could somehow transparently be made more
>> efficient. Quite often database clients manage a pool of connections,
>> and when you perform a database operation, a connection from the pool is
>> checked out, and then returned once you're finished. But as you say,
>> this could be complicated. I think parameters can be set with
>> connections, and I'm not quiet sure what the interface should be.
>>
>> I also did think about somehow passing the store connection in to the
>> lint checker more explicitly, but I'm not sure how to generalise that.
>
> There could be a <checker> field indicating either that (1) the
> procedure takes an optional store parameter, or that (2) the procedure
> is monadic in ‘%store-monad’.
>
> #2 seems more complicated to implement that #1 though.
>
> For #1, ‘guix lint’ could check whether:
>
>   (any checker-require-store? checkers)
>
> is true, and if it is, it could open a connection and pass it on as
> needed.
>
> WDYT?
>
> If that seems good to you, I guess you can go ahead with it (let’s just
> not lose our hair on it!).

I've finally got around to looking at this again. I've sent some new
patches which add a field to the <lint-checker> record, and adjust the
running of lint checkers as well as the derivation checker to use a
single store connection.

Let me know what you think?

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

  parent reply	other threads:[~2020-03-15 21:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 17:33 [bug#38754] [PATCH 0/2] Speed up the derivation linter Christopher Baines
2019-12-26 18:01 ` [bug#38754] [PATCH 1/2] guix: lint: Add an optional parameter for a store connection Christopher Baines
2019-12-26 18:01   ` [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter Christopher Baines
2019-12-30 22:12     ` Ludovic Courtès
2019-12-30 23:34       ` Christopher Baines
2019-12-31 18:15         ` Ludovic Courtès
2020-03-15 21:06           ` [bug#38754] [PATCH 1/4] lint: Add a requires-store? field to the checker record Christopher Baines
2020-03-15 21:06             ` [bug#38754] [PATCH 2/4] lint: Mark the derivation checker as requiring a store connection Christopher Baines
2020-03-15 21:06             ` [bug#38754] [PATCH 3/4] lint: Add a #:store argument to check-derivation Christopher Baines
2020-03-15 21:06             ` [bug#38754] [PATCH 4/4] scripts: lint: Handle store connections for lint checkers Christopher Baines
2020-03-15 21:35           ` Christopher Baines [this message]
2020-03-24 10:20             ` [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter Ludovic Courtès
2020-03-24 19:50               ` bug#38754: " Christopher Baines
2019-12-30 22:01 ` [bug#38754] [PATCH 0/2] Speed up the derivation linter Ludovic Courtès

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=87mu8hcndr.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=38754@debbugs.gnu.org \
    --cc=ludo@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).