'guix package' processes command-line %actions in reverse

  • Open
  • quality assurance status badge
Details
2 participants
  • Tobias Geerinckx-Rice
  • zimoun
Owner
unassigned
Submitted by
zimoun
Severity
normal
Z
Z
zimoun wrote on 8 Sep 2021 14:43
Unordered ’%actions’ process from ’guix package’
(address . bug-guix@gnu.org)
864kav2q73.fsf@gmail.com
Hi,

Let consider:

$ guix package -S 17 -d 18

but

$ guix package -d 18 -S 17

does not the same thing. The '%actions' (roll-back, delete-generation,
switch-generation) are processed in reversed order as they appear on the
command-line -- because 'for-each' and 'assoc-ref'.

However, the transaction plan is always the same:

step0 process %actions
step1 remove
step2 install
step3 manifest

Therefore, I propose to split the 'for-each' on '%actions' (step0) into
fixed steps, such as the transaction always happens using this plan:

1. roll-back
2. switch-generation
3. delete-generation
4. remove
5. install
6. manifest

whatever the order in the command line.

On one hand, it reduces the "power" of combining '-S', '-d' and
'--roll-back'. On the other hand, it enforces commutativity which is
somehow what we want a transaction to be.

WDYT? I can come up with a patch. This initial issue had been reported
by bug#40549 [1].

(Note that an issue about short-name with optional argument can also
happen and tracked by bug#50472 [2].)

All the best,
simon

T
T
Tobias Geerinckx-Rice wrote on 8 Sep 2021 15:26
(no subject)
(name . Control)(address . control@debbugs.gnu.org)
d422af4c32c9d6f6271546e9794add94@tobias.gr
retitle 50473 'guix package' processes command-line %actions in reverse
thanks

('Failed to set the title of 50473: Non-printable characters are not
allowed in bug titles.' -- FFS...)
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 50473
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