GNU bug report logs - #66358
Some options are really subcommands + ignore arguments

Previous Next

Package: guix;

Reported by: "Perry, Daniel J" <dperry45 <at> gatech.edu>

Date: Thu, 5 Oct 2023 05:14:03 UTC

Severity: normal

Full log


Message #8 received at 66358 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: "Perry, Daniel J" <dperry45 <at> gatech.edu>
Cc: control <at> debbugs.gnu.org, 66358 <at> debbugs.gnu.org
Subject: Re: bug#66358: Can't import package using archive command
Date: Mon, 09 Oct 2023 14:25:51 +0200
retitle 66358 ‘guix archive --{authorize,import,…}’ are really 
subcommands + ignore some arguments
thanks

Hi Daniel,

The error is correct, so I sure hope it's reproducible!

Later options cancel out previous ones, so your ‘--authorize’ action 
takes precedence over ‘--import’.  You're passing it a binary .nar 
archive as a private key (which is an s-expression).

Boom.

Instead:

  1.  guix archive --export hello > hello.nar
  2.  guix archive --authorize < export-host.private-key
  3.  guix archive --import < hello.nar

Note that you had an extra ‘hello’ in your --import command as well.  
Please note that it does nothing.  Option parsing in Guix is 
surprisingly lax.

I started thinking about a nice way to make ‘--action’ options mutually 
exclusive, but reconsidered.  I think it would violate POLA if not 
POSIX.

I think it would be less surprising if these ‘single, mutually exclusive 
actions’ should always be (sub)subcommands, e.g., ‘guix archive import’, 
‘guix archive authorize’, …

I don't know if that change is still worth making here.

Kind regards,

T G-R

Sent from a Web browser.  Excuse or enjoy my brevity.




This bug report was last modified 1 year and 240 days ago.

Previous Next


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