GNU logs - #65062, boring messages


Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 0/1] Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Sat, 05 Aug 2023 02:52:02 +0000
Resent-Message-ID: <handler.65062.B.16912038864297 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 65062 <at> debbugs.gnu.org
Cc: Hilton Chain <hako@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-To: guix-patches@HIDDEN
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.16912038864297
          (code B ref -1); Sat, 05 Aug 2023 02:52:02 +0000
Received: (at submit) by debbugs.gnu.org; 5 Aug 2023 02:51:26 +0000
Received: from localhost ([127.0.0.1]:55140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qS7O1-00017E-Q8
	for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 22:51:26 -0400
Received: from lists.gnu.org ([2001:470:142::17]:36880)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qS7O0-00016z-9s
 for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 22:51:24 -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 <hako@HIDDEN>)
 id 1qS7Nu-0004i0-Ok
 for guix-patches@HIDDEN; Fri, 04 Aug 2023 22:51:18 -0400
Received: from mail.boiledscript.com ([144.168.59.46])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1qS7Nr-0003K3-Rk
 for guix-patches@HIDDEN; Fri, 04 Aug 2023 22:51:17 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1691203865;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=jFjpDppUCp8M7BGMtEtHCXKxEOQrHJO0Vy1HGDmqhlQ=;
 b=cg1lypVGfj29X3H0zN3IS1pavcRiH47apgoDiAKxT6c40IjNGaRK2ZxlDCYxWqbO7faFM5
 X1TfrW2V6q1ldYwdwESmMkxyBbxB1KmXRNUw5UAg+7ZCB4v4rOU16av7UDyqv+AY3FdBh0
 rFIr1As7t6ZrOiCMGrIYDaT85Zbq2R+MIRnJuFHQdeT+Cpv401u59z9fFycAA5Qabga4eb
 wxD9DbPZQQWFtQFomvhkxNt8vVICMmqvbsJBmOa/b97kTlfPPrxNvKPiLsb5Q6StqXuzMS
 qU2JBNzrsJEaRuGuJfaIsptl4vXQ6LOicyOMG8POrElNolGHuJT4Iq02O0GMGA==
Date: Sat,  5 Aug 2023 10:50:32 +0800
Message-ID: <cover.1691202289.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
X-Spam-Level: *
X-Spamd-Bar: +
Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@HIDDEN;
 helo=mail.boiledscript.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, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hello Guix,

Recently I found it not possible to find `(,gcc "lib") in inputs with
`this-package-input' since it has the label "gcc" and there're other "gcc"s
in the build environment.

