From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jbranso--- via Bug reports for GNU Guix Newsgroups: gmane.comp.gnu.guix.bugs,gmane.lisp.guile.bugs Subject: bug#46241: Guile Macros did not print the error-line-number ? Date: Mon, 01 Feb 2021 13:12:42 -0500 Message-ID: <87r1lzodwl.fsf@dismail.de> Reply-To: Joshua Branson Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35794"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bug-guile@gnu.org To: 46241@debbugs.gnu.org Original-X-From: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Mon Feb 01 19:13:35 2021 Return-path: Envelope-to: gcggb-bug-guix@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6dhf-0009El-Lp for gcggb-bug-guix@m.gmane-mx.org; Mon, 01 Feb 2021 19:13:35 +0100 Original-Received: from localhost ([::1]:40552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6dhe-0000bx-MZ for gcggb-bug-guix@m.gmane-mx.org; Mon, 01 Feb 2021 13:13:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6dh9-0000Ri-20 for bug-guix@gnu.org; Mon, 01 Feb 2021 13:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6dh8-00089H-RN for bug-guix@gnu.org; Mon, 01 Feb 2021 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6dh8-0007Cw-L3 for bug-guix@gnu.org; Mon, 01 Feb 2021 13:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joshua Branson Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 01 Feb 2021 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46241 X-GNU-PR-Package: guix X-Debbugs-Original-To: bug-guix@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161220317827694 (code B ref -1); Mon, 01 Feb 2021 18:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Feb 2021 18:12:58 +0000 Original-Received: from localhost ([127.0.0.1]:33110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6dh3-0007Cc-On for submit@debbugs.gnu.org; Mon, 01 Feb 2021 13:12:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:34194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6dh1-0007CU-Pl for submit@debbugs.gnu.org; Mon, 01 Feb 2021 13:12:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6dh1-0000KD-BH; Mon, 01 Feb 2021 13:12:55 -0500 Original-Received: from mx1.dismail.de ([78.46.223.134]:42825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6dgz-00082S-0I; Mon, 01 Feb 2021 13:12:55 -0500 Original-Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id f4121d2c; Mon, 1 Feb 2021 19:12:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=date :message-id:from:to:cc:subject; s=20190914; bh=LRpZImnkAVJbKXU4W w0139hB4XHKo151x4VpBMNbL3E=; b=lwpHb6vmx/qGeiw4BM86+rqsLclJ7ABis XkEGR7CbIT1auMvs6WHT1f3h3qGpZXqvyWm32lWtkFFHsfpLy2qaVN72j+IeErJj 4oGURD8fgFs9BROPuScVPepOWkl3N8O/M9ljOWhxiaL9dD25ACDrzNhkcMyQrdBo knTJGSOyrKdN/VfSmsI8TZz/g1fgMAodKL410eW+Y1xml0QJmJ7kw4elMzkR5Ugz OQv4Lu4yt7HMHs+o4pLh7p/yVeoXeD9wdtPA4+1DRct+Ex0QGeWnFwQAG1OYwKh4 CPdH8YFjYVejR3UBbfd3zPzlNd0PtTzRpHMZkaE5Hqr3de48JY1Sw== Original-Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 60599576; Mon, 1 Feb 2021 19:12:45 +0100 (CET) Original-Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 53af86b2; Mon, 1 Feb 2021 19:12:45 +0100 (CET) Original-Received: by dismail.de (OpenSMTPD) with ESMTPSA id da8fd0bd (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 1 Feb 2021 19:12:45 +0100 (CET) Received-SPF: pass client-ip=78.46.223.134; envelope-from=jbranso@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+gcggb-bug-guix=m.gmane-mx.org@gnu.org Original-Sender: "bug-Guix" Xref: news.gmane.io gmane.comp.gnu.guix.bugs:23263 gmane.lisp.guile.bugs:9975 Archived-At: Hello! Recently on irc, I posted an example of an incorrectly used define-record-type* NOT displaying an error line number. mdevos mentioned that this could potentially be fixed in (guix records), but it may also be a guile compile bug as well. First here is a (guix records) example: #+BEGIN_SRC scheme (use-modules (guix records)) (define-record-type* sway-bindsym make-sway-bindsym sway-bindsym? (key-combo sway-bindsym-key-combo (default ""))) (display sway-bindsym) ;; compile error at unknown location ;; (display (sway-bindsym)) this is one "correct" way to call this code #+END_SRC One will get a compile error like the following #+BEING_SRC sh ;;; note: source file /home/joshua/prog/guile/test.scm ;;; newer than compiled /home/joshua/.cache/guile/ccache/3.0-LE-8-4.4/home/joshua/prog/guile/test.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/joshua/prog/guile/test.scm ;;; WARNING: compilation of /home/joshua/prog/guile/test.scm failed: ;;; Syntax error: ;;; unknown location: source expression failed to match any pattern in form sway-bindsym ice-9/psyntax.scm:2800:12: In procedure syntax-violation: Syntax error: unknown location: source expression failed to match any pattern in form sway-bindsym #+END_SRC As you can see, you do NOT see a error-line-number. If this file was sufficiently large, this might be hard to track down. Though it IS NICE to see that the error comes from an "sway-bindsym". mdevos then mentioned that I should provide a simple use case NOT involving (guix records). Here is one: #+BEGIN_SRC scheme (define-syntax when (syntax-rules () ((when condititon exp ...) (if condititon (begin exp ...))))) (when #t (display "Hello\n")) (display when) #+END_SRC The error message looks like: #+BEGIN_SRC sh ;;; note: source file /home/joshua/prog/guile/macro-bug.scm ;;; newer than compiled /home/joshua/.cache/guile/ccache/3.0-LE-8-4.4/home/joshua/prog/guile/macro-bug.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/joshua/prog/guile/macro-bug.scm ;;; WARNING: compilation of /home/joshua/prog/guile/macro-bug.scm failed: ;;; Syntax error: ;;; unknown location: source expression failed to match any pattern in form when Hello ice-9/psyntax.scm:2800:12: In procedure syntax-violation: Syntax error: unknown location: source expression failed to match any pattern in form when #+END_SRC Again, I do not see an error-line-number message. Thanks, Joshua P.S. I am no scheme compiler expert. As far as I know, maybe it's impossible to display the error-line-number, when you use macros. I just heard that few free software users report bugs. I'm just trying to be helpful. :) I hope I am.