mbox series

[bug#65062,core-updates,0/1] Specify output in input label when it's not "out".

Message ID cover.1691202289.git.hako@ultrarare.space
Headers show
Series Specify output in input label when it's not "out". | expand

Message

Hilton Chain Aug. 5, 2023, 2:50 a.m. UTC
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@8.45 gnu/packages/pcre.scm:41 7f59cd759bb0> "static")
           ("pcre" #<package pcre@8.45 gnu/packages/pcre.scm:41 7f59cd759bb0>)
           ("zlib" #<package zlib@1.2.13 gnu/packages/compression.scm:106 7f59c130bd10> "static")
           ("zlib" #<package zlib@1.2.13 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@8.45 gnu/packages/pcre.scm:41 7f6fe32efe70> "static")
           ("pcre" #<package pcre@8.45 gnu/packages/pcre.scm:41 7f6fe32efe70>)
           ("zlib:static" #<package zlib@1.2.13 gnu/packages/compression.scm:106 7f6fd244a000> "static")
           ("zlib" #<package zlib@1.2.13 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

Comments

Hilton Chain Aug. 5, 2023, 3:01 a.m. UTC | #1
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'.
Hilton Chain Aug. 5, 2023, 3:19 a.m. UTC | #2
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.