unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 50501@debbugs.gnu.org
Subject: bug#50501: packages->manifest can lose the desired package output
Date: Tue, 14 Sep 2021 11:55:24 +0200	[thread overview]
Message-ID: <87ilz35vn7.fsf@gnu.org> (raw)
In-Reply-To: <f6914d44384d3e611728d8a8ab47d586c0a04101.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 10 Sep 2021 16:26:25 +0200")

Hi,

Liliana Marie Prikler <liliana.prikler@gmail.com> skribis:

> Am Freitag, den 10.09.2021, 12:34 +0300 schrieb Efraim Flashner:
>> I've been fighting my manifest to try to get "git" and "git:send-
>> email" both included, while using package transformations. For the
>> sake of brevity, here's a stripped down version of my manifest:
>> 
>> (packages->manifest
>>   (map specification->package+output
>>     '("git" "git:send-email")))
>> 
>> Here's what I learned from some experimentation:
>> 
>> (cmd)scheme@(guile-user)> (specification->package+output "git:send-
>> email")
>> $14 = #<package git@2.32.0 gnu/packages/version-control.scm:176
>> 7f730e918320>
>> $15 = "send-email"
>> (ins)scheme@(guile-user)> (list (specification->package+output
>> "git:send-email"))
>> $16 = (#<package git@2.32.0 gnu/packages/version-control.scm:176
>> 7f730e918320>)
>> (ins)scheme@(guile-user)> (list (specification->package+output
>> "git"))
>> $17 = (#<package git@2.32.0 gnu/packages/version-control.scm:176
>> 7f730e918320>)
>> 
>> Meanwhile, (specifications->manifest '("git" "git:send-email")) does
>> actually return a manifest with both the "out" and the "send-email"
>> outputs of git.
>> 
>> (package->manifest-entry (specification->package+output "git:send-
>> email"))
>> returns a manifest entry for "git:out" and
>> (package->manifest-entry git "send-email") returns a manifest entry
>> for
>> "git:send-email".
> I think for this use of specification->package+output you need to
> compose it with list like (compose list specification->package+output). 
> The reason you observe this behaviours is that specification-
>>package+output returns multiple values, whereas package->manifest-
> entry expects a single value which is either a package or a list of the
> form (package "output").

Yes, and Guile truncates multiple-value returns by default:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (list (values 1 2))
$7 = (1)
scheme@(guile-user)> (+ (values 1 2) 2)
$8 = 3
--8<---------------cut here---------------end--------------->8---

Ludo’.




      reply	other threads:[~2021-09-14  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  9:34 bug#50501: packages->manifest can lose the desired package output Efraim Flashner
2021-09-10 14:26 ` Liliana Marie Prikler
2021-09-14  9:55   ` 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=87ilz35vn7.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=50501@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /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).