From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oMM6G+p7LWN91gAAbAwnHQ (envelope-from ) for ; Fri, 23 Sep 2022 11:27:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kCROG+p7LWPlTgAA9RJhRA (envelope-from ) for ; Fri, 23 Sep 2022 11:27:06 +0200 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 E87BA2E6C7 for ; Fri, 23 Sep 2022 11:27:05 +0200 (CEST) Received: from localhost ([::1]:40604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obexc-0003Bj-T0 for larch@yhetil.org; Fri, 23 Sep 2022 05:27:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obewd-00039A-RN for guix-patches@gnu.org; Fri, 23 Sep 2022 05:26:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obewd-00008J-J6 for guix-patches@gnu.org; Fri, 23 Sep 2022 05:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obewd-0005pR-EY for guix-patches@gnu.org; Fri, 23 Sep 2022 05:26:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58017] bug#57978: [PATCH 2/2] substitute: Retry downloading when a nar is unavailable. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 09:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58017 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 58017@debbugs.gnu.org Cc: Attila Lendvai , 57978@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 58017-submit@debbugs.gnu.org id=B58017.166392513722339 (code B ref 58017); Fri, 23 Sep 2022 09:26:03 +0000 Received: (at 58017) by debbugs.gnu.org; 23 Sep 2022 09:25:37 +0000 Received: from localhost ([127.0.0.1]:39449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obewC-0005o8-Ng for submit@debbugs.gnu.org; Fri, 23 Sep 2022 05:25:37 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:45590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obew9-0005nL-Dh; Fri, 23 Sep 2022 05:25:34 -0400 Received: by mail-wm1-f44.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so2841064wms.4; Fri, 23 Sep 2022 02:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=6hmTHHlYrLLRksYrRPV/cZKh1q81dRJpJQVP0qEWTx8=; b=NElmsQAE53geHDpcg2EsYEFkr9vIAmyODGQ57hFhyy2zed57TJoDdWQ9Lh2lmq899G jQGnj/I/scPhcZF790VJrlpiqDvF/Yr2uq1gyVUzFVXqhFuXs+kJojrL58wI7FU6Fs/z 1krL38yaJ8bv49FKy9C5fQIrS7oAMcaW8hOOhYd6wGaPgL6aT6QuVdTq8qqOXZpe/Ggj jyDgYtL9s4yUUZPXrAcywSLtYqt84mCvZXAxejZtG1vU+5Jq+U73yVBPmpDeZ5HJml9x Qi0yq1u5FZc2xarkLUmuU21ePO+7lEFwSKTgX4c7EEiGOyylsDQz9i7npbnLJFxI8eBj kmYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=6hmTHHlYrLLRksYrRPV/cZKh1q81dRJpJQVP0qEWTx8=; b=k6/2gFyOc8bndZhy+8HPTwZnSzDO9LMTfRnu12y0veE5gB+n61MCPFukOY0+R0qxAn CJ0qOCazFF+b/1JcYfiZqLFskbydg1aO/vVBeC42E37q4ySDwsu/9FnOeOkGcsIn5gP9 mdRw2zlTqZ5RWQf+W3WSs317nxKZgND9CG7CqnnSPk0nFk4nvsYAcMHS8dHFWHleS3+T +quQ7IjLJzMDO2PRqxcU0TVvgxh0LKW2i5gt6ZqaEWUqV1MBOmGnCAvF87OFHJhQcAkN Yhmrufjw/TUZ3+uajMdZCRpiPyL/X08INeY55il2XPjew9UYiduBwrF/MZc+4AVJYxp+ AFJA== X-Gm-Message-State: ACrzQf0MCi1ffxPkxugwJHPKU4znj0SHnUvy5pbfOSU31kannbzZst96 Z1kZmLUkiVxCLP9GkSDqD0Y= X-Google-Smtp-Source: AMsMyM4MliwE7aUrD/TKPOcjRicUOhkmG2NwSq1iKw6A/oLyv/ieAmRwJadT3aVrm//xFaSrabUx8w== X-Received: by 2002:a05:600c:500c:b0:3b4:92e4:c77c with SMTP id n12-20020a05600c500c00b003b492e4c77cmr5197900wmr.41.1663925127495; Fri, 23 Sep 2022 02:25:27 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id f12-20020adffccc000000b0022afddab5dfsm7259621wrs.7.2022.09.23.02.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 02:25:27 -0700 (PDT) From: zimoun In-Reply-To: <20220923061957.5658-2-ludo@gnu.org> References: <20220923061957.5658-1-ludo@gnu.org> <20220923061957.5658-2-ludo@gnu.org> Date: Fri, 23 Sep 2022 10:17:16 +0200 Message-ID: <87pmfmcxo3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663925226; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6hmTHHlYrLLRksYrRPV/cZKh1q81dRJpJQVP0qEWTx8=; b=CtQbeTNEhpvKz4kP2tRRaTkNoVljEtvqVeWByz70jPhduMhstQ/9p3mfulC+hkUNded49C tj/rq6ep5hJgChHXxJ3dWYgJPPqcqIDjnhYG8WDpZSgsQVFIRVuoBYLMqCcN/fSFVnmQRc KvM/TW/faYt3lSIURIuJiYquAW+DIZQlrlxkO8WbcZgGowzpWyRcLitBOGryFp3Mw9NoNv VgvtXF3guJdO6wfo6JUpO+0LzRHupQ2Xli7x3Vd6XWMhHyRglAD+CRIiubF3R0NzJ+T//Q KarB5auQCl7vFT6+4pQaILDcQY9y5vt6z8xb99R0xQ14ujlS94J7QTktnDH+uw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663925226; a=rsa-sha256; cv=none; b=CMOac40K1GrlAkkZ9RvtZG5p17a88iXDn0XKOGJMO2bRoBieSCSeVURO4TSK8XgJwouuzv DyzVn1T6tnO/qdbmjRnY4Wld4OaBKdWk+egyWotJP5c2Qv+2yJjWFWfkrpwf+yfKrmMKtq TnnYAjUn6l89nSP8+RPQ7yeuCFlpUeYnPSu0tnqigMzSRj+qtiq1YPujorVXAitBnuTmcw G3Uu5j4u0O0Gd56KFgn32ivW6nYn+yQqMQYHNYQpDOGWIZ2cPbg5lkwGlRBcqUrj4QXb18 +M32dkOKgwg0Mwtk4YNh25DqGJO+8uJIOSJLbbrNs2dBLScJPArx8zQkpoT5Gg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=NElmsQAE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=NElmsQAE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E87BA2E6C7 X-Spam-Score: 7.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: 6cCebDwPxO5l Hi, On ven., 23 sept. 2022 at 08:19, Ludovic Court=C3=A8s wrote: > Fixes > Reported by Attila Lendvai . > > Previously, if a narinfo was available but its corresponding nar was > missing (for instance because the narinfo was cached and the server > became unreachable in the meantime), 'guix substitute --substitute' > would try to download the nar from its preferred location and abort when > that fails. This change forces one retry with each of the URLs. > > * guix/scripts/substitute.scm (download-nar): Do not catch > 'http-get-error?' exceptions. > (system-error?, network-error?, process-substitution/fallback): New > procedures. > (process-substitution): Call 'process-substitution/fallback' upon > 'network-error?'. > * tests/substitute.scm ("substitute, first URL has narinfo but lacks nar,= second URL unauthorized") > ("substitute, first URL has narinfo but nar is 404, both URLs authorized") > ("substitute, first URL has narinfo but nar is 404, one URL authorized") > ("substitute, narinfo is available but nar is missing"): New tests. LGTM. > +(test-equal "substitute, first URL has narinfo but nar is 404, one URL a= uthorized" > + "Substitutable data." > + (with-narinfo* > + (string-append %narinfo "Signature: " > + (signature-field > + %narinfo > + #:public-key %wrong-public-key)) > + %main-substitute-directory > + > + (with-http-server `((200 ,(string-append %narinfo "Signature: " > + (signature-field > + %narinfo > + #:public-key %wrong-public= -key))) > + (404 "Sorry, nar is missing!")) > + (let ((url1 (%local-url))) > + (parameterize ((%http-server-port 0)) > + (with-http-server `((200 ,(string-append %narinfo "Signature: " > + (signature-field %nar= info))) > + (404 "Sorry, nar is missing!")) > + (let ((url2 (%local-url))) > + (dynamic-wind > + (const #t) > + (lambda () > + (parameterize ((substitute-urls > + (list url1 url2 > + (string-append "file://" > + %main-substitute-= directory)))) > + (request-substitution (string-append (%store-prefix) > + "/aaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaa-foo") > + "substitute-retrieved")) > + (call-with-input-file "substitute-retrieved" get-strin= g-all)) > + (lambda () > + (false-if-exception (delete-file "substitute-retrieved= "))))))))))) Although I do not understand this test. Why is 404 appearing twice? Cheers, simon