From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:56771) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDavT-0000Dh-VG for guix-patches@gnu.org; Sun, 15 Mar 2020 17:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDavS-0001Xx-D6 for guix-patches@gnu.org; Sun, 15 Mar 2020 17:36:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDavS-0001Wt-9g for guix-patches@gnu.org; Sun, 15 Mar 2020 17:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDavS-0000wt-6o for guix-patches@gnu.org; Sun, 15 Mar 2020 17:36:02 -0400 Subject: [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter. Resent-Message-ID: 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> <87lfqsxsxn.fsf@gnu.org> From: Christopher Baines In-reply-to: <87lfqsxsxn.fsf@gnu.org> Date: Sun, 15 Mar 2020 21:35:28 +0000 Message-ID: <87mu8hcndr.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 38754@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > 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 c= onnects 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. 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 >>> =E2=80=98check-derivation=E2=80=99 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 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=99= 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 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl5un6BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfnhQ//TgII6dZOglvxrSPVzYYMcpwCByot52rMbcVnO6K2KAL8adBxS5BnGa9V r9G+PbhImKMUsZPnjz6WLX750P/KgY7kYpIlwTdhKOt2WwfuJKVu/O9ZZOy2rEtI rNkgWOpAxz7lymjjoHY3dGvQ3I0f1tPhZYrD8VrxhsJIFR2nzJslRwdsOAosBKmE eQwQTo/oZPh2+D+RcGcK38DlzhsziNoJ7s8oUAzrbi7TYHK+fJn8Vym8F+cZJrvI xNocdgQwmyzCdkwNYnwEmOS/7pmWCP/e7y2qSoGwNbs7Fdfb7fTjCXCMSDOq7Jpg 0kDv1uGdK7IGPz0lV1jmi2X+PTq03t0V9UjxftpEvOO4Tsccz1Ut3dMkwrHZf3JA JhvNbnbp+bvJ4QhT64JEWZyS3Gjhc0hl/PWS6kMGhwVKGv04DHYV3QwRCbQp7O/e HTGGVsay2XQGS3m4y3OHhJFI7AcR/laufpR45yAoOQpu3AaAo4dHOHqxbuVMUWPr TrUu/i34IDkqoh2YUZjkEeZRBKJqMIoMWERK6IofrdgzMID3IwJgudupp1+aCtH+ SCLsYuPHcPyoDhYXmwMb07NmAiF5fDH9iwHFk85LzLFtIBQXm5aeaVUUpUv+YY3c 94HcuWVtCPfjExCuCe5VILnMp9I+de2nTrfhxfHzOPxYpsB9+EM= =YGen -----END PGP SIGNATURE----- --=-=-=--