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 MCK3Cu1U11+XdgAA0tVLHw (envelope-from ) for ; Mon, 14 Dec 2020 12:05:01 +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 GDB6Bu1U11+SYQAAB5/wlQ (envelope-from ) for ; Mon, 14 Dec 2020 12:05:01 +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 A58309401BF for ; Mon, 14 Dec 2020 12:05:00 +0000 (UTC) Received: from localhost ([::1]:45476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kolh7-0000Jh-Tp for larch@yhetil.org; Mon, 14 Dec 2020 06:07:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kolh0-0000IW-Qw for guix-patches@gnu.org; Mon, 14 Dec 2020 06:07:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kolh0-0006lh-K5 for guix-patches@gnu.org; Mon, 14 Dec 2020 06:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kolh0-0008Q9-FB for guix-patches@gnu.org; Mon, 14 Dec 2020 06:07:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45104] pull: Add a "with-substitutes" option. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Dec 2020 11:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45104 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Christopher Baines Received: via spool by 45104-submit@debbugs.gnu.org id=B45104.160794397232314 (code B ref 45104); Mon, 14 Dec 2020 11:07:02 +0000 Received: (at 45104) by debbugs.gnu.org; 14 Dec 2020 11:06:12 +0000 Received: from localhost ([127.0.0.1]:51381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kolg9-0008P5-Aw for submit@debbugs.gnu.org; Mon, 14 Dec 2020 06:06:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kolg4-0008OF-Hm for 45104@debbugs.gnu.org; Mon, 14 Dec 2020 06:06:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50194) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kolfz-0006gm-8Y; Mon, 14 Dec 2020 06:05:59 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40050 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kolfv-0004Xh-Mt; Mon, 14 Dec 2020 06:05:57 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87eek1vd4g.fsf@gnu.org> <87a6uohztw.fsf@cbaines.net> Date: Mon, 14 Dec 2020 12:05:54 +0100 In-Reply-To: <87a6uohztw.fsf@cbaines.net> (Christopher Baines's message of "Tue, 08 Dec 2020 19:17:47 +0000") Message-ID: <877dpktzot.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) 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: , Cc: Mathieu Othacehe , 45104@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: -2.81 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: A58309401BF X-Spam-Score: -2.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: OE36L3M4zjg1 Hi! Christopher Baines skribis: > My first thought is that the option doesn't really do what it says it > will do. The option is named --with-substitutes, but that actually means > something like "with successful build on ci.guix.gnu.org". This could > cause confusion if you're not fetching substitutes from ci.guix.gnu.org, > and it starts building things, or perhaps if you're fetching substitutes > from two servers, one of which is ci.guix.gnu.org which doesn't have a > substitute, but the other server does, this option would fetch an older > revision than what's truly available. > > Maybe part of what I've said above is incorrect if a users substitute > URLs are used, but there also seems to be an assuption that something > which provides substitutes provides a Cuirass compatible API, which > isn't always the case. > > One more thought on this is that it's probably important to convey that > this doesn't pick a revision where substitutes will be available. I > think this is something some users would be eager to assume, and then be > confused when it doesn't work. Agreed on these points. Another option would be to leave it up to users to customize their channel file to run pretty much the code you posted, like: --8<---------------cut here---------------start------------->8--- (use-modules (guix ci) (srfi srfi-1) (ice-9 match)) (define (latest-commit-successfully-built) "Return the latest commit for which substitutes are (potentially) available." (let* ((evaluations (filter (lambda (evaluation) (and (evaluation-complete? evaluation) (string=3D? "guix-modular-master" (evaluation-spec evaluation)))) (latest-evaluations "https://ci.guix.gnu.org"= )))) (any (lambda (evaluation) (match (evaluation-checkouts evaluation) ((checkout) (checkout-commit checkout)) (_ #f))) evaluations))) ;; Pull the latest commit fully built on berlin.guixsd.org. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit (pk 'commit (latest-commit-successfully-built))))) --8<---------------cut here---------------end--------------->8--- We don=E2=80=99t want people to copy/paste all this, so we could instead pr= ovide and document a procedure that takes a channel and substitute URL and returns a channel, like: (channel-with-substitutes-available (channel (name 'guix) =E2=80=A6) "https://ci.guix.gnu.org") and optionally with a manifest or a list of packages that should be available as substitutes: (channel-with-substitutes-available (channel (name 'guix) =E2=80=A6) "https://ci.guix.gnu.org" (specifications->manifest '("emacs" "guile"))) WDYT? It does mean that we=E2=80=99re asking users to do extra work. Perhaps the= re could still be a command-line option that would call =E2=80=98channel-with-substitutes-available=E2=80=99 for you, but at least = it would take an explicit URL and clarify what Chris mentioned? BTW, doing all this is safer today because =E2=80=98guix pull=E2=80=99 will= detect and prevent downgrades. Though an attacker who manages to break into ci.guix.gnu.org could cause all the users of =E2=80=98channel-with-substitutes-available=E2=80=99 to no longer receive u= pdates or to receive them more slowly than they appear in Git simply by making CI even slower than it currently is. Thoughts? Ludo=E2=80=99.