GNU bug report logs - #50473
'guix package' processes command-line %actions in reverse

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: zimoun <zimon.toutoune@HIDDEN>; dated Wed, 8 Sep 2021 12:44:01 UTC; Maintainer for guix is bug-guix@HIDDEN.
Changed bug title to ''guix package' processes command-line %actions in reverse' from 'Unordered ’%actions’ process from ’guix package’' Request was from Tobias Geerinckx-Rice <me@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Sep 2021 12:43:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 08 08:43:25 2021
Received: from localhost ([127.0.0.1]:58862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNwvE-0001np-TE
	for submit <at> debbugs.gnu.org; Wed, 08 Sep 2021 08:43:25 -0400
Received: from lists.gnu.org ([209.51.188.17]:34706)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mNwvD-0001ni-Fy
 for submit <at> debbugs.gnu.org; Wed, 08 Sep 2021 08:43:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45004)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1mNwvD-0002Cd-37
 for bug-guix@HIDDEN; Wed, 08 Sep 2021 08:43:23 -0400
Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:38457)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1mNwvB-0005Nj-9n
 for bug-guix@HIDDEN; Wed, 08 Sep 2021 08:43:22 -0400
Received: by mail-wm1-x335.google.com with SMTP id
 k5-20020a05600c1c8500b002f76c42214bso1495835wms.3
 for <bug-guix@HIDDEN>; Wed, 08 Sep 2021 05:43:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:subject:date:message-id:mime-version;
 bh=JLzO5smS4TTchNQpfKyt8tDMkWJifOXlsS1xrWg39n0=;
 b=P/VOS7XvxQTwrbzM+r23CsOOIMakEhMMRY4S6V+PQuub7sHO6QbiU7iEnpA8pT918m
 bCzHlgPEjBaAdTedSIf4Dv+LuTC3droj0XFVbEFDnoa0IT09+p/r6a1128T8vFQFm/3w
 BBhVOTGMxbpFf3fcvvv72lgdkFms5t17dWvfqJuSs/9BBemmOk/74n83FuAEwerfbERp
 4nMsmfknQIV90DLMKogshYIDnu5pEGWrIiZyvprxUUvH4RUP21Hwaf/znRCRea8Ob9qa
 8nETOp4C19JkiyPCoEaELTP1yDkz3UamKB0TY6BeefuTwbTQtRguZz31d8Pgh0lRuq8I
 7NgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=JLzO5smS4TTchNQpfKyt8tDMkWJifOXlsS1xrWg39n0=;
 b=MBJNA/XYYQtF2Wb5vBVXH3ubXrNplHJdRyk7b+cJI4vLGivPwO/iR68hg8lmvsyB32
 gfjVsShBdyyIgL9DpRmrflJokL4fcQ5sVqhyoJnhVzWmSeGm09r2ZSZT+6DlZM1ZwJyg
 Fz0mo8YQNuAH2ma97YiyPQW+hUJZxc2OS/dsD18j1UkLv1xnbNm2jcdWCVD0VwfedFXY
 +5lGswpRfXzxy9wninh/tGivUcvAfETlLEu1Q5ij2MPodXr4wHpv2ORuOgfO2xQ0XZ8X
 YxB+Abevdrn7gBJTheBatjs874npQ0zBw3lxbfuE8UJ3NZldhNbLiPJprZSLCC/Is11s
 GAXw==
X-Gm-Message-State: AOAM531W2I8R8iui9Kj00ZPtozVE7qfXZKUsHFLwlaIHH+emspNjs9tv
 LypCnDhfbm49+3Hx0gg92qDNTd/X/oI=
X-Google-Smtp-Source: ABdhPJyucbCqPAOByy60t6oPPBbObE1+BSdpNoeqdRKlP8FvaG6QZlDZ46pMe/fwS0l4VvUffITwDw==
X-Received: by 2002:a05:600c:4fc1:: with SMTP id
 o1mr3479776wmq.4.1631104999961; 
 Wed, 08 Sep 2021 05:43:19 -0700 (PDT)
Received: from jack-Precision-7820-Tower ([193.48.40.117])
 by smtp.gmail.com with ESMTPSA id r129sm1947146wmr.7.2021.09.08.05.43.19
 for <bug-guix@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Sep 2021 05:43:19 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: bug-guix@HIDDEN 
Subject: Unordered =?utf-8?B?4oCZJWFjdGlvbnPigJk=?= process from
 =?utf-8?Q?=E2=80=99guix_package=E2=80=99?=
Date: Wed, 08 Sep 2021 14:43:12 +0200
Message-ID: <864kav2q73.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::335;
 envelope-from=zimon.toutoune@HIDDEN; helo=mail-wm1-x335.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.3 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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

1: <http://issues.guix.gnu.org/40549>
2: <http://issues.guix.gnu.org/50472>




Acknowledgement sent to zimoun <zimon.toutoune@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#50473; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 8 Sep 2021 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.