From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function Date: Fri, 4 Aug 2023 13:22:58 +0000 Message-ID: References: <8B08E514-B2D5-48F5-BA90-4F5A9492F8F9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14560"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 65017@debbugs.gnu.org, Eric Marsden To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 04 15:24:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qRumq-0003dB-60 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Aug 2023 15:24:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRumi-0001Ru-Qt; Fri, 04 Aug 2023 09:24:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRumg-0001QK-Pw for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 09:24:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRumg-0005nV-A1 for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 09:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRumf-00074b-O8 for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 09:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Aug 2023 13:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65017 X-GNU-PR-Package: emacs Original-Received: via spool by 65017-submit@debbugs.gnu.org id=B65017.169115538827115 (code B ref 65017); Fri, 04 Aug 2023 13:24:01 +0000 Original-Received: (at 65017) by debbugs.gnu.org; 4 Aug 2023 13:23:08 +0000 Original-Received: from localhost ([127.0.0.1]:53585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRuln-00073F-Kr for submit@debbugs.gnu.org; Fri, 04 Aug 2023 09:23:07 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:53999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRull-00072S-KA for 65017@debbugs.gnu.org; Fri, 04 Aug 2023 09:23:06 -0400 Original-Received: (qmail 62345 invoked by uid 3782); 4 Aug 2023 15:22:59 +0200 Original-Received: from acm.muc.de (pd953a874.dip0.t-ipconnect.de [217.83.168.116]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 04 Aug 2023 15:22:58 +0200 Original-Received: (qmail 794 invoked by uid 1000); 4 Aug 2023 13:22:58 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266669 Archived-At: Hello, Stefan, Mattias, and Eric. On Thu, Aug 03, 2023 at 10:43:16 -0400, Stefan Monnier wrote: [ .... ] > AFAICT the problem is that OT1H `symbols-with-pos-enabled` is > non-nil while loading the second file, but OTOH positions aren't > stripped from the resulting code. > So in `cl--labels-convert` when we check > (eq f (car cl--labels-convert-cache)) [ .... ] > I don't know why `symbols-with-pos-enabled` is non-nil at that point (I > thought we only enabled it wile byte-compiling), .... This is not quite the case. symbols-with-pos-enabled gets erroneously bound to t in internal-macroexpand-for-load (emacs-lisp/macroexp.el). This is the cause of the bug; in cl--labels-convert it causes the first eq to return non-nil when comparing 'equal to #. Removing that binding fixes the problem. This does not affect make bootstrap or make check. The necessary patch is: diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index b05aba3e1a7..ea838f5b7b2 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -799,8 +799,7 @@ macroexp--debug-eager (defun internal-macroexpand-for-load (form full-p) ;; Called from the eager-macroexpansion in readevalloop. - (let ((symbols-with-pos-enabled t) - (print-symbols-bare t)) + (let ((print-symbols-bare t)) (cond ;; Don't repeat the same warning for every top-level element. ((eq 'skip (car macroexp--pending-eager-loads)) form) Stefan, it would still be nice for cl--labels-convert-cache to get initialised each time it gets used. Please try out the patch, and if all is well I can commit it and close the bug. [ .... ] > Stefan -- Alan Mackenzie (Nuremberg, Germany).