all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: "André A. Gomes" <andremegafone@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: guix shell without arguments
Date: Fri, 12 May 2023 09:10:06 -0400	[thread overview]
Message-ID: <CAJ=RwfaYrJqcREgbww_XmfBzsfTjF+9tiLm2Zb0N9Dq8puS=SA@mail.gmail.com> (raw)
In-Reply-To: <871qjlizan.fsf@gmail.com>

Hi Andre,

On Fri, May 12, 2023 at 7:07 AM André A. Gomes <andremegafone@gmail.com> wrote:
>
> Hello Guix,
>
> Issuing guix shell without arguments is equivalent to the command below,
> when guix.scm exists in the directory where it's being issued:
>
> --8<---------------cut here---------------start------------->8---
> guix shell -D -f /path/to/guix.scm
> --8<---------------cut here---------------end--------------->8---
>
> I am wondering if there's a more succinct way of saying:
>
> --8<---------------cut here---------------start------------->8---
> guix shell -D -f /path/to/guix.scm -- foo-command
> --8<---------------cut here---------------end--------------->8---
>
> The incantation below creates an empty environment.  But wouldn't it be
> nice if it would infer manifest.scm or guix.scm, in case they exist in
> the current directory?
>
> --8<---------------cut here---------------start------------->8---
> guix shell -- foo-command
> --8<---------------cut here---------------end--------------->8---

I agree with you! It's a big usability issue! Even though I'm aware of
this behavior, I still catch myself trying to do `guix shell --
foo-command` from time to time and being disappointed. I filed an
issue about this awhile back and the tl;dr is that the behavior can't
be changed (at least not easily) without breaking things for users who
have different expectations/needs: https://issues.guix.gnu.org/57467

There seem to be two main use cases that are sort of at odds with each other:

1) Users who invoke 'guix shell' in their terminal and want "do what I
mean" implicit behavior (I'm in this group and suspect you are, too)
2) Users who invoke 'guix shell' in scripts and want all behavior to
be explicit using flags so that the scripts behave in a reliable way

'guix shell' is primarily focused on case 2, and case 1 is only
supported when 'guix shell' has no other args, as you've noticed.
Perhaps this is an indicator that we need two different tools.  I've
thought for years that we need a 'guix develop' (working title) tool
that does what 'guix shell' does but also goes beyond by starting
containerized services like 'docker compose' can. For example, if a
project requires a PostgreSQL database, 'guix develop' could create a
shell environment with the client program/library but also
automatically start the server using an instance of Shepherd and
'herd' inside the shell could be used to control the service.

- Dave


  parent reply	other threads:[~2023-05-12 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 11:06 guix shell without arguments André A. Gomes
2023-05-12 12:18 ` Simon Tournier
2023-05-12 16:14   ` Thompson, David
2023-05-13 12:05     ` Simon Tournier
2023-05-12 16:19   ` André A. Gomes
2023-05-12 13:10 ` Thompson, David [this message]
2023-05-12 14:17   ` Hafeez Bana
2023-05-14 15:51     ` Felix Lechner via

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ=RwfaYrJqcREgbww_XmfBzsfTjF+9tiLm2Zb0N9Dq8puS=SA@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=andremegafone@gmail.com \
    --cc=help-guix@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.