system init doesn't work with -e

  • Open
  • quality assurance status badge
Details
One participant
  • rendaw
Owner
unassigned
Submitted by
rendaw
Severity
normal
R
R
rendaw wrote on 14 Apr 2019 10:46
(address . submit@debbugs.gnu.org)
880d5365-ca15-e70a-97d2-fc20e5a1a713@s.rendaw.me
Package: guix
Version: 0.16.0

I discussed this on irc and was recommended to ask about it on the
mailing list - I decided to send it to the bug tracker because if it's
decided to be a bug there's one less step.

Loosely copying irc logs:

<rendaw> Hello! I'm getting "wrong number of arguments for action
'init'" when I do "guix system init -e '(my-func arg1 arg2)' /mnt" - is
there something obvious I'm doing wrong? I googled around but the only
result I found was logs from 2 years ago that are gone now
<rendaw> Also, the docs aren't specific in this regard - will the
filesystem created by "guix system init" be a bootable system? Like
disk-image but on a mounted empty filesystem? The other way I could
interpret the docs for that command are that "init" copies all the files
required to build the system (source files, guix binaries, etc) into a
directory for backup purposes
<kmicu> Hi rendaw. why do you pass -e flag to system init?
<rendaw> To pass arguments into the build
<rendaw> (drive uuids, secrets I don't want to commit to the system
config, etc)
<rendaw> I suppose I image it's the same reason one would want to pass
-e to system disk-image or system-vm or whatever

<samplet> Near the bottom of “guix/scripts/system.scm” it has a “case”
form that checks if the action is “init” and then makes sure the
argument count is exactly two.
<samplet> It would be pretty easy to fix, but I recommend contacting the
mailing list before doing anything, in case there is a good reason for it.

<kmicu> rendaw: ‘-e’ contributor didn’t handle init case, intention was
‘(guix-system): Allow commands taking a file as an argument to use an
expression instead.’ but there is a check for init that doesn’t allow
that currently.
<kmicu> rendaw: more at 5a72ddf176d53a7f4df922985d9d7fd4cfa160f5
<rendaw> kmicu: So I guess it sounds unintentional?
<samplet> rendaw: The main issue seems to be that the “process-action”
procedure assumes the target to be the second argument. If there were
no configuration file, it would have to be the first.
<samplet> I’m not certain, but I bet with a little tweak to
“process-action”, you could remove the check and everything would work fine.
<rendaw> I suppose none of the other actions have a target parameter
<kmicu> rendaw: yep, you are basically the first user using init with
-e. Congrats xD
<rendaw> :D
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 35266@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 35266
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch