GNU bug report logs - #59071
guix home does not respect package outputs

Previous Next

Package: guix;

Reported by: pronaip <at> riseup.net

Date: Sun, 6 Nov 2022 08:37:01 UTC

Severity: normal

Tags: notabug

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: pronaip <at> riseup.net
Cc: 59071 <at> debbugs.gnu.org
Subject: bug#59071: guix home does not respect package outputs
Date: Thu, 10 Nov 2022 10:54:13 +0100
Hi,

pronaip <at> 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 <at> 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 <at> 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 <at> 2.73.3 gnu/packages/glib.scm:445 7f0988d69b00> "bin") (#<package inkscape <at> 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’.




This bug report was last modified 2 years and 195 days ago.

Previous Next


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