From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 16:39:13 2021 Received: (at submit) by debbugs.gnu.org; 4 Feb 2021 21:39:13 +0000 Received: from localhost ([127.0.0.1]:42392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7mLI-0005QK-MG for submit@debbugs.gnu.org; Thu, 04 Feb 2021 16:39:13 -0500 Received: from lists.gnu.org ([209.51.188.17]:54068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7mLG-0005QC-Au for submit@debbugs.gnu.org; Thu, 04 Feb 2021 16:39:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7mLG-0008Gt-3h for bug-guix@gnu.org; Thu, 04 Feb 2021 16:39:10 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7mL9-0000rg-1u for bug-guix@gnu.org; Thu, 04 Feb 2021 16:39:09 -0500 Received: by mail-wr1-x42f.google.com with SMTP id g10so5339633wrx.1 for ; Thu, 04 Feb 2021 13:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=oidguQiXf/qg28XF12p7wmSWiVsyux5jxhY7CSCfIKI=; b=S2QrzAVSo7otjZpJReX2rXSf7LaZxBv/vA1YABfKSo8PXyEro4tx2pE26tJjpaP74B AMDDLXjuRub7EmC7XJi0lddsjelsH4pzP67kI9N1Pur2RLMPWdakSSTXdkIz2ywZi82/ d/Ktlvr2TRW7aVmqOigIg+vF50ap1cTyjtphTr/3MdXFVSUARWdrIGLL9evR7ZKk2UJM gXVMjqElL6CrawRB7dWs0TYMhtkQB4tVzx4VrKMn8503Hon0236njNuFpGiFgb7t7oYX CCj4iSazjqKxZE/6KvGN07ybcS3DWLVqbdGaeqMHKc0aRBnMfuMtmqrfBowCCtMg0gng yvNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=oidguQiXf/qg28XF12p7wmSWiVsyux5jxhY7CSCfIKI=; b=hWLCELy1v+fmmgeoDwmDhtIPmZF3C47Dx/UiDLZNP5xexBj2w3qSHBUmlIkgfb0UQt MF1VzBIbY9DrWyR1S8+ig4XTJjMkotonMZXtoN+PvA9Elr2BEFYqTq7/MbKkjQctGb6s DtboYJv/InU8F77S6vRF2LXzgFTYtVcqZwOniTvnXDg9KC7FsjjoHVtrM5UD3B5uiGln AEq88MEPX08VuWM3yniuHegUBDBktDh5TC8Xrg9OhdbGVDYdtFEobkPio82n6SQwcx0L uMkDWoJrw5mbDcIlxyBp5DnKeVqGYuKMJQt4hE4bvsQPN0rbbD1mzB6ZuHU0vnNbLs1c E8KQ== X-Gm-Message-State: AOAM533Fz6Pp0bVAYlxJJdxu6uhKOo2Cyc03XxBQraroIXli1slJsb4O Q71NasAuXKyYDWJrn06jmB/PE/Gfq+4= X-Google-Smtp-Source: ABdhPJxOM1oRVq0nbIb6zmX7t+/i6Y5+wO0BcuD7w16VmSywNdow77Ocue/lhk/667e5RlsS9IKH1A== X-Received: by 2002:adf:c6c1:: with SMTP id c1mr1469722wrh.326.1612474741595; Thu, 04 Feb 2021 13:39:01 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id d10sm9505721wrn.88.2021.02.04.13.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 13:39:01 -0800 (PST) From: zimoun To: Leo Famulari Subject: Re: Typo helper doesn't always know which command is missing In-Reply-To: References: <20210115163732.53665-1-zimon.toutoune@gmail.com> <20210119212810.20681-1-zimon.toutoune@gmail.com> Date: Thu, 04 Feb 2021 22:29:52 +0100 Message-ID: <86tuqrbjxr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42f.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: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi Leo, On Thu, 04 Feb 2021 at 14:53, Leo Famulari wrote: > On Tue, Jan 19, 2021 at 10:28:08PM +0100, zimoun wrote: >> * guix/utils.scm (string-distance): New procedure. >> (string-closest): New procedure. >> * tests/utils.scm: Test it. > > This is a great feature, but I found a tricky failure: > > ------ > $ ./pre-inst-env guix system vm --no-grafts doc/os-config-bare-bones.texi= --substitute-urls=3Dhttps://ci.guix.gnu.org -d > guix: system: command not found=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > hint: Did you mean `system'? > > Try `guix --help' for more information. > $ guix environment guix > $ ./pre-inst-env guix system vm --no-grafts doc/os-config-bare-bones.texi= -d > /gnu/store/pw453xpixcll02w1nz9mfggm2cn0jqpx-run-vm.sh.drv > ------ > > It will only be seen by developers, so not a big deal, but it would > still be nice to correctly report which command is missing. Some > run-time dependency of guix is missing. I am missing, because the command line is not wrong. :-) Well, I am missing what you are suggesting. I mean if =E2=80=9C./pre-inst-= env guix =E2=80=9D is run in an incorrect environment, then, I am not sure= what could be done. How does it work with a commit which predates the hint introduction? How does it fail? I guess it fails, if not I am missing something. :-) Basically, when =E2=80=9Cguix system=E2=80=9D is called (or any other comma= nd), it enters in =E2=80=99run-guix-command=E2=80=99 and does this snippet: --8<---------------cut here---------------start------------->8--- (catch 'misc-error (lambda () (resolve-interface `(guix scripts ,command))) (lambda _ (let ((hint (command-hint command (commands)))) (format (current-error-port) (G_ "guix: ~a: command not found~%") command) (when hint (display-hint (format #f (G_ "Did you mean @code{~a}?") hint))) (show-guix-usage))))) --8<---------------cut here---------------end--------------->8--- Therefore, it means that =E2=80=9C(resolve-interface `(guix scripts ,comman= d))=E2=80=9D fails for some reasons. It seems really hard to catch the reasons. Well, this cannot happen with regular =E2=80=9Cguix =E2=80=9D otherwis= e it is severe bug. And in a developer setup, so much stuff could be wrong. Well, these run-time dependencies could be checked by the script =E2=80=9C./pre-inst-env=E2=80=9D but I do not know if it is worth. Could you explain more what you would like? On a side note, trying I get that the hint seems to work=E2=80=A6 --8<---------------cut here---------------start------------->8--- $ guix system vm --no-grafts ~/src/guix/guix/doc/os-config-bare-bones.texi = --substitute-urls=3Dhttps://ci.guix.gnu.org --dry-run --derivatio guix system: error: derivatio: unrecognized option hint: Did you mean `derivation'? --8<---------------cut here---------------end--------------->8--- =E2=80=A6but not work for all the options: --8<---------------cut here---------------start------------->8--- $ guix system vm --no-grafts ~/src/guix/guix/doc/os-config-bare-bones.texi = --substitute-rls=3Dhttps://ci.guix.gnu.org --dr-run --derivation guix system: error: substitute-rls=3Dhttps://ci.guix.gnu.org: unrecognized = option --8<---------------cut here---------------end--------------->8--- Another story than your report, right? Cheers, simon