unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: pronaip@riseup.net
Cc: 59071@debbugs.gnu.org
Subject: bug#59071: guix home does not respect package outputs
Date: Thu, 10 Nov 2022 10:54:13 +0100	[thread overview]
Message-ID: <877d03kud6.fsf@gnu.org> (raw)
In-Reply-To: <87sfixq69k.fsf@riseup.net> (pronaip@riseup.net's message of "Sun, 06 Nov 2022 01:18:02 +0100")

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




      reply	other threads:[~2022-11-10  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06  0:18 bug#59071: guix home does not respect package outputs pronaip
2022-11-10  9:54 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877d03kud6.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=59071@debbugs.gnu.org \
    --cc=pronaip@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).