Subject: Re: bug#53030: Can't (specification->package "package@version:output")

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Wed, 05 Jan 2022 21:36:02 +0100

Calcium,

Thanks for the report!

In future, please submit separate issues separately, it helps keep 
discussion, er, separate.  It's easier to merge issues than to 
split them.

> Can't (specification->package "package@version:output")

Short answer: it is not intended to work.  Use 
specification->package+output if you want outputs.  This is not a 
bug but a design decision.  Which are not above critique, but 
guix-devel@ might be a better place for that.

I've considered in the past to submit a cheeky patch silently 
renaming specification->package+ouput to specification->package, 
just to avoid this FAQ.  It should be almost perfectly backwards 
compatible in that no existing code should break with the same 
input.

However I think clarity the greater value here, and did not submit 
such a patch.

calcium via Bug reports for GNU Guix 写道：
> The syntaxe to specify a package version and desired output
> only works on guix install package@version:output
>
> guix remove package@version:output doesn't works

I cannot reproduce this:

  $ guix install [email-masked]:send-email
  $ guix remove [email-masked]:send-email
  $

Can you provide an example?

> guix remove package@version doesn't works

‘package@version’ means ‘package@version:out’, not (a 
hypothetical) ‘package@version:*’ wildcard.  It neither installs 
nor removes ‘all outputs’.

I did notice that, e.g.,

  $ guix install git@2:send-email
  $ guix remove git@2:send-email
  guix remove: error: package 'git@2:send-email' not found in 
  profile
  $

is asymmetrical.  I wonder if there are any drawbacks to making it 
work.

Kind regards,

T G-R