From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uIzIJNvrpGLXGAEAbAwnHQ (envelope-from ) for ; Sat, 11 Jun 2022 21:24:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kM7MJNvrpGItMwEA9RJhRA (envelope-from ) for ; Sat, 11 Jun 2022 21:24:11 +0200 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 491802CEB5 for ; Sat, 11 Jun 2022 21:24:11 +0200 (CEST) Received: from localhost ([::1]:39818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o06iQ-0000H6-Gl for larch@yhetil.org; Sat, 11 Jun 2022 15:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o06iI-0000Gv-Dc for bug-guix@gnu.org; Sat, 11 Jun 2022 15:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o06iI-0000J2-4I for bug-guix@gnu.org; Sat, 11 Jun 2022 15:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o06iH-0005BQ-UZ for bug-guix@gnu.org; Sat, 11 Jun 2022 15:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55913: run-guix-command catches too much, causing bogus "guix: ~a: command not found" error messages Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 11 Jun 2022 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55913 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 55913@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165497540219868 (code B ref -1); Sat, 11 Jun 2022 19:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jun 2022 19:23:22 +0000 Received: from localhost ([127.0.0.1]:54060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o06hd-0005AO-Tl for submit@debbugs.gnu.org; Sat, 11 Jun 2022 15:23:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:47312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o06hZ-0005AE-Uz for submit@debbugs.gnu.org; Sat, 11 Jun 2022 15:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o06hZ-0000F3-9C for bug-guix@gnu.org; Sat, 11 Jun 2022 15:23:17 -0400 Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:40474) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o06hP-0000HJ-Fx for bug-guix@gnu.org; Sat, 11 Jun 2022 15:23:09 -0400 Received: from [172.20.10.9] ([213.119.188.102]) by michel.telenet-ops.be with bizsmtp id hvP22700M2CzlQd06vP33d; Sat, 11 Jun 2022 21:23:03 +0200 Message-ID: <5d91e5d62cc52af3a0893c34e46b7a42c4eea8c5.camel@telenet.be> From: Maxime Devos Date: Sat, 11 Jun 2022 21:22:56 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-5yAl8T/KaXXFjfUpM8OP" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1654975383; bh=fzt3e5FgdQhZU/9NSzVQvcKnO+4JRHpFD3FH5Nv+xq4=; h=Subject:From:To:Date; b=SSD6uEuifi4Pj05/esXzx4BjvcLXBj5jn/G5RlupqZZYIwjMR122T3VHMoF+vz54D M2Be2rhjCVL/nhF+5wHVQNzR8ahfidJP4yChntkylS0CfBWN61wERrIrnfm7wQxI8I nnaLJ+NsQaKDLCX1VthB10zMl08kkegMICLsW6nymOLc3DMi76oIJ2w1AUb0jOr51a S0ZeJOMYJyJLi8Rm704BIhMnx5njoJ2N2mhO4zTGeW1TEgsIIzDiKNrC0XsKH6OHqS 9hwSC31HNhtaoTven/hLVt+2rR2b0jw0hNVV1RT+OW0wSdRQP+bsnBG9dDoXowYaXL Brhxf21XPWnYg== Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654975451; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=fzt3e5FgdQhZU/9NSzVQvcKnO+4JRHpFD3FH5Nv+xq4=; b=WPctBzOaROfFdm6+YZAI9PWHx06C0i0SNoDlyWlMCWrXqwf3alV+oT45VjQz16e68kI0fu vbdU4gE/OgXLJzN1XjfbF6IjG84tL0nE8/LDerx5mPu3uc83wLcL2+KSD0yh0CP7pkhtK/ oF8QFQone53ooEMPoVRUuk4P6zuoYVtwN4DacAUTHSxERlv6Rn1yyyG3Rzn1SD/Tx3fHdG JYxIaYzqCES1E6h7f/22+ZO42HHQrXuoob6+RlxV1Bvkxwr6HQmitHB39VsZRqgRxBCR1M UzX+LD0w82TsNSgP/ikXuPi1NqdusI1fc3bTSFzX1WaeN2mvDOjuPm3bwhDesw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654975451; a=rsa-sha256; cv=none; b=p5FJiFSXY1/VNyZrZ/VJyG8mn4ea/KQeMBxcSo8Jow7NWs9XtOpoobcI4e7ToA0AYFqw53 SM+uMkiODw1YpBDaR0yGE2PSe/DKrJCSgASDZ8ocPOtJCTo/Kd5CB95ELDr4HY27PUTHyn Bnsn/y5m8ROpD4APdUfSKkMdA7utfiC2tnXZisvif8KiuLDFKU/Pj3CicChDLMnLBYZC8G G3a+ojtGrgnkfl4V4aLumtNsgCcv2lasDPxtHpuO+KcvY/1tWFknwtp4KN/TZnmwyMD6rY 7vDMbir1QxwfOqvt2pkz4I8l1QWn1DSunttw3/+N/cZn1mnhzeYPmG4MdmkQow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=SSD6uEui; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.12 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=SSD6uEui; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 491802CEB5 X-Spam-Score: 5.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: R1nW1hi1YZBw --=-5yAl8T/KaXXFjfUpM8OP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Someone on IRC (#guix) didn't have guile-json in their environment or something. When they did "./pre-inst-env guix lint", that failed with "guix: lint: command not found", which is bogus, since guix/scripts/lint.{scm,go} existed. The issue was tracked down to the 'run-guix-command' procedure, in particular the definition of module: (define module ;; Check if there is a matching extension. (match [something that returns #false in this situation] (#f (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))))) (file [a case that doesn't apply here]))) To test the hypothesis that exception handling went wrong, the exception handling was modified to do some 'pk': (catch 'misc-error (lambda () (resolve-interface `(guix scripts ,command))) (lambda _ (pk 'what _) ; <---- new line! [old code])) which resulted in: ;;; (what (misc-error #f "no code for module ~S" ((json)) #f)) My proposal to avoid the wrong error message is (untested): ;; #:ensure #false: don't create an empty module when not found ;; (why is #:ensure #true even the default?). (let ((module (resolve-module `(guix scripts ,command) #:ensure #false))) (if module (module-public-interface module) ; script module was found [display hints & error message & guix-usage etc.])) (Reported-By: foobarxyz on #guix) Greetings, Maxime --=-5yAl8T/KaXXFjfUpM8OP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqTrkBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7htCAQDum2CrWDI/xIhamM2PkVPXNaQM eQgbhr5hoYnDTzHvJAD/cVRCjakoFcGUluGJ8cnQrt6D4gS/ns6aUOSjj6UdUAo= =5N7b -----END PGP SIGNATURE----- --=-5yAl8T/KaXXFjfUpM8OP--