From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:55355) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1im4Yx-0004nU-Ia for guix-patches@gnu.org; Mon, 30 Dec 2019 18:35:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1im4Yw-0006E7-Hl for guix-patches@gnu.org; Mon, 30 Dec 2019 18:35:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1im4Yw-0006Du-F1 for guix-patches@gnu.org; Mon, 30 Dec 2019 18:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1im4Yw-00065r-Ak for guix-patches@gnu.org; Mon, 30 Dec 2019 18:35:02 -0500 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> From: Christopher Baines In-reply-to: <87lfqtzcma.fsf@gnu.org> Date: Mon, 30 Dec 2019 23:34:21 +0000 Message-ID: <878smtqtfm.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: > 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 con= nects to the > daemon. I guess that's the effect, were you meaning this would make a better message in the commit? > 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. At least to me, a parameter to store the connection in seemed like a simple if inelegant approach. I'm quite happy to look in to other approaches though if you have thoughts on what might be good. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl4KiX1fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfrTQ/6Ay69KW0ECA9FZxCvpfiPLk5KRXnoW6L9TvGyB+hG+9k3z78UrjZ3Ht7T tyebnY6Kslywxnp/uuOOIiYQbw4BhUhjTQkaqYYA7SqULL3COHat1xI4IZRSxuJu F3XUBR+upGYaO4TnftFaF2RIj4HmLJrvdHcNCmNJ74Di9nu/zsqfkwclAhm0b0lx LTWN0jQA8cMHYMxiR1Qwdb1EJh3ZgmvrR3To9uYbFLrfz5UuvyYbLfevOISOmCZC lo+fXSfP4eOlw2Fi/NseW5MnhQ1fEmX/iXE9qow3CRPx825St/WE+85teSipUsJ8 GVnYQrIdSAaLPgp1p6HD0InymkWgTfoOF7cJLOoPOMu9VooG/5eRpeUNvHp8D+jV 78pySy+O6ThEqg97FwUXohGEXW83JpvpdklIHuopmfkv3hkZ/0v/EVDMo4plfZQH sWwc1BjU28OigSXLGpaUQkrU0Pb7/vvhJM55PFJsGFzK5owrSMyCJWe93YdtPG0q rEedkkUzrMH3yZovBvhX5CTZUOPtIRANEk5feUPVMkVWHD937JeVFDuBVr8bFsrH P7sDDEJz9ku2VOkpr8D6RVY6a96oENuZHb8Jv0MSrmMfxKmHvdc9YLgOw+MURONI QHy7b2asPmLuPhiAaxK+9yqQTuIOpr5NsptrO7ZHaKyXBndD8XQ= =kQoX -----END PGP SIGNATURE----- --=-=-=--