unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59071: guix home does not respect package outputs
@ 2022-11-06  0:18 pronaip
  2022-11-10  9:54 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: pronaip @ 2022-11-06  0:18 UTC (permalink / raw)
  To: 59071

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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#59071: guix home does not respect package outputs
  2022-11-06  0:18 bug#59071: guix home does not respect package outputs pronaip
@ 2022-11-10  9:54 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-11-10  9:54 UTC (permalink / raw)
  To: pronaip; +Cc: 59071

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’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-10  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06  0:18 bug#59071: guix home does not respect package outputs pronaip
2022-11-10  9:54 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).