As we should avoid direct use on input labels, I think the solution is to
modify `add-input-label', hence the patch.

Taking `aide' from (gnu packages admin) as an example, the current behavior is
that both `pcre:static' and `pcre' have the label "pcre", this affects
`this-package-input' and `modify-inputs':
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use (guix packages)
scheme@(guix-user)> ,use (gnu packages admin)
scheme@(guix-user)> ((@@ (guix packages) add-input-label) (package-inputs aide))
$1 = ("_" ([...]
           ("pcre" #<package pcre@HIDDEN gnu/packages/pcre.scm:41 7f59cd759bb0> "static")
           ("pcre" #<package pcre@HIDDEN gnu/packages/pcre.scm:41 7f59cd759bb0>)
           ("zlib" #<package zlib@HIDDEN gnu/packages/compression.scm:106 7f59c130bd10> "static")
           ("zlib" #<package zlib@HIDDEN gnu/packages/compression.scm:106 7f59c130bd10>)))
--8<---------------cut here---------------end--------------->8---

With the patch appiled, `pcre:static' has the label "pcre:static", while
`pcre' stays "pcre":
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use (guix packages)
scheme@(guix-user)> ,use (gnu packages admin)
scheme@(guix-user)> ((@@ (guix packages) add-input-label) (package-inputs aide))
$1 = ("_" ([...]
           ("pcre:static" #<package pcre@HIDDEN gnu/packages/pcre.scm:41 7f6fe32efe70> "static")
           ("pcre" #<package pcre@HIDDEN gnu/packages/pcre.scm:41 7f6fe32efe70>)
           ("zlib:static" #<package zlib@HIDDEN gnu/packages/compression.scm:106 7f6fd244a000> "static")
           ("zlib" #<package zlib@HIDDEN gnu/packages/compression.scm:106 7f6fd244a000>)))
--8<---------------cut here---------------end--------------->8---

Thanks

Hilton Chain (1):
  packages: Specify output in input label when it's not "out".

 guix/packages.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


base-commit: 8852e6bb5521edca099d6f346efc92db3244584c
--
2.41.0




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Hilton Chain <hako@HIDDEN>
Subject: bug#65062: Acknowledgement ([PATCH core-updates 0/1] Specify
 output in input label when it's not "out".)
Message-ID: <handler.65062.B.16912038864297.ack <at> debbugs.gnu.org>
References: <cover.1691202289.git.hako@HIDDEN>
X-Gnu-PR-Message: ack 65062
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 65062 <at> debbugs.gnu.org
Date: Sat, 05 Aug 2023 02:52:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

As you requested using X-Debbugs-CC, your message was also forwarded to
  Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>,=
 Ludovic Court=C3=A8s <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, =
Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN=
om>, Tobias Geerinckx-Rice <me@HIDDEN>
(after having been given a bug report number, if it did not have one).

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 65062 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
65062: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D65062
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Sat, 05 Aug 2023 02:54:02 +0000
Resent-Message-ID: <handler.65062.B65062.16912040314579 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 65062 <at> debbugs.gnu.org
Cc: Hilton Chain <hako@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.16912040314579
          (code B ref 65062); Sat, 05 Aug 2023 02:54:02 +0000
Received: (at 65062) by debbugs.gnu.org; 5 Aug 2023 02:53:51 +0000
Received: from localhost ([127.0.0.1]:55151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qS7QN-0001Bn-CT
	for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 22:53:51 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:49610)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qS7QL-0001Bd-H9
 for 65062 <at> debbugs.gnu.org; Fri, 04 Aug 2023 22:53:49 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1691204022;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=80YGeaEuUV+t/P9y3Q5lVAqZ9pdW4e/EPgFNg3wXrw8=;
 b=qKpQoOBcvhnzUHSy1IvYKwszFAviv6CWuvAVI/F+0LKFYsW4aCD924k8w/ruF+GxPe9w4F
 XgJd3KKUGmjadXpzs6UDYAzUg8I4YxODXZ+Fv0spuRM1xfZ8BdW9kfSiWqXox4mZefWAzu
 +RP/cE8rWuktPA2kkkWEX8qcmHvA6HNiCXt1d8VWS5G3oRy0mUMv4rOtLWE+4QTRN6bdDg
 sGvkUPnGJXuWAjo4XtWDrT2qUH4Pb3vS0Ertt05V4i/98W2I8KMCZbAv6l/sMaar+5T6Cw
 15g15T2v9yUU/EikPhFe1tf+lHvKBnfFQlOjLT8Jce39mQaOE4fj1dIzGKxxfA==
Date: Sat,  5 Aug 2023 10:53:16 +0800
Message-ID: <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
In-Reply-To: <cover.1691202289.git.hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
X-Spamd-Bar: --
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/packages.scm (add-input-label): Specify output when it's not "out".
---
 guix/packages.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index ba98bb0fb4..d0e6e16cbb 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -626,7 +626,13 @@ (define (add-input-label input)
     ((? package? package)
      (list (package-name package) package))
     (((? package? package) output)                ;XXX: ugly?
-     (list (package-name package) package output))
+     (if (string=? output "out")
+         ;; (package "out") => ("package" package "out")
+         (list (package-name package) package output)
+         ;; (package "output") => ("package:output" package "output")
+         (list (string-append (package-name package) ":" output)
+               package
+               output)))
     ((? gexp-input?)       ;XXX: misplaced because 'native?' field is ignored?
      (let ((obj    (gexp-input-thing input))
            (output (gexp-input-output input)))
-- 
2.41.0





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 0/1] Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 05 Aug 2023 03:02:02 +0000
Resent-Message-ID: <handler.65062.B65062.16912045155547 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 65062 <at> debbugs.gnu.org
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.16912045155547
          (code B ref 65062); Sat, 05 Aug 2023 03:02:02 +0000
Received: (at 65062) by debbugs.gnu.org; 5 Aug 2023 03:01:55 +0000
Received: from localhost ([127.0.0.1]:55173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qS7YA-0001RO-Ui
	for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 23:01:55 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:55398)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qS7Y8-0001RG-95
 for 65062 <at> debbugs.gnu.org; Fri, 04 Aug 2023 23:01:52 -0400
Date: Sat, 05 Aug 2023 11:01:40 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1691204505;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=yvl5wYpNBmHI34jzlb/UyiLw+W2a1YIb2ayiV4Y7DHQ=;
 b=IeU/8OVYBfT1EJ+mSgJhK2x49kPk+l3mx+b86ix2mrSTvU7LIrMTFAZtN/Ss3UXH8yp8QQ
 eOr4+vXkiKDopmzBiFNvtTb2zfDqTF+U3LoCvmAqjcm/M3brInnwpzbrKfklXSWC1OBOL4
 ogWaD6wMfgONvnCL0e8c4vchWUyRuCoxUs54v1O+FMVrvfZc4uekbCFFVDcX6Lg+O4qq+s
 qbCf+UL/vP/RTDpWXromF2k/nvcr2HaJK9IFCL1vjDdGxGGx/FX939GHsXYM+pN7rypbOW
 g5GCo+gEP51rsABVBW0UhrMJ61ZBFO5T0kpjSPhIpVtcv7ezkcrTNNTAVw3B9g==
Message-ID: <87il9ui44r.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
In-Reply-To: <cover.1691202289.git.hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
X-Spamd-Bar: /
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, 05 Aug 2023 10:50:32 +0800,
Hilton Chain wrote:
> 
> Hello Guix,
> 
> Recently I found it not possible to find `(,gcc "lib") in inputs with
> `this-package-input' since it has the label "gcc" and there're other "gcc"s
> in the build environment.
> 
> As we should avoid direct use on input labels, I think the solution is to
> modify `add-input-label', hence the patch.
> 
> Taking `aide' from (gnu packages admin) as an example, the current behavior is
> that both `pcre:static' and `pcre' have the label "pcre", this affects
> `this-package-input' and `modify-inputs':

Ahh sorry, I haven't checked `lookup-input', it seems that it doesn't
use input labels, so this patch only applies to `modify-inputs'.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 0/1] Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 05 Aug 2023 03:20:02 +0000
Resent-Message-ID: <handler.65062.B65062.16912055837143 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: control <at> debbugs.gnu.org, 65062 <at> debbugs.gnu.org
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.16912055837143
          (code B ref 65062); Sat, 05 Aug 2023 03:20:02 +0000
Received: (at 65062) by debbugs.gnu.org; 5 Aug 2023 03:19:43 +0000
Received: from localhost ([127.0.0.1]:55179 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qS7pO-0001r7-O9
	for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 23:19:43 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:42418)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>)
 id 1qS7pN-0001qv-16; Fri, 04 Aug 2023 23:19:41 -0400
Date: Sat, 05 Aug 2023 11:19:14 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1691205573;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=rSaGTTH3M0xoDlFEOtdSLQCk0bgP8cgetw21h+UcBJ8=;
 b=ECaELUUGsNR6HJVtEXtJ6o2njNS8qtMH18OqY1V9M+oaVcbBadM7CFl7/Ieo9PnqiwkPYM
 /miziWC07jeXO9l3nTJjnG5f88KYxoXaEIDIzBO2z/jqQoHjGqgBJy2REyMxy/4nzPlvvy
 SmWBSlAQnQ8LC94+D6hza1678e4V8GRCTpPLFiUtOjBZfGwxINaDb6V+CwaAQFpTovpzKB
 N+mGKJFSJdWK5dep97qxNUDDEJNz+6huj3dNIJiOYRrladLFFEI21xxe9JK91OQ9+P3JnB
 Vb34LUQyLC2CQJiErlYJasHYpCr9bB7tCnFBQXWbHQbaISCkQXGqd6AGu+bNTQ==
Message-ID: <87h6pei3bh.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
In-Reply-To: <87il9ui44r.wl-hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <87il9ui44r.wl-hako@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
X-Spamd-Bar: /
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 65062 moreinfo
thanks

On Sat, 05 Aug 2023 11:01:40 +0800,
Hilton Chain wrote:
> Ahh sorry, I haven't checked `lookup-input', it seems that it doesn't
> use input labels, so this patch only applies to `modify-inputs'.

Sorry for the noise, I have checked `lookup-input' and it uses labels,
but returns unwanted result with this patch (searching for "gcc:lib"
returns a "gcc").

I'll check that out.




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 5 Aug 2023 03:19:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 04 23:19:43 2023
Received: from localhost ([127.0.0.1]:55181 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qS7pP-0001rA-2V
	for submit <at> debbugs.gnu.org; Fri, 04 Aug 2023 23:19:43 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:42418)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>)
 id 1qS7pN-0001qv-16; Fri, 04 Aug 2023 23:19:41 -0400
Date: Sat, 05 Aug 2023 11:19:14 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1691205573;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=rSaGTTH3M0xoDlFEOtdSLQCk0bgP8cgetw21h+UcBJ8=;
 b=ECaELUUGsNR6HJVtEXtJ6o2njNS8qtMH18OqY1V9M+oaVcbBadM7CFl7/Ieo9PnqiwkPYM
 /miziWC07jeXO9l3nTJjnG5f88KYxoXaEIDIzBO2z/jqQoHjGqgBJy2REyMxy/4nzPlvvy
 SmWBSlAQnQ8LC94+D6hza1678e4V8GRCTpPLFiUtOjBZfGwxINaDb6V+CwaAQFpTovpzKB
 N+mGKJFSJdWK5dep97qxNUDDEJNz+6huj3dNIJiOYRrladLFFEI21xxe9JK91OQ9+P3JnB
 Vb34LUQyLC2CQJiErlYJasHYpCr9bB7tCnFBQXWbHQbaISCkQXGqd6AGu+bNTQ==
Message-ID: <87h6pei3bh.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
To: control <at> debbugs.gnu.org, 65062 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates 0/1] Specify output in input label when it's
 not "out".
In-Reply-To: <87il9ui44r.wl-hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <87il9ui44r.wl-hako@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
X-Spamd-Bar: /
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 65062 moreinfo
thanks

On Sat, 05 Aug 2023 11:01:40 +0800,
Hilton Chain wrote:
> Ahh sorry, I haven't checked `lookup-input', it seems that it doesn't
> use input labels, so this patch only applies to `modify-inputs'.

Sorry for the noise, I have checked `lookup-input' and it uses labels,
but returns unwanted result with this patch (searching for "gcc:lib"
returns a "gcc").

I'll check that out.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 22 Aug 2023 16:01:01 +0000
Resent-Message-ID: <handler.65062.B65062.169272002413801 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Hilton Chain <hako@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169272002413801
          (code B ref 65062); Tue, 22 Aug 2023 16:01:01 +0000
Received: (at 65062) by debbugs.gnu.org; 22 Aug 2023 16:00:24 +0000
Received: from localhost ([127.0.0.1]:60233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qYTnr-0003aW-Ra
	for submit <at> debbugs.gnu.org; Tue, 22 Aug 2023 12:00:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1qYTnp-0003aJ-V8
 for 65062 <at> debbugs.gnu.org; Tue, 22 Aug 2023 12:00:23 -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 <ludo@HIDDEN>)
 id 1qYTnf-0005Bw-0S; Tue, 22 Aug 2023 12:00:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=rpfCjSRK/vBzy93wo4MawXATA5pcAen8KjUsUdjR3IA=; b=H0QLsZRAcFOuKWKrWuEt
 iZON2ldT1T05m1Ht/HGS9HBZNwBgkT9bV7JUkLLrvdmSScC1s5LTR+yzKSkoEHFhs89WwFKtjSDQU
 a6mVggalGDq/ARUzSPZiMclGP5UL9ocRl6hxrI+9/yVnqDzAkHzFflemy3g8y2gbW7mCOYbsPG6zX
 /dcAGpl+XdfzMQgEiGpwakTfnu/fNhAsN7cWE+ibU0nvGfCpbMEsvVvz7WisdPKH3LR55aN0JfIUe
 TQ8XzHzgWwQ4iLQXKjyqnne3P1IgeYEX84P5MtUFtLynR/DFLBBIBbztTtdXsZMV9ZDYCEyz9dVks
 E4d1jTC3NaEnZQ==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Quintidi 5 Fructidor an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Saumon
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 22 Aug 2023 18:00:00 +0200
In-Reply-To: <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
 (Hilton Chain's message of "Sat, 5 Aug 2023 10:53:16 +0800")
Message-ID: <875y575apr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Hilton Chain <hako@HIDDEN> skribis:

> * guix/packages.scm (add-input-label): Specify output when it's not "out".

[...]

> +         (list (string-append (package-name package) ":" output)
> +               package
> +               output)))

The Grand Plan=C2=B9 is to eventually get rid of labels entirely (or almost:
there=E2=80=99d still be input alists on the build side).  As such, I thoug=
ht we
shouldn=E2=80=99t worry too much about what the actual label is.  But perha=
ps
you stumbled upon situations where this is a problem?  Could you
describe them?

Thanks,
Ludo=E2=80=99.

=C2=B9 https://guix.gnu.org/en/blog/2021/the-big-change/




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 24 Aug 2023 03:43:02 +0000
Resent-Message-ID: <handler.65062.B65062.169284857413577 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169284857413577
          (code B ref 65062); Thu, 24 Aug 2023 03:43:02 +0000
Received: (at 65062) by debbugs.gnu.org; 24 Aug 2023 03:42:54 +0000
Received: from localhost ([127.0.0.1]:35753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qZ1FG-0003Wv-0E
	for submit <at> debbugs.gnu.org; Wed, 23 Aug 2023 23:42:54 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:59014)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qZ1FC-0003Wl-7E
 for 65062 <at> debbugs.gnu.org; Wed, 23 Aug 2023 23:42:51 -0400
Date: Thu, 24 Aug 2023 11:42:04 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1692848531;
 h=from:from: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;
 bh=eC/b2dk2q1OqXMfUGx4pN9LqZbdKrMFMVwPA1zJYR1g=;
 b=KB/8DqOrJ3Af8quekeEqhYMs62NtXXXunPBUU2GRv+E1DN3sT7DIzxsXRle7LYeb0bjsoK
 N30sWFpobw9lVsN/cNf5cMs0nqR8HiLbbfH9o23C6EAsrFysNhuNMl7OHPZKOsbibkPpF8
 Y5OsqgASb/2MzbQBPmsoUzDZWIxzlZ1u6AJKd1+JEJ0Zn1kgzv0vcrR8zvSmoOThjQzcMF
 Ym1ItXHgJp3v6BZ8peNunFuwV9muFqIB5fDGBgdq1PSdI37IgWS1ksu2dk5ARRlyKJ6UUC
 zpskvbF4FIFg67D9AC3pfHPaPnbh9QkGogLHbPdRMw95NfsmZLwBy/Eznpp7ng==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Message-ID: <87msyhumwj.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
In-Reply-To: <875y575apr.fsf@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
 <875y575apr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: ++
X-Spam-Level: **
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

On Wed, 23 Aug 2023 00:00:00 +0800,
Ludovic Court=C3=A8s wrote:
>
> Hi,
>
> Hilton Chain <hako@HIDDEN> skribis:
>
> > * guix/packages.scm (add-input-label): Specify output when it's not "ou=
t".
>
> [...]
>
> > +         (list (string-append (package-name package) ":" output)
> > +               package
> > +               output)))
>
> The Grand Plan=C2=B9 is to eventually get rid of labels entirely (or almo=
st:
> there=E2=80=99d still be input alists on the build side).  As such, I tho=
ught we
> shouldn=E2=80=99t worry too much about what the actual label is.  But per=
haps
> you stumbled upon situations where this is a problem?  Could you
> describe them?
>
> Thanks,
> Ludo=E2=80=99.
>
> =C2=B9 https://guix.gnu.org/en/blog/2021/the-big-change/

My main concern is that currently modify-inputs, this-package-input
and this-package-native-input operate on input labels and there would
be duplicated labels if adding multiple outputs of a package.

For modify-inputs, I think there's no approach to solve this without
also specifying labels in inputs.

Although this-package-* can be replaced by search-input-*, I'd like to
avoid (dirname (dirname (search-input-file inputs "/lib/..."))) when
(this-package-input "...") is available.


For current this-package-* vs. search-input-*, I have other points:

1. In the context of build system arguments, like #:configure-flags,
inputs and native-inputs as variables aren't available, one may need
to use %build-inputs, %build-host-inputs and %build-target-inputs for
search-input-*, which is inconsistent with other parts.

2. It might be a bit confusing when, for example, adding
tzdata-for-test to native-inputs, and referencing it with proper
cross-compilation support:
--8<---------------cut here---------------start------------->8---
(setenv "TZDIR"
        (search-input-directory
         (if #$(%current-target-system) native-inputs inputs)
         "/share/zoneinfo"))
--8<---------------cut here---------------end--------------->8---

In such cases I may prefer this-package-*, but it would be unreliable
when there're duplicated labels.


There's also issue referencing a package when multiple versions of it
under a same name are added to the inputs, which may not fall under
this "Subject:".


Thanks




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Josselin Poiret <dev@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 25 Aug 2023 11:11:02 +0000
Resent-Message-ID: <handler.65062.B65062.169296181320686 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Cc: Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169296181320686
          (code B ref 65062); Fri, 25 Aug 2023 11:11:02 +0000
Received: (at 65062) by debbugs.gnu.org; 25 Aug 2023 11:10:13 +0000
Received: from localhost ([127.0.0.1]:39435 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qZUhg-0005Na-Uh
	for submit <at> debbugs.gnu.org; Fri, 25 Aug 2023 07:10:13 -0400
Received: from jpoiret.xyz ([206.189.101.64]:43284)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dev@HIDDEN>) id 1qZUhe-0005NQ-Au
 for 65062 <at> debbugs.gnu.org; Fri, 25 Aug 2023 07:10:11 -0400
Received: from authenticated-user (jpoiret.xyz [206.189.101.64])
 by jpoiret.xyz (Postfix) with ESMTPA id 67AB31852FA;
 Fri, 25 Aug 2023 11:10:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim;
 t=1692961804;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=XHQVRYaKfIqbsYR5hrGpeYVJiW2K4g2G1CPyf05uzEs=;
 b=oY3FDk97xT9JVK0bIlZz7io3ChFfES5BOH5XHNLHMiisppZ2qoBx+0A6P3ZfXujCWAhtzX
 vEcT6LfQFDVGsPWJsNmlwMPQH6Y5oXH92Xn9YLH1SwzKpwYiJouU/58PyWRpS2IEXhfKBf
 w+YRGj/31w7y1PV4tH7UVCkylehxotpOYQ9cyF/XqjE2YmmZMW3gCb0M7IB54mN8ugtbAX
 PGtgHXL4PxE8HCm21sn0rM4lIQ9A7qoWt91yXF1r9AbPUa37zFOJ3fSkq6HUIxeTEIgNCQ
 G8QkeHFMJ45jTsjjWN6trGf39JAZUiEffrYtdBbyLr2DB1TAcscCil62WJJ9Sw==
From: Josselin Poiret <dev@HIDDEN>
In-Reply-To: <87msyhumwj.wl-hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
 <875y575apr.fsf@HIDDEN> <87msyhumwj.wl-hako@HIDDEN>
Date: Fri, 25 Aug 2023 13:10:00 +0200
Message-ID: <87a5ufv0mv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Level: *
X-Spamd-Bar: +
Authentication-Results: jpoiret.xyz;
 auth=pass smtp.auth=jpoiret@HIDDEN smtp.mailfrom=dev@HIDDEN
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi everyone,

Hilton Chain <hako@HIDDEN> writes:

> 2. It might be a bit confusing when, for example, adding
> tzdata-for-test to native-inputs, and referencing it with proper
> cross-compilation support:
> --8<---------------cut here---------------start------------->8---
> (setenv "TZDIR"
>         (search-input-directory
>          (if #$(%current-target-system) native-inputs inputs)
>          "/share/zoneinfo"))
> --8<---------------cut here---------------end--------------->8---

FWIW, the idiomatic way in Guix is to use `(or native-inputs inputs)`
instead of that if.

HTH,
=2D-=20
Josselin Poiret

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmTojAgQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5Fhcaih8fC/9t4wp3lE4SvliqkkR8o6Qr8+HzzWh/8oQy
6hE8O0vouu5kcdGVxoENYVKteiGedFTmvKS1r5CCVJ5WwcMy91UlDf53L2jrnXLW
2sE62Pd7OhlOGTXECONvKLTwDsAn9HXrqdHWwh1gFFTGHrQ6w13wRUc/WVCKeYEA
1ESEYNpqQqGDY7MDVgKIXHTbNqUSP5TE4fjwzu5pZ9KN6cd6lyCRkqI2x4LpzD51
smDnxvzbfv97wMQWRVUWZR8SU3hDdf1t8m3E5kpuogI8O+2qjfNEgAwMnUZUYjhK
Ubnn1xGPjrON5ZIYZzLouAqhgyWeztXjTNrfdFOfY9t0sQ6VnNaYY/d7j1L9YIC5
F0LLnHwOg0IHbzPvGOkBM7PmdhwBtuQFVHXJiLKz6pG1npcmWOfKDnv2bmGkbR3X
aJ1nAs+ILa3M1j5X5CRp3GfY/6CUo/i7I2T2pEmf9gGCnG0uOs23EruWnhEqku8C
UyJAnDw+DqI2g5F5P3mXR0OyTP33UhU=
=zp3K
-----END PGP SIGNATURE-----
--=-=-=--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 08 Sep 2023 22:05:02 +0000
Resent-Message-ID: <handler.65062.B65062.16942106494826 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Hilton Chain <hako@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.16942106494826
          (code B ref 65062); Fri, 08 Sep 2023 22:05:02 +0000
Received: (at 65062) by debbugs.gnu.org; 8 Sep 2023 22:04:09 +0000
Received: from localhost ([127.0.0.1]:45786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qejaD-0001Fm-08
	for submit <at> debbugs.gnu.org; Fri, 08 Sep 2023 18:04:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1qejaA-0001FH-Td
 for 65062 <at> debbugs.gnu.org; Fri, 08 Sep 2023 18:04:08 -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 <ludo@HIDDEN>)
 id 1qeja0-00066Z-PE; Fri, 08 Sep 2023 18:03:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=FFxf7U5aSyVrU6SxocAr7LqQ3J0rsIwU2isc4fowxwI=; b=gF+3+ICdFi1fSdI7wATq
 7Lt9tSNuxaRTN1+rZt8E4zy5bgysZlwKfHHfsZSTu5fGGCAKHvE7ny/g43wY+6BJOc07133NhkBcM
 KtnfNWHOAj9r0EcOP8McdbFeavdjrmXyUnolFoWOyCzjv1h+fYStuVDuLDucxOoA3mcqSkG2KFVuQ
 cEx7WyP2y/SE1orfUt0GUisc7Wq+FlcPoEXjgMb/IKtEHIodx46h6jsbQH+emRtHoFxAmJKqkP2Yx
 rjGEwakdLfLVi6ajsm/8PpJrdXZv3fmNNT+7c/avt8IIf12iWhRQ1cMWlCXlCVpN5hQ7aD0/eYfx9
 1QK1t2SsSRPrXw==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
 <875y575apr.fsf@HIDDEN> <87msyhumwj.wl-hako@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Duodi 22 Fructidor an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Noisette
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sat, 09 Sep 2023 00:03:53 +0200
In-Reply-To: <87msyhumwj.wl-hako@HIDDEN> (Hilton Chain's message of
 "Thu, 24 Aug 2023 11:42:04 +0800")
Message-ID: <87msxw1fw6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Hilton Chain <hako@HIDDEN> skribis:

>> Hilton Chain <hako@HIDDEN> skribis:
>>
>> > * guix/packages.scm (add-input-label): Specify output when it's not "o=
ut".
>>
>> [...]
>>
>> > +         (list (string-append (package-name package) ":" output)
>> > +               package
>> > +               output)))
>>
>> The Grand Plan=C2=B9 is to eventually get rid of labels entirely (or alm=
ost:
>> there=E2=80=99d still be input alists on the build side).  As such, I th=
ought we
>> shouldn=E2=80=99t worry too much about what the actual label is.  But pe=
rhaps
>> you stumbled upon situations where this is a problem?  Could you
>> describe them?

[...]

> My main concern is that currently modify-inputs, this-package-input
> and this-package-native-input operate on input labels and there would
> be duplicated labels if adding multiple outputs of a package.
>
> For modify-inputs, I think there's no approach to solve this without
> also specifying labels in inputs.

Yes, good point.

Another, more radical approach, would be to change semantics, whereby
(inputs (list p)) would mean that all the outputs of =E2=80=98p=E2=80=99, n=
ot just
=E2=80=9Cout=E2=80=9D, are taken as inputs.  That=E2=80=99d simplify inputs=
 at the expense of
precision, and (this-package-input NAME) would always be unambiguous.

But maybe that=E2=80=99s too radical and uncertain.

So all things considered, I guess you=E2=80=99re right and we should do wha=
t you
propose.

Minor issues:

> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -626,7 +626,13 @@ (define (add-input-label input)
>      ((? package? package)
>       (list (package-name package) package))
>      (((? package? package) output)                ;XXX: ugly?
> -     (list (package-name package) package output))
> +     (if (string=3D? output "out")
> +         ;; (package "out") =3D> ("package" package "out")
> +         (list (package-name package) package output)
> +         ;; (package "output") =3D> ("package:output" package "output")
> +         (list (string-append (package-name package) ":" output)
> +               package
> +               output)))

Rather write it as two separate clauses, without comments:

  (((? package? package) "out")
   =E2=80=A6)
  (((? package? package) output)
   =E2=80=A6)

Could you also add a test case in =E2=80=98tests/packages.scm=E2=80=99 that=
 would look
up inputs by those labels?

Thanks,
Ludo=E2=80=99.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 03 Oct 2023 09:16:01 +0000
Resent-Message-ID: <handler.65062.B65062.169632450712771 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169632450712771
          (code B ref 65062); Tue, 03 Oct 2023 09:16:01 +0000
Received: (at 65062) by debbugs.gnu.org; 3 Oct 2023 09:15:07 +0000
Received: from localhost ([127.0.0.1]:38774 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnbUh-0003Jt-8S
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:15:07 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:36986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qnbUf-0003Jk-Er
 for 65062 <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:15:06 -0400
Date: Tue, 03 Oct 2023 17:13:34 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1696324370;
 h=from:from: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;
 bh=hz47foLZHY+Nkin4KdW7kOYNgtwXA7F0LHunKFSdZvE=;
 b=JVCSIDNaHfyKjbEWrzkXDLtsNSwA1yC7dWeZD8+l+XlUQwphRiqKsQIpwangiPJblokIkq
 GqkdURgJM2tTakKuZQGsTm5iGQZkafad3NeRKW6RThynwCr2Wi1XGSaL6hSMTaL/H0AODm
 IQM1Nj5XAwgndWjMp9byCgIGtT/9y8cvXA28wNhTKIlCPcUq5h8DvuCsr9z/MSm+Zjfduf
 Rwo0l7vu+2fx4MvdHInuVxIU+egrBa4Gq7wXY5sI391aXAa+bsFyM4O+xVlukwLfx+ratB
 uRQxc/mScg1WYr+o9cowo8/LC8NnuFXEq/+wY8CKdC0TXMwMZgeYf35cVK/Rrw==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Message-ID: <87jzs4vzk1.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
In-Reply-To: <87msxw1fw6.fsf@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
 <b6c9adca21cc4418219b51532c2f0a9bddb208f0.1691202289.git.hako@HIDDEN>
 <875y575apr.fsf@HIDDEN> <87msyhumwj.wl-hako@HIDDEN>
 <87msxw1fw6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: ++
X-Spam-Level: **
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

On Sat, 09 Sep 2023 06:03:53 +0800,
Ludovic Court=C3=A8s wrote:
>
> Hi,
>
> Hilton Chain <hako@HIDDEN> skribis:
>
> >> Hilton Chain <hako@HIDDEN> skribis:
> >>
> >> > * guix/packages.scm (add-input-label): Specify output when it's not =
"out".
> >>
> >> [...]
> >>
> >> > +         (list (string-append (package-name package) ":" output)
> >> > +               package
> >> > +               output)))
> >>
> >> The Grand Plan=C2=B9 is to eventually get rid of labels entirely (or a=
lmost:
> >> there=E2=80=99d still be input alists on the build side).  As such, I =
thought we
> >> shouldn=E2=80=99t worry too much about what the actual label is.  But =
perhaps
> >> you stumbled upon situations where this is a problem?  Could you
> >> describe them?
>
> [...]
>
> > My main concern is that currently modify-inputs, this-package-input
> > and this-package-native-input operate on input labels and there would
> > be duplicated labels if adding multiple outputs of a package.
> >
> > For modify-inputs, I think there's no approach to solve this without
> > also specifying labels in inputs.
>
> Yes, good point.
>
> Another, more radical approach, would be to change semantics, whereby
> (inputs (list p)) would mean that all the outputs of =E2=80=98p=E2=80=99,=
 not just
> =E2=80=9Cout=E2=80=9D, are taken as inputs.  That=E2=80=99d simplify inpu=
ts at the expense of
> precision, and (this-package-input NAME) would always be unambiguous.
>
> But maybe that=E2=80=99s too radical and uncertain.
>
> So all things considered, I guess you=E2=80=99re right and we should do w=
hat you
> propose.


Thank you!


> Minor issues:
>
> > --- a/guix/packages.scm
> > +++ b/guix/packages.scm
> > @@ -626,7 +626,13 @@ (define (add-input-label input)
> >      ((? package? package)
> >       (list (package-name package) package))
> >      (((? package? package) output)                ;XXX: ugly?
> > -     (list (package-name package) package output))
> > +     (if (string=3D? output "out")
> > +         ;; (package "out") =3D> ("package" package "out")
> > +         (list (package-name package) package output)
> > +         ;; (package "output") =3D> ("package:output" package "output")
> > +         (list (string-append (package-name package) ":" output)
> > +               package
> > +               output)))
>
> Rather write it as two separate clauses, without comments:
>
>   (((? package? package) "out")
>    =E2=80=A6)
>   (((? package? package) output)
>    =E2=80=A6)
>
> Could you also add a test case in =E2=80=98tests/packages.scm=E2=80=99 th=
at would look
> up inputs by those labels?


I have thought about this patch again recently.


First of all, I didn't describe my own trouble clearly:

I wanted to put `this-package-input' into #$gcc:lib, but didn't know how.  =
Now I
understand that (ungexp (this-package-input "gcc") "lib") can be used and i=
nput
labels are not quite related...


And then I realised that there's too much extra work in package definitions=
 for
the label change.


So, how about looking up inputs by specification (name + version + output),=
 and
falling back to input labels?  I think this can address the issue regarding
multiple outputs and versions, while keeping compatible with existing behav=
ior.

I'll send v2 for the change, with a different subject.  Though I haven't wr=
itten
new tests for it, the existing (tests packages) passes when applied to mast=
er
and no package definition needs changing at least for building guix.


Thanks




Message sent to hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH v2 core-updates 0/2] packages: Lookup inputs by specification.
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Tue, 03 Oct 2023 09:18:02 +0000
Resent-Message-ID: <handler.65062.B65062.169632464813013 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: 65062 <at> debbugs.gnu.org
Cc: Hilton Chain <hako@HIDDEN>, Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169632464813013
          (code B ref 65062); Tue, 03 Oct 2023 09:18:02 +0000
Received: (at 65062) by debbugs.gnu.org; 3 Oct 2023 09:17:28 +0000
Received: from localhost ([127.0.0.1]:38778 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnbWx-0003Np-Tv
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:17:28 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:46450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qnbWu-0003Ng-Oc
 for 65062 <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:17:25 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1696324513;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=YQwSnmD3CSlQbQDitUKqqTcmNim5xztPfJEQf/2hEXA=;
 b=YyjDJGhvbneXeRmNwY6pf9p5ivlw5S/bHbVbxeqHSN7gZcbsiCUdiZFkRX78xOayy1FSYO
 oDF4V3UC4ePWZKDn94VnjxuL30TTSS2mhaasdM2tVUJY/7JCHHbbEPmxDAFKapgSY/UI8e
 5jEj4+xJEjwA+j9NyRD7+9qEHro03Tb8vROGea6iMhkRPdZC1D9PcXfJ50u6+golpYcUlU
 HMeba4AcodL8y/o0LF9RAqi/mXIiTwdCJ1KO/FbFi3v98jwndZkdOkZiqV6EyYXDfoQtcS
 iH6yMxuXUqtf9f9b2f3a7gkY/ly3pqZYlijVzfIziWrg6/imbxJx1Gld0U15RQ==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Date: Tue,  3 Oct 2023 17:15:53 +0800
Message-ID: <cover.1696323536.git.hako@HIDDEN>
In-Reply-To: <cover.1691202289.git.hako@HIDDEN>
References: <cover.1691202289.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: +
X-Spam-Level: *
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

*** BLURB HERE ***

Hilton Chain (2):
  ui: package-specification->name+version+output: Move to (guix packages).
  packages: Lookup inputs by specification.

 guix/packages.scm  | 95 ++++++++++++++++++++++++++++++++++++++--------
 guix/ui.scm        | 21 ----------
 tests/packages.scm | 17 +++++++++
 tests/ui.scm       | 17 ---------
 4 files changed, 97 insertions(+), 53 deletions(-)


base-commit: 70b0f2b9134b2db286f707835394798de039c277
--
2.41.0




Message sent to hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH v2 core-updates 1/2] ui: package-specification->name+version+output: Move to (guix packages).
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Tue, 03 Oct 2023 09:19:02 +0000
Resent-Message-ID: <handler.65062.B65062.169632471413198 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: 65062 <at> debbugs.gnu.org
Cc: Hilton Chain <hako@HIDDEN>, Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169632471413198
          (code B ref 65062); Tue, 03 Oct 2023 09:19:02 +0000
Received: (at 65062) by debbugs.gnu.org; 3 Oct 2023 09:18:34 +0000
Received: from localhost ([127.0.0.1]:38792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnbY1-0003Qm-HI
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:18:33 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:52084)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qnbY0-0003Qa-0M
 for 65062 <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:18:32 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1696324581;
 h=from:from: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;
 bh=fLs3ot+6xGwMZp4fkkjFriYktdL5LxxUtFV25loACmQ=;
 b=wmOQxiTTzEkUPL8DEjbgljUWWH8hlg9akD7aXAaG7ywnpsWsoZOuMC7G5U/hDZDfzai2x3
 o78O1f1bbI/QmrRxo01PkVl1PrR7HPDRQ49VRqAyqtZJpDIgqLjxZ1wZgY2rwJtYxFKiVD
 AhwobJirHzxX9eP4PJA8FeAawkvPZVVYe4C5FaA3bcs1ZV0ife8vm66AbKh4HLNDN2jjzF
 UuLHY235oCYOJPEO9jXX8aXStyog7rfGVZ3KBRSUscGoWgcLEpgfFjHVQ9TBBNwwp91nW3
 9kvaz/4/bfXMfJuBd0P8inJ6wBx6HZ/SelBIR9pSwmdqxu6mz9dBViJtH/cxAg==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Date: Tue,  3 Oct 2023 17:17:01 +0800
Message-ID: <2b6bc0121a38d6aecf11536cc7e0c630d8eeaaa9.1696323536.git.hako@HIDDEN>
In-Reply-To: <cover.1696323536.git.hako@HIDDEN>
References: <cover.1696323536.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: ---
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/ui.scm (package-specification->name+version+output): Move it to...
* guix/packages.scm (package-specification->name+version+output): ...here.
* tests/ui.scm (package-specification->name+version+output): Move it to...
* tests/packages.scm (package-specification->name+version+output): ...here.
---
 guix/packages.scm  | 23 +++++++++++++++++++++++
 guix/ui.scm        | 21 ---------------------
 tests/packages.scm | 17 +++++++++++++++++
 tests/ui.scm       | 17 -----------------
 4 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index f70fad695e..b004882cc6 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -52,6 +52,7 @@ (define-module (guix packages)
   #:use-module (ice-9 regex)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9 gnu)
+  #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
@@ -117,6 +118,8 @@ (define-module (guix packages)
             deprecated-package
             package-field-location
 
+            package-specification->name+version+output
+
             this-package-input
             this-package-native-input
 
@@ -783,6 +786,26 @@ (define (package-field-location package field)
         #f)))
     (_ #f)))
 
+(define* (package-specification->name+version+output spec
+                                                     #:optional (output "out"))
+  "Parse package specification SPEC and return three value: the specified
+package name, version number (or #f), and output name (or OUTPUT).  SPEC may
+optionally contain a version number and an output name, as in these examples:
+
+  guile
+  guile@HIDDEN
+  guile:debug
+  guile@HIDDEN:debug
+"
+  (let*-values (((name sub-drv)
+                 (match (string-rindex spec #\:)
+                   (#f    (values spec output))
+                   (colon (values (substring spec 0 colon)
+                                  (substring spec (+ 1 colon))))))
+                ((name version)
+                 (package-name->name+version name)))
+    (values name version sub-drv)))
+
 (define-syntax-rule (this-package-input name)
   "Return the input NAME of the package being defined--i.e., an input
 from the ‘inputs’ or ‘propagated-inputs’ field.  Native inputs are not
diff --git a/guix/ui.scm b/guix/ui.scm
index 6f2d4fe245..0cc121f048 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -118,7 +118,6 @@ (define-module (guix ui)
             package-synopsis-string
             string->recutils
             package->recutils
-            package-specification->name+version+output
 
             pager-wrapped-port
             with-paginated-output-port
@@ -2098,26 +2097,6 @@ (define (delete-generation* store profile generation)
           (generation-file-name profile generation))
   (delete-generation store profile generation))
 
-(define* (package-specification->name+version+output spec
-                                                     #:optional (output "out"))
-  "Parse package specification SPEC and return three value: the specified
-package name, version number (or #f), and output name (or OUTPUT).  SPEC may
-optionally contain a version number and an output name, as in these examples:
-
-  guile
-  guile@HIDDEN
-  guile:debug
-  guile@HIDDEN:debug
-"
-  (let*-values (((name sub-drv)
-                 (match (string-rindex spec #\:)
-                   (#f    (values spec output))
-                   (colon (values (substring spec 0 colon)
-                                  (substring spec (+ 1 colon))))))
-                ((name version)
-                 (package-name->name+version name)))
-    (values name version sub-drv)))
-
 
 ;;;
 ;;; Command-line option processing.
diff --git a/tests/packages.scm b/tests/packages.scm
index 2b4f9f8e90..be9188ceb1 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1926,6 +1926,23 @@ (define compressors '(("gzip"  . "gz")
                                     "-p" (derivation->output-path prof2)
                                     "--search-paths"))))))
 
+(test-equal "package-specification->name+version+output"
+  '(("guile" #f "out")
+    ("guile" "2.0.9" "out")
+    ("guile" #f "debug")
+    ("guile" "2.0.9" "debug")
+    ("guile-cairo" "1.4.1" "out"))
+  (map (lambda (spec)
+         (call-with-values
+             (lambda ()
+               (package-specification->name+version+output spec))
+           list))
+       '("guile"
+         "guile@HIDDEN"
+         "guile:debug"
+         "guile@HIDDEN:debug"
+         "guile-cairo@HIDDEN")))
+
 (test-equal "specification->package when not found"
   'quit
   (catch 'quit
diff --git a/tests/ui.scm b/tests/ui.scm
index 438acae525..7bd948bd14 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -100,23 +100,6 @@ (define guile-2.0.9
     (package-description-string
      (dummy-package "foo" (description "b•ll•t")))))
 
-(test-equal "package-specification->name+version+output"
-  '(("guile" #f "out")
-    ("guile" "2.0.9" "out")
-    ("guile" #f "debug")
-    ("guile" "2.0.9" "debug")
-    ("guile-cairo" "1.4.1" "out"))
-  (map (lambda (spec)
-         (call-with-values
-             (lambda ()
-               (package-specification->name+version+output spec))
-           list))
-       '("guile"
-         "guile@HIDDEN"
-         "guile:debug"
-         "guile@HIDDEN:debug"
-         "guile-cairo@HIDDEN")))
-
 (test-equal "integer"
   '(1)
   (string->generations "1"))
-- 
2.41.0





Message sent to hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH v2 core-updates 2/2] packages: Lookup inputs by specification.
Resent-From: Hilton Chain <hako@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: hako@HIDDEN, ludo@HIDDEN, dev@HIDDEN, guix@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Tue, 03 Oct 2023 09:19:03 +0000
Resent-Message-ID: <handler.65062.B65062.169632471813226 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: 65062 <at> debbugs.gnu.org
Cc: Hilton Chain <hako@HIDDEN>, Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Hilton Chain <hako@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Christopher Baines <guix@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.169632471813226
          (code B ref 65062); Tue, 03 Oct 2023 09:19:03 +0000
Received: (at 65062) by debbugs.gnu.org; 3 Oct 2023 09:18:38 +0000
Received: from localhost ([127.0.0.1]:38795 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnbY6-0003RD-2M
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:18:38 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:36166)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qnbY4-0003R1-B2
 for 65062 <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:18:36 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1696324585;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=NF4JW0/Yknw0f9tUlXGYLqtLnA4YroMjeEGMaOeoI+o=;
 b=QrFvZtNpFhHx0CQBjZrwzKRKeeERpNZtvn6mDIno2M+vejtIYUE7XjhNTensUW5u1n/Vds
 Qf9U2DJtK7crmqohFMAKis+eRT+X079/TtZctzk80C6uCLWLwVH/STEubZQO6JfrETsvWt
 FXU/fF2qIM3vw9ttHC3pQqWTAyjImFxr4mvXsjk8d/HQoFB45ZXawXZZ/9LyEVvBqzoW89
 Sar5Cfri5iXJ2Fa2IdqtLJrL15/3j+Gb55EpV1VqRalYvY/Ik9ZdZSmrAqalOifG1Z9Zhm
 PPmS4QVwpyf6nPJQD5jJ5M12Qj1jgsjfYzCylpwxAz7eCdnfy6pKYkBwd6ojkA==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Date: Tue,  3 Oct 2023 17:17:02 +0800
Message-ID: <dac85ddb4c5637ab522b4b37f926f00af567cc33.1696323536.git.hako@HIDDEN>
In-Reply-To: <cover.1696323536.git.hako@HIDDEN>
References: <cover.1696323536.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: --
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/packages.scm (specification->inputs): New procedure.
(lookup-input,replace-input): Use it.
(delete-input): New procedure.
(modify-inputs)[delete]: Use it.
---
 guix/packages.scm | 72 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 57 insertions(+), 15 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index b004882cc6..45552bfb7f 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1173,15 +1173,49 @@ (define (transitive-inputs inputs)
       ((input rest ...)
        (loop rest (cons input result) propagated first? seen)))))
 
+(define (specification->inputs spec inputs)
+  "Lookup inputs specified by SPEC among INPUTS, an input list.  Return an input
+list consists of all matching inputs, or '().  SPEC may be a package name,
+optionally containing a version number or an output name, as in these examples:
+
+  guile
+  guile@HIDDEN
+  guile:debug
+  guile@HIDDEN:debug
+
+If SPEC does not specify a version number, all versions are matched; if SPEC
+does not specify an output, all outputs are matched.
+
+SPEC can be an input label as well."
+  (let ((name version sub-drv
+              (package-specification->name+version+output spec #f)))
+    (filter-map
+     (lambda (input)
+       (match input
+         (((? string? label) (? package? package) . outputs)
+          (and (or (and (string=? name (package-name package))
+                        (when version
+                          (string-prefix? version (package-version package)))
+                        (when sub-drv
+                          (and (not (null? outputs))
+                               (string=? sub-drv (first outputs)))))
+                   ;; fallback to input label
+                   (string=? label spec))
+               input))
+         ;; not a package
+         (((? string? label) _ . _)
+          (and (string=? label spec)
+               input))))
+     inputs)))
+
 (define (lookup-input inputs name)
   "Lookup NAME among INPUTS, an input list."
   ;; Note: Currently INPUTS is assumed to be an input list that contains input
   ;; labels.  In the future, input labels will be gone and this procedure will
   ;; check package names.
-  (match (assoc-ref inputs name)
-    ((obj) obj)
-    ((obj _) obj)
-    (#f #f)))
+  (let ((candidates (specification->inputs name inputs)))
+    (and (not (null? candidates))
+         (second (first candidates)))))
 
 (define (lookup-package-input package name)
   "Look up NAME among PACKAGE's inputs.  Return it if found, #f otherwise."
@@ -1202,17 +1236,25 @@ (define (lookup-package-direct-input package name)
 otherwise."
   (lookup-input (package-direct-inputs package) name))
 
+(define (delete-input name inputs)
+  "Delete input NAME within INPUTS."
+  (let ((to-delete (specification->inputs name inputs)))
+    (lset-difference equal? inputs to-delete)))
+
 (define (replace-input name replacement inputs)
   "Replace input NAME by REPLACEMENT within INPUTS."
-  (map (lambda (input)
-         (match input
-           (((? string? label) _ . outputs)
-            (if (string=? label name)
-                (match replacement        ;does REPLACEMENT specify an output?
-                  ((_ _) (cons label replacement))
-                  (_     (cons* label replacement outputs)))
-                input))))
-       inputs))
+  (let ((to-replace (specification->inputs name inputs)))
+    (append
+     (lset-difference equal? inputs to-replace)
+     (if (null? to-replace)
+         '()
+         (map (lambda (input)
+                (match input
+                  ((label _ . outputs)
+                   (match replacement   ;does REPLACEMENT specify an output?
+                     ((_ _) (cons label replacement))
+                     (_     (cons* label replacement outputs))))))
+              to-replace)))))
 
 (define-syntax prepend
   (lambda (s)
@@ -1244,10 +1286,10 @@ (define-syntax modify-inputs
     ;; 'package-inputs' & co., is actually an alist with labels.  Eventually,
     ;; it will operate on list of inputs without labels.
     ((_ inputs (delete name) clauses ...)
-     (modify-inputs (alist-delete name inputs)
+     (modify-inputs (delete-input name inputs)
                     clauses ...))
     ((_ inputs (delete names ...) clauses ...)
-     (modify-inputs (fold alist-delete inputs (list names ...))
+     (modify-inputs (fold delete-input inputs (list names ...))
                     clauses ...))
     ((_ inputs (prepend lst ...) clauses ...)
      (modify-inputs (append (map add-input-label (list lst ...)) inputs)
-- 
2.41.0





Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 3 Oct 2023 09:20:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 03 05:20:41 2023
Received: from localhost ([127.0.0.1]:38815 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnba5-0003VV-Mp
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:20:41 -0400
Received: from mail.boiledscript.com ([144.168.59.46]:46816)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1qnba3-0003VN-Cx
 for control <at> debbugs.gnu.org; Tue, 03 Oct 2023 05:20:39 -0400
Date: Tue, 03 Oct 2023 17:19:55 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1696324708;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=aLLWLYrGiCAya/VInk+8uruZ9DwhUg3eTHTOcolEFNk=;
 b=NwBIxw9tVuxJ3jC1ns9L5OG8deSlRXXhpRUMEY3dNjSCcWBA+sD34T2pEoNbkY4m22pJMu
 1TGLYh+p9XyoyVL9Es6rQmf/d3YqyVys3ycnt3u6PPr5pC81+SHFeIdIjWVrV03lWZ0OSB
 FnhLt2pduWpAFsfbnI42GTmk0kgXa3eIxSAWJsyf5sX7gxVaJDt/OcNQzmA9kFwUSmFJLy
 K59SK632zO+4BQiWkViIiul5EJpU4svqlBr2IX3W65Z9EiuNZ/RzrIQJ0CGpY2FA+zHyqT
 VxplTVt7c5PCO6dscKvdtfkCosYfQUO8qEisvri96rXcgsFdm6I5u/z8d+bdrg==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Message-ID: <87il7ovz9g.wl-hako@HIDDEN>
To: control <at> debbugs.gnu.org
From: Hilton Chain <hako@HIDDEN>
Subject: control message for bug #65062
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Spamd-Bar: /
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

retitle 65062 [PATCH core-updates] packages: Lookup inputs by specification.
quit




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#65062] [PATCH core-updates] packages: Lookup inputs by specification.
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 20 Dec 2023 21:28:01 +0000
Resent-Message-ID: <handler.65062.B65062.17031076298676 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 65062
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: moreinfo patch
To: Hilton Chain <hako@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 65062 <at> debbugs.gnu.org, Christopher Baines <guix@HIDDEN>
Received: via spool by 65062-submit <at> debbugs.gnu.org id=B65062.17031076298676
          (code B ref 65062); Wed, 20 Dec 2023 21:28:01 +0000
Received: (at 65062) by debbugs.gnu.org; 20 Dec 2023 21:27:09 +0000
Received: from localhost ([127.0.0.1]:41943 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rG45t-0002Fr-FB
	for submit <at> debbugs.gnu.org; Wed, 20 Dec 2023 16:27:09 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:56886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rG45o-0002FK-Vq
 for 65062 <at> debbugs.gnu.org; Wed, 20 Dec 2023 16:27:08 -0500
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 <ludo@HIDDEN>)
 id 1rG45e-00012N-Uy; Wed, 20 Dec 2023 16:26:54 -0500
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=yMCA0MawpkTk8xpTgpKCsTww0lQ21k1ulfUyhEntNpo=; b=Hzov+PHNyWcxWhoRgDjZ
 iRFvQWu/4+P9ul9BfJGz02+7HGWudGHLFO+Hc5XrqnWnDgC+hh6V4UuiMZsUXHbKhn+RpM8D4wplX
 3Q8EEqxpInYGsqvWsECKttiZ7zhdet0mjDxXBEKxwFx5UM08s+tVpr+c8LDgKtabYNpVPV814iWyX
 Fg6vbEBAAIUiLtvN8qXlwsrFMWxmNl5VJSk+2gGBGS8RQLhhHGl9bjg/Glvj3Jb9AwjQQwQgBigol
 5MefnUJ6CBg71vQqb6NuEEOHVN8s/YLtpEGR/WIuVEk5oqlRXXkH21e+J9jgMSv8/OAM+b8iB1oqh
 4eBZ0ouwGWbyAA==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
In-Reply-To: <dac85ddb4c5637ab522b4b37f926f00af567cc33.1696323536.git.hako@HIDDEN>
 (Hilton Chain's message of "Tue, 3 Oct 2023 17:17:02 +0800")
References: <cover.1696323536.git.hako@HIDDEN>
 <dac85ddb4c5637ab522b4b37f926f00af567cc33.1696323536.git.hako@HIDDEN>
Date: Wed, 20 Dec 2023 22:26:51 +0100
Message-ID: <87msu4ftus.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Hilton Chain <hako@HIDDEN> skribis:

> * guix/packages.scm (specification->inputs): New procedure.
> (lookup-input,replace-input): Use it.
> (delete-input): New procedure.
> (modify-inputs)[delete]: Use it.

I=E2=80=99ve been thinking about this change lately.

The problem we have now is that it looks like input labels are gone, but
they=E2=80=99re not; in particular =E2=80=98modify-inputs=E2=80=99 preserve=
s labels, which is a
source of confusion.  For instance, if you do:

  (modify-inputs x
    (replace "openmpi" mpich))

then =E2=80=98mpich=E2=80=99 remains associated with the =E2=80=9Copenmpi=
=E2=80=9D label.  Ugh.

So I sympathize with the goal.  I think we can do something simpler
though:

>  (define (lookup-input inputs name)
>    "Lookup NAME among INPUTS, an input list."
>    ;; Note: Currently INPUTS is assumed to be an input list that contains=
 input
>    ;; labels.  In the future, input labels will be gone and this procedur=
e will
>    ;; check package names.
> -  (match (assoc-ref inputs name)
> -    ((obj) obj)
> -    ((obj _) obj)
> -    (#f #f)))
> +  (let ((candidates (specification->inputs name inputs)))
> +    (and (not (null? candidates))
> +         (second (first candidates)))))

How about:

  (find (match-lambda
          ((_ (? package? package) . _)
           (string=3D? (package-name package) name))
          (_ #f))
        inputs)

?

That way, =E2=80=98lookup-input=E2=80=99 would honor package names and igno=
re labels.

> +(define (delete-input name inputs)
> +  "Delete input NAME within INPUTS."
> +  (let ((to-delete (specification->inputs name inputs)))
> +    (lset-difference equal? inputs to-delete)))

And we do something similar here.

Thus, no need to fiddle with specifications.

How does that sound?

Now, I think this is the way forward, but I also think it=E2=80=99s going to
break many packages and workflows (=E2=80=98--with-input=E2=80=99=E2=80=A6)=
.  So it should go
hand in hand with an effort to fully remove labels in Guix.

Thanks,
Ludo=E2=80=99.





Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.