From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0KYoKRxohmPCfgEAbAwnHQ (envelope-from ) for ; Tue, 29 Nov 2022 21:14:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MIAdKBxohmNesgAAG6o9tA (envelope-from ) for ; Tue, 29 Nov 2022 21:14:20 +0100 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 61EB43A576 for ; Tue, 29 Nov 2022 21:14:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p06z4-0008Nh-Uq; Tue, 29 Nov 2022 15:13:38 -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 1p06z3-0008MM-OE for guix-devel@gnu.org; Tue, 29 Nov 2022 15:13:37 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p06z1-0003J4-KJ; Tue, 29 Nov 2022 15:13:37 -0500 Received: by mail-wm1-x32c.google.com with SMTP id m7-20020a05600c090700b003cf8a105d9eso11662981wmp.5; Tue, 29 Nov 2022 12:13:34 -0800 (PST) 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:message-id :reply-to; bh=bSQF2udkKRewsJheKV7bRSPX56X4Ysh9eMbOy/B5Yp4=; b=ZUom/4Tee2RvyDrIBbppT/m3cMuGK39ZRxew3RZ3IqN3wIamarY3RN2+WzOhbLDi2H YfykJAbBbtIo0Y8ll7dBkTP6b3MbhWtN2Nh9d+Gj15KYbt6UksmdxF0QQgl9opIuQune Izzqi0Dht2wfB1Db+pNj63n312pqViZpKRZnJ/wXdjTNcxMqUvXCiYeDcGUBeKeIu6y8 ewFE7QqaFuqv6Ad8YN8em1GHdRPNjCCG3sYg5Ei31S+E9xaK5x4U3FVPSxucq65zwR/G A4uJm/QzRuhOHK6UnbAuXsyGVKQhgLNDX8TGwvRlKm8CxD6PRiK7cbgK2LYhUa0MvXNG //5g== 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:message-id:reply-to; bh=bSQF2udkKRewsJheKV7bRSPX56X4Ysh9eMbOy/B5Yp4=; b=8FEnH7Sfjq/OpQP5Yeb1VEwB1PybJamg57jEoHzhXY/BiIHFxUhS6i11nZM+vaSFx/ 1z0uHurtR16b/Q2k0wlLS119IZHAk7LS+iYlkL/kKxiefMKgmpH2ayeW2MIs2LRZ57y1 cYvsF4oynu3k6/lF5BwLf/quqouFK5peAmJor+vabnnT5krwrdGzZpFjWWGnMG41UCO5 6eyVg/PqfBjbt3OUoV0RNTzHdt8JRhHtlml3+XqSzJQhVhXwjfaTqAMxM9clzt40ufVq Yj4KZw2/QqdWwCm+yR15GXbZdkcWrLcOPlufAzb9ACY5FuWb7ve5JYjRWHcMMgdCg+LL XHDw== X-Gm-Message-State: ANoB5pldvNhnkhHHEmeNS6ruM/t5RyuR1FHnwfMVffCXdBHruqEPU+ib 6hg3YBrY2Vj4MM2WE6O9fJ3Df1pHPfI= X-Google-Smtp-Source: AA0mqf6a5iat71+GV6GHpUmjcIL78XTNsAdFR7FUV6HizaUtq2dw20CCvlP/8hHEqAXRfy12xudOsA== X-Received: by 2002:a7b:cbc6:0:b0:3c6:b650:34dd with SMTP id n6-20020a7bcbc6000000b003c6b65034ddmr36460759wmi.45.1669752813120; Tue, 29 Nov 2022 12:13:33 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id dn6-20020a05600c654600b003cf894dbc4fsm3179996wmb.25.2022.11.29.12.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 12:13:32 -0800 (PST) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix Devel Subject: Re: how to customize mirror list used in custom channels? In-Reply-To: <87o7sq6tki.fsf@gnu.org> References: <86lenzctmv.fsf@gmail.com> <87zgce9di8.fsf@gnu.org> <86ilj01tv2.fsf@gmail.com> <87zgcbe4lf.fsf@gnu.org> <87wn7fs0kt.fsf@gmail.com> <87o7sq6tki.fsf@gnu.org> Date: Tue, 29 Nov 2022 20:02:45 +0100 Message-ID: <86bkop7fe2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669752860; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=bSQF2udkKRewsJheKV7bRSPX56X4Ysh9eMbOy/B5Yp4=; b=jFuUaISV8dpbRR44r8IFuOKWZVEQmdazqOWoCpo0HIuTJdxIqQoQyWL2wQU0ZY7LgG3pKD K9ayMxOyfII/qdt6aeFQcV3XWHm/EChMYzldrc+UxlVbsQpXO1DsC8Wlgfo5LSKR2OZjya DMVW+/ROmak901RECXXKZRGBwvKAkg61ME7K3UPenZZe6S+A7EKLg6RYFAq5Wf14muIlnO n66VA4liPDWyh/1a2YZxBxOQoZgH7oBYhtw6pKu3hnR6bEzSJOOR8DyXwZIHd/2aJ58ovd qZXN59ww/0w/eeqTFYpBij/KerHbedPuEFEIhKBC/KtCtqSZfVJ8j+q6XSD+XA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669752860; a=rsa-sha256; cv=none; b=nHgakb70IXmA0IdBqyRABKJ2ceAWdbCJuW5gLCvP6UCijs7VY6CGM+4eww/Db1XqBEjgJO LXzUc/JQVULhUxVBYDBnG4a9TQRUFvWL+O1Y8J2PAzcoMLYPo7I/B1TaRhRo4GKxp+xJbI +Wj61RB2U4W30rfMi1Vyky8HtCdCSIudR3F9wFeX00fdiyfSB5EDSCSi8b05haKopOH1vk 0fryFy920+4Y6XKMI9LFpHMzabPQNk0UcYT3NhUskZH5fbSapAAF1UOUKrL35I4zjai1kA 0sMGDvivomFjLrbNTVStUi2cPzyQpG6L28skavq5fnuaHR9rzzhb+lUNaAA4TQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZUom/4Te"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.96 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZUom/4Te"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 61EB43A576 X-Spam-Score: -2.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: tUo3GaU1KISZ Hi, On Tue, 29 Nov 2022 at 09:41, Ludovic Court=C3=A8s wrote: > The more I write, the closer I get to an actual implementation. :-) > If =E2=80=98url-fetch=E2=80=99 takes a #:mirrors, that should allow us to= extend the set > of mirrors quite conveniently, along the lines of: > > (define (my-url-fetch . args) > (apply url-fetch (append args '(#:mirrors =E2=80=A6)))) Well, the =E2=80=99url-fetch=E2=80=99 defined in (guix build download) alre= ady takes #:mirrors, no? --8<---------------cut here---------------start------------->8--- (define* (url-fetch url file #:key (timeout 10) (verify-certificate? #t) (mirrors '()) (content-addressed-mirrors '()) (disarchive-mirrors '()) (hashes '()) print-build-trace?) --8<---------------cut here---------------end--------------->8--- So, I guess you are talking about =E2=80=99url-fetch*=E2=80=99 from (guix d= ownload) and exported as =E2=80=99url-fetch=E2=80=99. Right? The one which put the bit= s in the store. :-) Does something like that would make sense? --8<---------------cut here---------------start------------->8--- diff --git a/guix/download.scm b/guix/download.scm index 2e9ecb43fc..2497ea0f75 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -499,6 +499,7 @@ (define %download-fallback-test (define* (url-fetch* url hash-algo hash #:optional name #:key (system (%current-system)) + (mirrors %mirrors) (guile (default-guile)) executable?) "Return a fixed-output derivation that fetches data from URL (a string, = or a @@ -519,7 +520,8 @@ (define file-name (_ (basename url)))) =20 - (let ((uri (and (string? url) (string->uri url)))) + (let ((uri (and (string? url) (string->uri url))) + (mirror-file (plain-file "mirrors" (object->string mirrors)))) (if (or (and (string? url) (not uri)) (and uri (memq (uri-scheme uri) '(#f file)))) (interned-file (if uri (uri-path uri) url) @@ -540,7 +542,7 @@ (define file-name #:hash-algo hash-algo #:hash hash #:executable? executable? - #:mirrors %mirror-file + #:mirrors mirror-file #:content-addressed-mirrors (match (%download-fallback-test) ((or #f 'content-addressed-mirrors) --8<---------------cut here---------------end--------------->8--- This change would a world rebuild, right? Last, note that =E2=80=99download-to-store=E2=80=99 uses %mirrors so it see= ms straightforward here to add =E2=80=99#:key (mirrors %mirrors)=E2=80=99, I g= uess. Cheers, simon