From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OFUvJbsA1WW/3wAAqHPOHw:P1 (envelope-from ) for ; Tue, 20 Feb 2024 20:42:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id OFUvJbsA1WW/3wAAqHPOHw (envelope-from ) for ; Tue, 20 Feb 2024 20:42:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708458171; 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; bh=fh8pLPxYiNbDXiAb9fhoOcj8nj6d0ppDsjPFSqg3Wi0=; b=kRk8QZxynTIgzV6cVPJlrSeujtWo/iBee0f0dE1FvMJdqkAHC6OP5XoDnCEZDcrOh5SRWn NKm+LCnnEKW/XKWSAb5b3RnOqD2Otx9Cfz7HDfGJcdC6kv8O6y9rKmIdNL/EtQNNHqQi2k +YBISZdeXPRMYP1bGCxfaoBZG1gT/tYPE8UvHb3nyHdLlCuibgsXtXYWjrfoDP7fC5RxnR QgRIyDr/CdUgVXeDCx5i0wjbPJ8s86P24cp0dqYvddzDiMc/bLBoWg9Vu3c8EKShnXjO6D DYA/PCYS7gUN+7x5dKFU7ZO7V+Pll/Kp2CsL4iFK3QSkrEBmF1RzUGYEd2HL9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708458171; a=rsa-sha256; cv=none; b=i0HXauXqqBGZm3PbOSvAWLJIffETg0XKLxFrZ8a6xXHdA5tK8rL3qq73m/1IQr/Inry121 HkuI2qD0yPrlwMwY5xiLqgDaBTtd4Vyvo/NWR8RLwZw4HUYZV3xb/fAtdz8uGFqjDWjwBa 0EQYOAMaD5ueVg0StcVAsnCC7ZqbqauDuodMAEorQYRfhCrM7C7/43UHnPekQYXgihCCQ8 ssZs4EvnCH0NNjHGPh761vTc23PUAIZHP3Gpw8vrpC5eajf+TLdcqlpJ03CSEnL3oYs2ux wTSUaYRv4Xrab9IAsw0BcSWWPyiaPMpliXrk5BZcKW3S7k9dEGMJDUB0Hjg9FQ== 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 78A1C187A6 for ; Tue, 20 Feb 2024 20:42:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcW0q-0004D1-VV; Tue, 20 Feb 2024 14:42:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcW0p-0004CB-D9 for guix-patches@gnu.org; Tue, 20 Feb 2024 14:42:43 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcW0p-00016F-4T; Tue, 20 Feb 2024 14:42:43 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcW18-0002ZM-Nj; Tue, 20 Feb 2024 14:43:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69291] [PATCH 1/5] scripts: substitute: Remove side effect warning from network-error?. References: <87le7flz89.fsf@cbaines.net> In-Reply-To: <87le7flz89.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 20 Feb 2024 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69291 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69291@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69291-submit@debbugs.gnu.org id=B69291.17084581769831 (code B ref 69291); Tue, 20 Feb 2024 19:43:02 +0000 Received: (at 69291) by debbugs.gnu.org; 20 Feb 2024 19:42:56 +0000 Received: from localhost ([127.0.0.1]:46675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcW11-0002YQ-Tc for submit@debbugs.gnu.org; Tue, 20 Feb 2024 14:42:56 -0500 Received: from mira.cbaines.net ([212.71.252.8]:43154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcW0x-0002Xo-AB for 69291@debbugs.gnu.org; Tue, 20 Feb 2024 14:42:51 -0500 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id EBE3527BBE2 for <69291@debbugs.gnu.org>; Tue, 20 Feb 2024 19:42:28 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 3127bf43 for <69291@debbugs.gnu.org>; Tue, 20 Feb 2024 19:42:28 +0000 (UTC) From: Christopher Baines Date: Tue, 20 Feb 2024 19:42:23 +0000 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -3.98 X-Spam-Score: -3.98 X-Migadu-Queue-Id: 78A1C187A6 X-TUID: dbocaPXXBT+4 Instead, display the warning from process-substitution and process-substitution/fallback in the relevant places. I'm looking at this because I want to make the substitute code less tied to the script and usable in the Guile guix-daemon. * guix/scripts/substitute.scm (network-error?): Move warning to… (process-substitution/fallback, process-substitution): here. Change-Id: I082b482c0e6ec7e02a8d437ba22dcefca5c40787 --- guix/scripts/substitute.scm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 37cd08e289..f3eed0eb44 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -613,13 +613,7 @@ (define network-error? (and (kind-and-args? exception) (memq (exception-kind exception) '(gnutls-error getaddrinfo-error))) - (and (http-get-error? exception) - (begin - (warning (G_ "download from '~a' failed: ~a, ~s~%") - (uri->string (http-get-error-uri exception)) - (http-get-error-code exception) - (http-get-error-reason exception)) - #t)))))) + (http-get-error? exception))))) (define* (process-substitution/fallback port narinfo destination #:key cache-urls acl @@ -647,7 +641,13 @@ (define* (process-substitution/fallback port narinfo destination (if (or (equivalent-narinfo? narinfo alternate) (valid-narinfo? alternate acl) (%allow-unauthenticated-substitutes?)) - (guard (c ((network-error? c) (loop rest))) + (guard (c ((network-error? c) + (when (http-get-error? c) + (warning (G_ "download from '~a' failed: ~a, ~s~%") + (uri->string (http-get-error-uri c)) + (http-get-error-code c) + (http-get-error-reason c))) + (loop rest))) (download-nar alternate destination #:status-port port #:deduplicate? deduplicate? @@ -675,6 +675,11 @@ (define* (process-substitution port store-item destination store-item)) (guard (c ((network-error? c) + (when (http-get-error? c) + (warning (G_ "download from '~a' failed: ~a, ~s~%") + (uri->string (http-get-error-uri c)) + (http-get-error-code c) + (http-get-error-reason c))) (format (current-error-port) (G_ "retrying download of '~a' with other substitute URLs...~%") store-item) base-commit: 3d061d9677027be7651f8e5a3a02e19daacd9a85 -- 2.41.0