From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id eLGmDI3tuV5/BwAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 00:27:57 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uNuJFJvtuV7gXwAAB5/wlQ (envelope-from ) for ; Tue, 12 May 2020 00:28:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CF73B940DC5 for ; Tue, 12 May 2020 00:28:08 +0000 (UTC) Received: from localhost ([::1]:56476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYImG-0000R8-Rf for larch@yhetil.org; Mon, 11 May 2020 20:28:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYImA-0000R1-Cc for bug-guix@gnu.org; Mon, 11 May 2020 20:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYImA-00034V-3g for bug-guix@gnu.org; Mon, 11 May 2020 20:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYIm9-00007A-Vd for bug-guix@gnu.org; Mon, 11 May 2020 20:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40549: More usability issues: Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 12 May 2020 00:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40549 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Tom Received: via spool by 40549-submit@debbugs.gnu.org id=B40549.1589243241386 (code B ref 40549); Tue, 12 May 2020 00:28:01 +0000 Received: (at 40549) by debbugs.gnu.org; 12 May 2020 00:27:21 +0000 Received: from localhost ([127.0.0.1]:53674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYIlU-00006A-L8 for submit@debbugs.gnu.org; Mon, 11 May 2020 20:27:21 -0400 Received: from mail-qv1-f52.google.com ([209.85.219.52]:33489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYIlT-00005w-R7 for 40549@debbugs.gnu.org; Mon, 11 May 2020 20:27:20 -0400 Received: by mail-qv1-f52.google.com with SMTP id ep1so5617618qvb.0 for <40549@debbugs.gnu.org>; Mon, 11 May 2020 17:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pa25E2TMPyz/EKsc+RnmouzavvgSICXxQh+FY8h6K1U=; b=qmzi4im56pKJSCsLdLzj+uHaMNwt4MNHhaPgNkMjwxtq2YUftblIuSm2wLpnTFpcqh 6roVXozGHwg6q6PfgDTYxtcif+3ouuQib/2M0w4RtiuLNeZ6UkmNusNaqd89+pV0jhmf uRekAFQOZ5KMBq6K8QqcBnALlG4b0N3xnXNHCxG0lIgDhe7v04Jo2V/koDJc+6dM8szU sUH66K87+IPZtebmZ1lJPb1o+8KJsp8i0+mgkonzDxtjym+UE1UL8LcUVvmmQd6vhWVo FIzsryAhbzMNvI/hMsHe0z9VmUD1AcCF7rcz8q3WCzBnVyb9nOYud7jQglykBUkzyjZE F4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pa25E2TMPyz/EKsc+RnmouzavvgSICXxQh+FY8h6K1U=; b=Xk2i3UEE/Oo6ORjDVc/iiJmHnH7nsx2z8il2FPgu/7YZwfMAmIY4DMZD+E6m0cj4gb qTsLDzRQ+2iuYXgl526AstFafR2Y0xzitCQH4qUJ0cx/J7+SqqPZSj1nc3bBiCq7BAWo ubEIM59aLupREiSfjNcSI1I3UWPo04zUyTdnsHrLjsvL33GQkyjxhHpv1Ix2QhmP/2WK OgIOGGfDPUcnEGWmB9Jt6veGN4D5oY6CR8VndaFM86rO6VYncljASYqG1LI6z0ue9GL7 et+/5NDJ08XKGgStzkqMs2A6G1IlRT4cNqt6NoAxA3derAKwCAjSf8jbyFsM2OzBQKEC QlaA== X-Gm-Message-State: AGi0PuZfeGIWYFNV4YmAPcBBDSr1TAuYVmV8e7ZUWqfvjf5sPPBDBQUj kkrIHJ/JxE9MJTxkf6TUPlJOLISyf24tZAbn+2s= X-Google-Smtp-Source: APiQypITibiLiewIGG8A+sW/0P7x6mTTBl3oxq2WPGfMQia0NWoUbpuU9RjEM9gxIiewRtLclZIGZkqjp8YGEv2XEpc= X-Received: by 2002:ad4:4c92:: with SMTP id bs18mr18403353qvb.67.1589243234209; Mon, 11 May 2020 17:27:14 -0700 (PDT) MIME-Version: 1.0 References: <6171889.DvuYhMxLoT@cherry> <3827671.e9J7NaK4W3@peach> In-Reply-To: From: zimoun Date: Tue, 12 May 2020 02:27:03 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 40549@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=qmzi4im5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.53994740128298]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.07), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[zimontoutoune@gmail.com,bug-guix-bounces@gnu.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[40549@debbugs.gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: 34Js2JVugcVt TLDR: there is no "real" bug. :-) Just a choice to do and document it. On Fri, 24 Apr 2020 at 10:28, zimoun wrote: > guix package -I -A # does nothing > guix package -A -I # list available Expected. First line, -I -A' means that '-A' is seen as an argument for '-I'. Idem for the second line '-A -I', i.e., '-I' is seen as an argument for '-A'. > --8<---------------cut here---------------start------------->8---> # OK > guix package --list-generations -p /path/to/profile > guix package --list-installed -p /path/to/profile > > # KO > guix package -l -p /path/to/profile > guix package -I -p /path/to/profile > > # OK > guix package -p /path/to/profile -l > guix package -p /path/to/profile -I > > # KO > guix package -l --profile=/path/to/profile > > # Do nothing > guix package -I --profile=/path/to/profile > > # OK > guix package -l --profile=/path/to/profile -l > guix package -I --profile=/path/to/profile -I > --8<---------------cut here---------------end--------------->8--- All are expected too. Same reason. And the long option works because no argument is provided by '=' so it fallback to the default one "". Short options expect an argument so read the next characters as the value or fallback to the default one "" when there is no next character. Fixing this will add complexity on parsing 'args' when building 'opts'. Basically, "guix package -I -p /path/tp/profile" returns an error because the short option '-I' expect only one argument, read '-p' and then Guix cannot deals with the option '/path/to/profile' and so raises an error. See the dance with 'handle-argument' and 'arg-handler'. And "guix package -I '' -p /path/to/profile' works, obviously. Well, the extra quotes ('') is annoying but I am not convince that better could be done for short options -- regardless the order of CLI arguments. One solution should be add short options as '-AA' or '-II' for such cases. But I am not convince that such "weird" combination deserves such attention. :-) Back to the initial report: (a) guix package -S 17 -d 18 # KO (b) guix package -d 18 -S 17 # OK This is not the same issue than the one described previously. Here the culprit is 'process-actions'. And composing "action" seems more than legitimate (composing "query" is questionable). Why (a) works and (b) not? Because the command-line is transformed into an alist. And this alist is built reading the command-line from right to left. Therefore, if you are on the generation 18 and you try to delete it, Guix raises an error which seems expected. The second one (b) works because first you switch and then you delete. Well, that's said, IMHO, two options: 1) the order of CLI does not matter; 2) the order of CLI matters. Well, the order of 'actions' necessary matters as it is seen with this example: "switch and then delete" does not end in the same state than "delete and then switch". Welcome in the classical mess of imperative package manager. ;-) Therefore, I am not convinced that something should be fixed. It comes from the very nature of 'actions': actions is not always commutative. Otherwise the best is to forbid to provide several actions with the same transaction; which seems a bad idea -- at least for me. However, main of us are used to read from left to right so it seems more natural to write: guix package --action1 --action2 # (a) than guix package --action2 --action1 # (b) in other words, the fix should be to simply 'reverse opts' and the CLI will read (a) instead of the current (b). My only concern is about backward compatibility. My opinion based on backward compatibility argument is: let as it is and document it in the manual. WDYT? All the best, simon