From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cFWuBMiS918VLgAA0tVLHw (envelope-from ) for ; Thu, 07 Jan 2021 23:01:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eLyEAMiS919/cAAAB5/wlQ (envelope-from ) for ; Thu, 07 Jan 2021 23:01:28 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A0B819403E6 for ; Thu, 7 Jan 2021 23:01:27 +0000 (UTC) Received: from localhost ([::1]:60596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxeHW-0002qG-4q for larch@yhetil.org; Thu, 07 Jan 2021 18:01:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxdn9-0000hR-BP for guix-patches@gnu.org; Thu, 07 Jan 2021 17:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxdn9-0007Be-3i for guix-patches@gnu.org; Thu, 07 Jan 2021 17:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kxdn8-0005iP-V9 for guix-patches@gnu.org; Thu, 07 Jan 2021 17:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45409] [PATCH v3 3/3] guix: Split (guix substitutes) from (guix scripts substitute). Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Jan 2021 22:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45409 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45409-submit@debbugs.gnu.org id=B45409.161005857421908 (code B ref 45409); Thu, 07 Jan 2021 22:30:02 +0000 Received: (at 45409) by debbugs.gnu.org; 7 Jan 2021 22:29:34 +0000 Received: from localhost ([127.0.0.1]:48849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxdmf-0005hI-I9 for submit@debbugs.gnu.org; Thu, 07 Jan 2021 17:29:33 -0500 Received: from mira.cbaines.net ([212.71.252.8]:49244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxdmc-0005h8-34 for 45409@debbugs.gnu.org; Thu, 07 Jan 2021 17:29:32 -0500 Received: from localhost (188.28.108.198.threembb.co.uk [188.28.108.198]) by mira.cbaines.net (Postfix) with ESMTPSA id D1EF127BC0E; Thu, 7 Jan 2021 22:29:28 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 2953f32b; Thu, 7 Jan 2021 22:29:26 +0000 (UTC) References: <20210104211927.14959-1-mail@cbaines.net> <20210104211927.14959-3-mail@cbaines.net> <87r1mzrqgk.fsf@gnu.org> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines In-reply-to: <87r1mzrqgk.fsf@gnu.org> Date: Thu, 07 Jan 2021 22:29:23 +0000 Message-ID: <87zh1kidoc.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45409@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A0B819403E6 X-Spam-Score: -4.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: aO6KHKNV2Sv2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> This means there's a module for working with substitutes, rather than al= l the >> code sitting in the script. The need for this can be seen with the weath= er and >> challenge scripts, that now don't have to use code from the substitute s= cript, >> but can instead use the substitute module. >> >> The separation here between the actual functionality of the substitute s= cript >> and the underlying functionality used both there and elsewhere should ma= ke >> maintenance easier moving forward. >> >> This commit just moves code, none of the code should have been changed >> significantly. >> >> * guix/scripts/substitute.scm (%narinfo-cache-directory, %narinfo-ttl, >> %narinfo-negative-ttl, %narinfo-transient-error-ttl, %unreachable-hosts, >> %max-cached-connections): Move variables to (guix substitutes). >> (narinfo-cache-file, cached-narinfo, cache-narinfo!, narinfo-request, at= -most, >> http-multiple-get, read-to-eof, narinfo-from-file, >> open-connection-for-uri/maybe, fetch-narinfos, lookup-narinfos, >> lookup-narinfos/diverse, open-connection-for-uri/cached, >> call-with-cached-connection): Move procedures to (guix substitutes). >> (with-cached-connection): Move syntax rule to (guix substitutes). >> * guix/substitutes.scm: New file. >> * Makefile.am (MODULES): Add it. >> * po/guix/POTFILES.in: Add 'guix/substitutes.scm'. > > I=E2=80=99m reluctant starting this new module while it still contains > single-short-lived-process assumptions (connection caching & co.). > > How about proceeding like this: > > 1. Move =E2=80=98http-multiple-get=E2=80=99 to (guix http-client). > > 2. Postpone the (guix substitute) bit to a separate patch series to > leave us the time to polish things a bit and removes the > single-process assumptions, or just move fewer things to (guix > substitutes). > > You could push (guix narinfo) in the meantime since I think that one is > almost ready. > > How does that sound? Am I being too cautious? Well, separating out the connection caching might be helpful for cleaning things up in the Guix Build Coordinator, I had to add a mutex currently as I'm guessing the caching isn't thread safe. I think it's possible to separate it out if some of the error handling is pushed down in to the http procedures, and if when they get an error indicating the connection is unusable, they close the port. I've pushed some rough commits for this to this branch: https://git.cbaines.net/guix/log/?h=3Dprepare-to-move-guix-scripts-substi= tute-code I'm still struggling with the tests, currently make check hangs, I think on the challenge tests, and I don't currently have a plan to work out why the test is hanging. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/3i0NfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfBUg//QCsNw8UNJ92v+orRrmNP71sDfmC4gAe8 BBvwWOuJLKe2mVchYTL4AN5B6Qvmhcob00W3mEdXVet9tb9aW6zdSUI0y0vTcfiJ A5MkjI5guOQm2rG/zCrju4pkCPxkxFk/qSju1Q07vR4eAMU4EBCmpiXT06/e0ceT BHvGVY9b7oClCHRMRh3DzMdG3SU978KyVBJxZXD8+q/LwqQ/SAH1cP47Ku/3koHq T9vUq303/f0zPfpU2WE3sky19Sbm710tiiFC2rzW8zM+5pzPr4Pzl1SyRtSCo55E l27YaxOAYVW1Jvj2n7eFLdsV5msoUlU2jSg57XdZIKSbDgK3Bs2u+GW6FOwP4mGy SysR8ZqQ8RIiQh0cZFmoADhk4FGYIuJevwGgIig5v+mtH1FlpTxbtq90kjhrmdKH 4Wdcr2mh5Syvo/saF7eHqKguV48Z9tNN5XC00mWQ2GANv65EPFP3f/eilshiIeFo ZR91773aFQ113A6EQvz2Yh2zroODgLjgeXXB7qJAmnl7xy09G9VncXMIBgr52K0s 4u4WvOKw2uDvdXPsmeGLR2yDrwG9irHo835bfDFndylsVScdVlgJW+y48co9/yka flWG4Onh5FThsIWd66rIzoICHrXGNxqW8FjW4fSA7NDhjbK+YV6uEOVQI6LhBlXf rI5LHQrdU7M= =gxvx -----END PGP SIGNATURE----- --=-=-=--