From: Ian Eure <ian@retrospec.tv>
To: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix CLI, thoughts and suggestions
Date: Sat, 20 Jan 2024 14:50:56 -0800 [thread overview]
Message-ID: <87ttn7txra.fsf@retrospec.tv> (raw)
In-Reply-To: <87o7dmgsgm.fsf@zancanaro.id.au>
Hi Carlo,
Thank you for the thoughtful reply.
Carlo Zancanaro <carlo@zancanaro.id.au> writes:
> Hi Ian,
>
> Much of what you've written is fair, and I'm sure that Guix's
> commands
> could be better organised. I'm not really involved in Guix
> development,
> but I think there are two "inconsistencies" that you've
> mentioned which
> can be explained.
>
> On Mon, Jan 15 2024, Ian Eure wrote:
>> Some examples of where I think Guix could do better. This is
>> an
>> illustrative list, not an exhaustive one.
>>
>> Inconsistent organization
>> =========================
>>
>> Most package-related commands are under `guix package', but
>> many are
>> sibling commands. Examples are `guix size', `guix lint', `guix
>> hash',
>> etc.
>
> I think the real inconsistency here is that `guix package' is
> poorly
> named. This command really operates on profiles, and performs
> operations
> (install, remove, list, etc.) on those profiles. Packages are
> given as
> arguments to this command.
>
> The other commands operate on, and show the properties of,
> packages.
> Similarly with `guix build'.
>
Yes, I agree the behavior makes a bit more sense from that
viewpoint. However, it does have non-profile-related things in
it, such as `--show' and `--search'. This is getitng into another
thing I’ve seen a bit of, which is overloaded commands -- ones
that do multiple things that are unrelated or tangentally related.
But, I didn’t have a good example, and my message was long enough
already.
>> Inconsistency between verbs and options
>> =======================================
>
>> ... For example, installing a package is `guix package -i foo'
>> rather
>> than `guix package install foo', removing is `guix package -r
>> foo'
>> rather than `guix package remove foo', and listing installed
>> packages
>> is `guix package -I' rather than `guix package installed' (or
>> similar).
>
> The specific example of `guix package' might be explained by
> considering
> it as a single transaction to update the profile. The command
> `guix
> package' really says "perform a transaction on the profile", and
> the
> options are the commands in the transaction. Since there can be
> multiple
> commands, and the command names look like package names, they
> are
> provided as options.
>
> This doesn't fully explain the behaviour. In particular the
> example you
> give:
>
>> This means that users can express commands which *seem* like
>> they
>> should work, but do not. For example `guix package -i emacs -r
>> emacs-pgtk -I' represents a command to 1) install emacs 2)
>> remove
>> emacs-pgtk 3) list installed packages (which would verify the
>> previous
>> two operations occurred). ...
>
> seems reasonable to have working within the view of `guix
> package' as a
> transactional operation.
>
I agree that this would make sense, but my understanding is that
`guix package' doesn’t work like that -- it only performs the
final operation in the list. IMO, it should either do
*everything* the commands specify, or print an error and take no
action.
> It's also worth noting that there are convenience shortcuts in
> `guix
> install' and `guix remove'.
>
>> It seems like a lot of work to change, and backwards
>> compatibility
>> also is an issue.
>
> I see backwards compatibility as the main issue here. There was
> a lot of
> discussion preceding the inclusion of `guix shell', because of
> the
> prospect of breaking existing tutorials/documentation floating
> around on
> the internet. This is an even bigger concern for a more drastic
> reorganisation of the CLI.
>
I agree, I don’t think the situation can be improved without
finding a solution to preserve BC. But, I didn’t think it was
worth making detailed plans for any of this before gauging whether
the problem was one broadly considered to be worth solving.
— Ian
next prev parent reply other threads:[~2024-01-20 23:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 19:24 Guix CLI, thoughts and suggestions Ian Eure
2024-01-15 21:01 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-01-15 22:08 ` Carlo Zancanaro
2024-01-20 22:50 ` Ian Eure [this message]
2024-01-22 0:21 ` Carlo Zancanaro
2024-02-04 12:21 ` Rostislav Svoboda
2024-01-17 7:21 ` Efraim Flashner
2024-01-18 13:51 ` Rostislav Svoboda
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=87ttn7txra.fsf@retrospec.tv \
--to=ian@retrospec.tv \
--cc=guix-devel@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.