From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48307) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imM3n-0004yX-RB for guix-patches@gnu.org; Tue, 31 Dec 2019 13:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imM3m-0006v2-LC for guix-patches@gnu.org; Tue, 31 Dec 2019 13:16:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imM3m-0006uA-GB for guix-patches@gnu.org; Tue, 31 Dec 2019 13:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1imM3m-0005y6-B1 for guix-patches@gnu.org; Tue, 31 Dec 2019 13:16:02 -0500 Subject: [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8736d7rnzg.fsf@cbaines.net> <20191226180104.10888-1-mail@cbaines.net> <20191226180104.10888-2-mail@cbaines.net> <87lfqtzcma.fsf@gnu.org> <878smtqtfm.fsf@cbaines.net> Date: Tue, 31 Dec 2019 19:15:32 +0100 In-Reply-To: <878smtqtfm.fsf@cbaines.net> (Christopher Baines's message of "Mon, 30 Dec 2019 23:34:21 +0000") Message-ID: <87lfqsxsxn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 38754@debbugs.gnu.org Hi Chris! Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> Christopher Baines skribis: >> >>> + (with-store store >>> + (parameterize >>> + ((%lint-checker-store-connection store)) >> >> Actually it means that now =E2=80=98guix lint=E2=80=99 systematically co= nnects 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=E2=80=99s 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. >> I wonder if we could arrange to open the connection lazily, and to >> somehow carry state across linter invocations. Perhaps >> =E2=80=98check-derivation=E2=80=99 should be monadic, with a field in >> 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 field indicating either that (1) the procedure takes an optional store parameter, or that (2) the procedure is monadic in =E2=80=98%store-monad=E2=80=99. #2 seems more complicated to implement that #1 though. For #1, =E2=80=98guix lint=E2=80=99 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=E2=80=99s = just not lose our hair on it!). Thanks, Ludo=E2=80=99.