Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix environment'

From: Liliana Marie Prikler <[email-masked]>
Date: Thu, 07 Oct 2021 11:15:16 +0200

Hi Ludo,

Am Donnerstag, den 07.10.2021, 10:34 +0200 schrieb Ludovic Courtès:
> > The behavior of "guix shell" with and without arguments is
> > sufficiently different, which will make it a challenge to document,
> > and then a challenge for users to understand. And part of the
> > criticism related to the tacit execution of files is about the
> > convenience for 1) vs. the risk in 2).
> 
> ‘guix shell’ without arguments is equivalent to ‘guix environment -f
> guix.scm’ or ‘guix environment -m manifest.scm’.
> 
> > So... how about making this two different commands? They could of
> > course share most of the implementation.
> > 
> > I'd use "guix shell" for the scenario that actually starts a shell,
> > and something different, perhaps "guix process", for the
> > infrastructure command for use in scripts.
> 
> I don’t think there’s enough to warrant two different commands (and
> perhaps we could leave out the auto-detection of ‘guix.scm’ or
> ‘manifest.scm’ is that proves to be too controversial).
Leaving out the auto-detection of ‘guix.scm’ and ‘manifest.scm’ for now
is a good idea, given that Guix itself would be an edge-case for that.

Perhaps to avoid this trouble, guix shell could read a file that simply
specifies which arguments to add one line at a time e.g.

  ;; .guix-shell-rc
  --manifest=manifest.scm

or

  ;; .guix-shell-rc
  --load=guix.scm

Similar behaviour is used in other (GNU) tools with lots of available
arguments, which operate on a directory basis, e.g. stow.

> Maybe you’re hinting at the name and the fact that it suggests it’s
> starting a shell.  I’m not fond of it, notably for that reason.  For
> the record, it came out as the only proposal that seemed viable to
> me:
> 
>   https://issues.guix.gnu.org/38529#17
> 
> Thoughts?
I think “guix shell” is fine as-is.  People typically don't complain
that “sh somefile.sh” doesn't launch a shell, so the same reasoning can
be applied to Guix tools in my opinion.  We would still have the always
non-intuitive naming choices of “do”, “start” and “run” at our disposal
if we ever need to discard the shell.

Regards,
Liliana