guix home does not respect package outputs

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • pronaip
Owner
unassigned
Submitted by
pronaip
Severity
normal

Debbugs page

P
P
pronaip wrote on 5 Nov 2022 17:18
(name . Bug reports for GNU Guix)(address . bug-guix@gnu.org)
87sfixq69k.fsf@riseup.net
Package outputs are apparently tricky, people seem to tend to forget
they exist. This is another case of that.

This should be a good enough reproducer:
```
(home-environment
(packages
(map specification->package+output
(list "glib:bin"
...)))
...)
```
If you look at guix home describe --list-installed you'll see that all
the lines say "out" for the package output.

For a while I didn't notice this even though it **should** have broken
transmission:gui when I migrated my home config to guix home, but it
seems like the default profile did not get deleted. This is actually
pretty confusing because guix package still continues to work and it's
not clear if there is a precendence between it and guix home and what
that precedence might be. But that's for another bug report.
L
L
Ludovic Courtès wrote on 10 Nov 2022 01:54
(address . pronaip@riseup.net)(address . 59071@debbugs.gnu.org)
877d03kud6.fsf@gnu.org
Hi,

pronaip@riseup.net skribis:

Toggle quote (11 lines)
> This should be a good enough reproducer:
>
> ```
> (home-environment
> (packages
> (map specification->package+output
> (list "glib:bin"
> ...)))
> ...)
> ```

‘specification->package+output’ returns two values:

Toggle snippet (5 lines)
scheme@(guile-user)> (specification->package+output "glib:bin")
$38 = #<package glib@2.73.3 gnu/packages/glib.scm:445 7f0988d69b00>
$39 = "bin"

However, ‘map’ expects its first argument to return one value and thus
discards additional values:

Toggle snippet (4 lines)
scheme@(guile-user)> (map specification->package+output '("glib:bin"))
$40 = (#<package glib@2.73.3 gnu/packages/glib.scm:445 7f0988d69b00>)

Instead, you have to write ‘specifications->packages’:

Toggle snippet (4 lines)
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"))

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’.
L
L
Ludovic Courtès wrote on 10 Nov 2022 01:54
control message for bug #59071
(address . control@debbugs.gnu.org)
875yfnkucb.fsf@gnu.org
tags 59071 notabug
close 59071
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 59071@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59071
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch