From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id qKWTMjp422YbrwAAqHPOHw:P1 (envelope-from ) for ; Fri, 06 Sep 2024 21:46:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id qKWTMjp422YbrwAAqHPOHw (envelope-from ) for ; Fri, 06 Sep 2024 23:46:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=T1Bb3nHv; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="U+/wN7t6"; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1725659194; 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: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=nGfhzr34Nq3ei/gGoDrdFdBHg1nCAB9HVOKmFos1cdE=; b=dywW8+/nx6i+ZgyCGSRe9jhUJ+byxT9OBzbF9iLUSwksWfGSKkgiR1sWC5puBq7l3yE16r QtEYAZaEcTcppghQu3Wo2CTUuzrtM5KIfr+rHngL9bjVDc5ZYllNCQS0RAjvKlpzU66TC2 KkrpBJsE+Pwae6bEvRC+FlnWszdQIbqORqwSH2OMmfDEdgWtD/FiC1Cim40J10UvXYoTlJ W21sXZGkcHsXV+GnLECbMNyfIpEa12Sfo/7eznyNSbHORzIRgbjbEF1GGwF74/gtV656PU y6GB8lV+q7IzDSW7tafBWVILyzL00bXyszreiIhpDAobETRfVt/B9zEE3ZsViA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725659194; a=rsa-sha256; cv=none; b=eBEVa6JyAM65tGDj1NI8eSGrnmuYfGpI00/tog7P1Irt84kRfqxcu+Au0/86f7eFhLxcTS F1ET7AmkWJR5FLd5znqlBEHhQekSadVEw71iFtpLJzAAkLKfr9yf0Bh9kZjmYZON0yqKr1 uEpSdafjz3KmyyC7unInnn8A1LvaV/ncjesiT1co42lNMGo3ZyrVhg6ZTz6nBSEFhPjcMN QjCO5L+F4rD7FPLZ7wKLI7WdOTSNdXOm4YguyJOH4SVEs+pU95loMK05bYKkjIpQlWG+aV +/d5tT0IW1tOvsUj0+G+lGgAzlbxUrbAwPnj7E568klJQuR7jJFRpsEhgPYD5Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=T1Bb3nHv; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="U+/wN7t6"; dmarc=pass (policy=none) header.from=gnu.org; 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" 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 C8A77755A3 for ; Fri, 06 Sep 2024 23:46:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smgmQ-0006MH-3v; Fri, 06 Sep 2024 17:46:10 -0400 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 1smgmJ-0006Lt-2t for guix-patches@gnu.org; Fri, 06 Sep 2024 17:46:03 -0400 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 1smgmI-0007uY-Q3 for guix-patches@gnu.org; Fri, 06 Sep 2024 17:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=nGfhzr34Nq3ei/gGoDrdFdBHg1nCAB9HVOKmFos1cdE=; b=T1Bb3nHvaGzpfHk/SC87PiUhLAuEF4yQNfhd7yuTu+uRuDQasV8808Ew5jl+NAwf16t9EylUK9L+zkm4lPMhjsU066aSfKAtZNIviK078QKfuSxCnASdYaH+6qsZsIJWsxk2VuauevZ1KZI6nDdF8S4n0wjyrnZ0bDOjxFNGBdyMiWehcPYXwrMhwqWgQzkrhS7bQZ8QhIX2Kdyz9B7yDQWwgGVw1ytB43NzlV3TSYgbukGXMm8nPCEBKp6+MR7zCh2E4dtp0nnGjA027JYUZXjidDwDBLtMeMq4qQVtq64eSSnuM4G4JyDcB77wMgJOCNwyY3AQ2lKMfpJvC6dKvg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smgmI-0001sx-DF for guix-patches@gnu.org; Fri, 06 Sep 2024 17:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73073] [PATCH 0/6] Allow origin with label as inputs. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 Sep 2024 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73073 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier Cc: maxim.cournoyer@gmail.com, 73073@debbugs.gnu.org Received: via spool by 73073-submit@debbugs.gnu.org id=B73073.17256591547229 (code B ref 73073); Fri, 06 Sep 2024 21:46:02 +0000 Received: (at 73073) by debbugs.gnu.org; 6 Sep 2024 21:45:54 +0000 Received: from localhost ([127.0.0.1]:54290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smgmA-0001sV-4M for submit@debbugs.gnu.org; Fri, 06 Sep 2024 17:45:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smgm7-0001sC-Mb for 73073@debbugs.gnu.org; Fri, 06 Sep 2024 17:45:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smgm0-0007td-SD; Fri, 06 Sep 2024 17:45:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=nGfhzr34Nq3ei/gGoDrdFdBHg1nCAB9HVOKmFos1cdE=; b=U+/wN7t6zzYQRuKwnja8 MHgIJ7hmJEbtfQgNMav9cCIcK8+4j2QWky+3QfftMsZjxEypqX1BVvQ9MdYWaXx0c3CXc4Mwjua7+ vJLC3JAUd5uMXrFOsFvLd1hhLjrj2MhIi/ZT3NVQqA49rRdOcYFBONYq6+LrhKnFcJHJdgGSidys2 0D+S+CsvbNYzWtsxNJ98LJq2KF4UotqEbXrCzxPXzt6yo/feFe/S30vdB38+/zMRkhBEK1hycrzhi sjSI3oB0o18tLSEY5tBemyn3UM6GVw/wvsUQmPWkFNk6tj3kydBZ9QneOYMRx44Pf9doIe0+V6cif Zqn3S/KAHxAIIg==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Simon Tournier's message of "Fri, 6 Sep 2024 17:51:14 +0200") References: Date: Fri, 06 Sep 2024 23:45:04 +0200 Message-ID: <87o750wj6n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.09 X-Spam-Score: -6.09 X-Migadu-Queue-Id: C8A77755A3 X-Migadu-Scanner: mx11.migadu.com X-TUID: WgsfqIDmvCqa --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Simon Tournier skribis: > The reason is because =E2=80=99sanitize-inputs=E2=80=99; see module (guix= packages). > > ((_ (list args ...)) > (add-input-labels args ...)) > ((_ inputs) > (maybe-add-input-labels inputs)))) [...] > The procedure =E2=80=99maybe-add-input-labels=E2=80=99 reads: if the firs= t element of > the =E2=80=99inputs=E2=80=99 record field is using the =E2=80=9Cold style= =E2=80=9C then return all > as-is, assuming all are =E2=80=9Cold style=E2=80=9D. Else apply to all t= he =E2=80=99inputs=E2=80=99 > elements the procedure =E2=80=99add-input-label=E2=80=99. Yes: as an optimization, we just check the first element or even just the syntax (whether the value starts with (list =E2=80=A6)). This is one reason why I=E2=80=99d rather avoid the change you=E2=80=99re s= uggesting. But more importantly: I think we should avoid polymorphic lists for clarity (the principle is followed in most of the code), and reintroducing labels would be a step backwards. To be clear, I understand the current situation is not perfect, but I would rather look for solutions that do not involve undoing what=E2=80=99s = taken this long to do. The main issue we want to address here is origins being hidden from =E2=80=98package-direct-sources=E2=80=99, right? What if we could do this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/packages.scm b/guix/packages.scm index f373136d22..624d3d8c45 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1320,7 +1320,16 @@ (define (package-direct-sources package) ((_ (? origin? orig) _ ...) orig) (_ #f)) - (package-direct-inputs package)))) + (package-direct-inputs package)) + (match (assoc #:phases (package-arguments package)) + ((#:phases (? gexp? phases) . _) + (filter-map (lambda (input) + (match (gexp-input-thing input) + ((? origin? o) o) + (_ #f))) + (gexp-inputs phases))) + (_ + '())))) (define (package-transitive-sources package) "Return PACKAGE's direct sources, and their direct sources, recursively." --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ? (Currently we can=E2=80=99t because =E2=80=98gexp-inputs=E2=80=99 is pri= vate.) Or, alternatively, we=E2=80=99d have origins without labels in inputs, with this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/packages.scm b/guix/packages.scm index f373136d22..8b08f0d379 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -676,6 +676,8 @@ (define (add-input-label input) "_") ,obj ,@(if (string=? output "out") '() (list output))))) + ((? origin? origin) + (list (or (origin-actual-file-name origin) "_") origin)) (x `("_" ,x)))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=80=A6 meaning we could write (this-package-input "git-manpages.tar.gz")= or similar. (This particular change would need tweaks in a few packages such as =E2=80=98tzdata=E2=80=99 to avoid a full rebuild.) WDYT? Thanks, Ludo=E2=80=99. --=-=-=--