From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YE3zCfXsVGFfMgAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 00:47:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YMOkBfXsVGEAEQAA1q6Kng (envelope-from ) for ; Wed, 29 Sep 2021 22:47:17 +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 821FE35474 for ; Thu, 30 Sep 2021 00:47:16 +0200 (CEST) Received: from localhost ([::1]:35158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mViM6-00058v-Tz for larch@yhetil.org; Wed, 29 Sep 2021 18:47:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mViLu-00058X-RU for guix-patches@gnu.org; Wed, 29 Sep 2021 18:47:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39227) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mViLu-0007Vm-K1 for guix-patches@gnu.org; Wed, 29 Sep 2021 18:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mViLu-0001PG-GD for guix-patches@gnu.org; Wed, 29 Sep 2021 18:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50620] [PATCH 1/2] guix: packages: Document 'computed-origin-method'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 22:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mark H Weaver , Liliana Marie Prikler Cc: 50620@debbugs.gnu.org Received: via spool by 50620-submit@debbugs.gnu.org id=B50620.16329555845355 (code B ref 50620); Wed, 29 Sep 2021 22:47:02 +0000 Received: (at 50620) by debbugs.gnu.org; 29 Sep 2021 22:46:24 +0000 Received: from localhost ([127.0.0.1]:50772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mViLI-0001OJ-Br for submit@debbugs.gnu.org; Wed, 29 Sep 2021 18:46:24 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:45902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mViLF-0001O2-PC for 50620@debbugs.gnu.org; Wed, 29 Sep 2021 18:46:22 -0400 Received: by mail-wm1-f49.google.com with SMTP id b192-20020a1c1bc9000000b0030cfaf18864so2834830wmb.4 for <50620@debbugs.gnu.org>; Wed, 29 Sep 2021 15:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=ggpZsnItJhtzi0N5WU94R8sgVRNfZh8h86e+N5XtFEc=; b=dh8YPkeX7uIYYYFqfdo9NDLjsz5jPH1uyaa342iBqHmVJhtse5dtJaytkfxfb6Iu6t LeL+6b7d/eK7rjQvmi0IUjXJoZoBkpJ89K/c9EFpG/9lG6ZhV6rC0eKyUoEKYLj/g8O+ bWBgHhK+v6Wgna3JSG3ufhw89ojlN0KxQu5nhChZ0+tGisL7+TmAkqP9xTJ5dQSIp8I1 sA4f178PoAv7giP5uJUKDE7AmyKi6fKKOw23/rUFrXtW138fZ/PYnB41/xH7IkyWA+7a 7NsoSdrxuaUxuhK/wmgD4FehrdGGE7eOSph7V4L9KhX327tuaYOSgoelQmCq81E21wIJ flYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=ggpZsnItJhtzi0N5WU94R8sgVRNfZh8h86e+N5XtFEc=; b=exqN87VNUq0W+DJqaQaBv6SIiu+/K6AfXCdG7/KJ3mwPIruBU+KiW3ZEhLt8WfPu4u GIPdBOaK1kuKKRbdjy3zsTf+DtEQwl51jaCvaMgeYwo92eu05QKJTU1vmnIEVzzS+Hk8 xPiESE/RdQoeK7hmbsVakc71/j98OFAVeu3LvSTl6n45LhN7xgV8T0Bp1znB7JN4xkLJ O8GNetVXXH0DASGuz5hI3KZ7NMlFnf9PS/Z9w0Nz42nkhDQ1RB0InP96FImbqNFuenDj 7M67VUfc5GOYq20uURR99jBbQdAFAU4WNPhm0K6J2COt7//2WJAhAk9wTkR50EfrHxrX sA6g== X-Gm-Message-State: AOAM533MT6vjy0y9Lfch8nA8MtJXG54KRltKGG0eeTqAfJP8i8ha6iCb wUzKotCurO7NiJ4aB0TdmiSUTZsIZb3Ikw== X-Google-Smtp-Source: ABdhPJxawga7FvKFaWX9vZB9REp1mErKjWIFcsebBdL6yU9RZFDgcQGbZad9WA6Hf6JYfYHiqOyvow== X-Received: by 2002:a05:600c:1c9a:: with SMTP id k26mr2281104wms.169.1632955575658; Wed, 29 Sep 2021 15:46:15 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id e8sm1096466wrr.42.2021.09.29.15.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 15:46:15 -0700 (PDT) From: zimoun In-Reply-To: <87ee97givh.fsf@netris.org> References: <20210916114734.2686426-1-zimon.toutoune@gmail.com> <9b6ee27ff10e1042a5d61d0f93d957cf760e9ecb.camel@gmail.com> <87v930ay5y.fsf@netris.org> <87pmstghx0.fsf@netris.org> <1803ff0456849f456c6994d47cbe50d1a8ff6a09.camel@gmail.com> <56dcce10a751153d89f515028cd18c9125f6b84f.camel@gmail.com> <756ae01852047a7adc2522c025c8cd7283dc7e55.camel@gmail.com> <87ee97givh.fsf@netris.org> Date: Thu, 30 Sep 2021 00:45:58 +0200 Message-ID: <86v92jc861.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632955636; 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=ggpZsnItJhtzi0N5WU94R8sgVRNfZh8h86e+N5XtFEc=; b=k5JmULmenKUEfmVpy7c8G6og3HmnADY33HB5wLJumugf9puSC06oCW0J3AxrXPDx3W9bsh 53RUXufBs7BKkT5z/aS88po/HFRwY9seA7x308Cg96+Ia6aWE+oux5tEJVXSesgx3MBpKK GvslzmEjQU6mEhgd0kwcupaOQ5+gXSvbUy8c6DLrmnMHI5kKNz6tAKGT81k+1ybgzsbRdq FFIoprlY7nYzmih+iyJ69eBVW613MMAaw5wOqBb+BPRucWXUqMQ6xlRP7jnixyFhajNofd wC5XrVnelG8dE9EdrWpRK3qkmcqiT91AOdvaJGQb//7zz6go5H57e7uNFhdKhg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632955636; a=rsa-sha256; cv=none; b=Q41sEHfIcj47gVoGCQZsRRHAVW1PkG7P/Nth8kxmUSZFXGXjtnhCHm1fM5kiK88PQPvZlW NeKklnG4MxvPkHpRxgW+pk2pcsq6Oyfpv/yUog4DGL7vm0nD9/jwwXHFg+2lPxsF1DcTgr UjgZiY9A/0GYuaWgDnBe5k+rujBapxOypccsGVE81bFEX5SaqSTySlLwkY9qhIcXGz9FqA JJdk7Y3F9NzM7cyLHzM7SPWbZSx57L0YfQ3Hm54uWiHEB92VvuakrkXuc7OwX1oL+ovTnS V9rB8mkuGV8TgikxrVPpXfoFVlBQ1WKziz/o/AmtKHaDb7GY2g9lL8XLtMjlIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dh8YPkeX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: -1.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dh8YPkeX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 821FE35474 X-Spam-Score: -1.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: 59BlNOE0/Xkz Hi Mark, On Wed, 29 Sep 2021 at 17:40, Mark H Weaver wrote: > zimoun writes: > To my mind, that's not good enough. I consider it unsafe, and poor > programming practice, to force a promise without first knowing what that > promise represents and what are the implications of forcing it. > > In projects as large as Guix, if it becomes accepted practice to > introduce lots of assumptions scattered around the code that are > "for now 100%" true, the result is eventually a very brittle project > where it's difficult to make changes without random stuff breaking. I agree=E2=80=A6 >> Option (2) is: >> >> ___ (or (eq? method (@@ (gnu packages gnuzilla) computed-origin-method)) >> _______ (eq? method (@@ (gnu packages linux) computed-origin-method))) >> >> then I ask you similarly: what is the probability of having packages >> using computed-origin-method in these 2 modules only? We do not know, >> but pragmatically, for now 100%. :-) > > The potential failure mode here is far less bad. In this case, if > someone else makes another clone of 'computed-origin-method' in another > module and forgets to update this code, the worst case is that some > source code fails to be added to SWH. Incidentally, I guess that's the > same outcome that would happen if someone adds a brand new > 'origin-method' and forgets to update this code. =E2=80=A6and I also agree. That=E2=80=99s why, right after this quotation,= I wrote: That's why the option (3): (eq? method (@@ (guix packages) computed-origin-method)) which means refactorize*. It is somehow the two worlds: check i.e., safer, no modules hard-coded and keep private the time to have The Right Plan for this computed-origin-method. which is *exactly* what you are asking, IIUC. To be honest, I do not understand why we are discussing at length this trivial path: for guix.git: 1. move the duplicate computed-origin-method to a single place 2. keep it private 3. add comments about that for guix-artwork.git: 4. guard the promise using a check against: (@@ (module somewhere) computed-origin-method) for guix.git 5. update the package guix done! :-) It changes nothing on the Guix side. Do we not agree on this trivial path? Re-reading from the starting point 50515 and then 50620, the trivial road appears to me clear. I apologize if it was not or to not make it explicit earlier. >From my understanding, we all agree, somehow; because it fixes the current situation and let the time to cook The Right Plan for this computed-origin-method. Where we can discuss is #2 but as it is already mentioned, it is out of scope for sources.json, IMHO. If I knew all what would happen, then I would send a v2 for 50515 using what you described as option (2). :-) My aim with this 50620 was just to simplify at very low cost the code (belonging to the repo guix-artwork.git) which generates . The v2 (adding a guard) for 50515 is simply waiting the output of this 50620; because this guard depends if computed-origin-method is defined at an unique location or at two different locations. =20=20 > Incidentally, I have a suggestion for how to avoid that failure mode > properly, once and for all: issue a warning if we're unable to identify > the 'method' of the origin at hand, calling attention to the fact that > there's an unhandled case in this code. This is precisely analogous to > Standard ML's *very* useful feature of issuing warnings at compile time > in case of an non-exhaustive 'match' form. The SWH reader which consumes this sources.json file does not care about a warning. And AFAIK no one is reviewing by hand this sources.json file. Specifically, the only purpose of this very file is to be consumed by the SWH infrastructure. It is automatically generated when the Guix website rebuilds; the content of this file depends on the version of the package guix. That=E2=80=99s said, there is room of improvement to track what is the arch= ival coverage by SWH. Today, we do not have a clear picture of the packages archived by SWH. By archived, it means packages for which Guix is able to fallback and lookup using the SWH archive. Well, now one foot, now the other. :-) (On a side note, I agree that this ML feature is very useful. From my understanding, it requires a kind of type system that Guile does not have. Sadly.) > In any case, thanks very much for your efforts to push this issue toward > resolution. Thanks. At one point, I felt demotivated then reconsidering the energy we all are putting it, we have to resolve. :-) All the best, simon