[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59071: guix home does not respect package outputs
From: |
Ludovic Courtès |
Subject: |
bug#59071: guix home does not respect package outputs |
Date: |
Thu, 10 Nov 2022 10:54:13 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi,
pronaip@riseup.net skribis:
> This should be a good enough reproducer:
>
> ```
> (home-environment
> (packages
> (map specification->package+output
> (list "glib:bin"
> ...)))
> ...)
> ```
‘specification->package+output’ returns two values:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (specification->package+output "glib:bin")
$38 = #<package glib@2.73.3 gnu/packages/glib.scm:445 7f0988d69b00>
$39 = "bin"
--8<---------------cut here---------------end--------------->8---
However, ‘map’ expects its first argument to return one value and thus
discards additional values:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (map specification->package+output '("glib:bin"))
$40 = (#<package glib@2.73.3 gnu/packages/glib.scm:445 7f0988d69b00>)
--8<---------------cut here---------------end--------------->8---
Instead, you have to write ‘specifications->packages’:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (specifications->packages '("glib:bin" "inkscape"))
$42 = ((#<package glib@2.73.3 gnu/packages/glib.scm:445 7f0988d69b00> "bin")
(#<package inkscape@1.2.1 gnu/packages/inkscape.scm:244 7f097cf246e0> "out"))
--8<---------------cut here---------------end--------------->8---
That’s what ‘guix home import’ does now, but I noticed it’s not
documented so I’ll add it to the manual.
Thanks,
Ludo’.