GNU bug report logs - #68945
30.0.50; loaddefs-generate--parse-file: Wrong type argument: symbolp, 63

Previous Next

Package: emacs;

Reported by: Brent Westbrook <bwestbr2 <at> go.olemiss.edu>

Date: Tue, 6 Feb 2024 03:33:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68945 in the body.
You can then email your comments to 68945 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#68945; Package emacs. (Tue, 06 Feb 2024 03:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brent Westbrook <bwestbr2 <at> go.olemiss.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Feb 2024 03:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brent Westbrook <bwestbr2 <at> go.olemiss.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; loaddefs-generate--parse-file: Wrong type argument:
 symbolp, 63
Date: Mon, 05 Feb 2024 12:28:41 -0500
Attempting to install the projectile package from melpa leads to the
following (abbreviated) Backtrace:

Debugger entered--Lisp error: (wrong-type-argument symbolp 63)
  loaddefs-generate--compute-prefixes("projectile")
  loaddefs-generate--parse-file("/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile.el" "/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile-autoloads.el" nil)
  loaddefs-generate("/home/brent/.emacs.d/elpa/projectile-20240205.1021" "/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile-autoloads.el" nil "(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))")
  package-generate-autoloads(projectile "/home/brent/.emacs.d/elpa/projectile-20240205.1021")
  package--make-autoloads-and-stuff(#s(package-desc :name projectile :version (20240205 1021) :summary "Manage and navigate projects in Emacs easily" :reqs ((emacs (25 1))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "e45f0b0cc43fdc066e7971ff3ed3bf4c78015ed0") (:authors ("Bozhidar Batsov" . "bozhidar <at> batsov.dev")) (:maintainers ("Bozhidar Batsov" . "bozhidar <at> batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar <at> batsov.dev") (:keywords "project" "convenience") (:url . "https://github.com/bbatsov/projectile")) :signed nil) "/home/brent/.emacs.d/elpa/projectile-20240205.1021")

I can replicate this with emacs -Q:

(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-install 'projectile)

However, I think the real issue is with loading the package, not the
installation. I originally hit this when trying to load the package with
use-package, but then hit this version when trying to uninstall and
reinstall. use-package reports this instead:

use-package-autoload-keymap: use-package: Cannot load package.el: projectile

when I try to switch projects with my projectile-command-map.

I noticed a couple of recent changes when grepping the git log for
loaddefs (Feb 3), so I'm going to try to revert to a version prior to
that to see if that helps.

Let me know if you need any more info,
Brent Westbrook

Build info:

In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, cairo version
 1.18.0) of 2024-02-05 built on keystone
Repository revision: 95c8bfb11ec82e67652e5903495c1fcb5c61ace2
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Arch Linux

Configured using:
 'configure --with-native-compilation --with-json --with-x-toolkit=no
 --with-tree-sitter'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68945; Package emacs. (Tue, 06 Feb 2024 18:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 68945 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Brent Westbrook <bwestbr2 <at> go.olemiss.edu>
Cc: , 68945 <at> debbugs.gnu.org
Subject: Re: bug#68945: 30.0.50; loaddefs-generate--parse-file: Wrong type
 argument: symbolp, 63
Date: Tue, 06 Feb 2024 18:42:50 +0000
[Message part 1 (text/plain, inline)]
Brent Westbrook <bwestbr2 <at> go.olemiss.edu> writes:

> Attempting to install the projectile package from melpa leads to the
> following (abbreviated) Backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument symbolp 63)

This appears to be related to commit that João made last November:

--8<---------------cut here---------------start------------->8---
commit 817140a852e79c5ef3cf7dc5e4c50aa710e8c4a2
Author: João Távora <joaotavora <at> gmail.com>
Date:   Thu Nov 30 07:32:50 2023 -0600

    Fix prefix discovery for files with read-symbol-shorthands (bug#67325)
    
    In a previous commit, the local-variable read-symbol-shorthands is
    already read into the temporary buffer used for the autoload parsing
    aerobatics, so all we needed to do in 'l-g--compute-prefixes' is
    use 'read' to give 'read-symbol-shorthands' a chance to kick in.
    
    * lisp/emacs-lisp/loaddefs-gen.el
    (loaddefs-generate--compute-prefixes):

diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index bf5cd24f161..8aacbf406b6 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -499,7 +499,11 @@ loaddefs-generate--compute-prefixes
     (while (re-search-forward
             "^(\\(def[^ \t\n]+\\)[ \t\n]+['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t)
       (unless (member (match-string 1) autoload-ignored-definitions)
-        (let ((name (match-string-no-properties 2)))
+        (let* ((name (match-string-no-properties 2))
+               ;; Consider `read-symbol-shorthands'.
+               (probe (let ((obarray (obarray-make)))
+                        (car (read-from-string name)))))
+          (setq name (symbol-name probe))
           (when (save-excursion
                   (goto-char (match-beginning 0))
                   (or (bobp)
--8<---------------cut here---------------end--------------->8---

and the fact that Projectile has this line

--8<---------------cut here---------------start------------->8---
(def-projectile-commander-method ?? "Commander help buffer."
--8<---------------cut here---------------end--------------->8---

where the `name' variable above gets bound to the string "??", that when
passed through `read-from-string' eventually gives us the character ??
(ASCII 63), which one cannot pass to `symbol-name'.  So it might be that

[Message part 2 (text/plain, inline)]
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 7eced43e735..0f82239da63 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -506,14 +506,15 @@ loaddefs-generate--compute-prefixes
                ;; Consider `read-symbol-shorthands'.
                (probe (let ((obarray (obarray-make)))
                         (car (read-from-string name)))))
-          (setq name (symbol-name probe))
-          (when (save-excursion
-                  (goto-char (match-beginning 0))
-                  (or (bobp)
-                      (progn
-                        (forward-line -1)
-                        (not (looking-at ";;;###autoload")))))
-            (push name prefs)))))
+          (when (symbolp probe)
+            (setq name (symbol-name probe))
+            (when (save-excursion
+                    (goto-char (match-beginning 0))
+                    (or (bobp)
+                        (progn
+                          (forward-line -1)
+                          (not (looking-at ";;;###autoload")))))
+              (push name prefs))))))
     (loaddefs-generate--make-prefixes prefs load-name)))
 
 (defun loaddefs-generate--rubric (file &optional type feature compile)
[Message part 3 (text/plain, inline)]
could fix the issue, but I am not too familiar with the code.  I've
CC'ed João to see if he has anything to add.

>   loaddefs-generate--compute-prefixes("projectile")
>   loaddefs-generate--parse-file("/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile.el" "/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile-autoloads.el" nil)
>   loaddefs-generate("/home/brent/.emacs.d/elpa/projectile-20240205.1021" "/home/brent/.emacs.d/elpa/projectile-20240205.1021/projectile-autoloads.el" nil "(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))")
>   package-generate-autoloads(projectile "/home/brent/.emacs.d/elpa/projectile-20240205.1021")
>   package--make-autoloads-and-stuff(#s(package-desc :name projectile :version (20240205 1021) :summary "Manage and navigate projects in Emacs easily" :reqs ((emacs (25 1))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "e45f0b0cc43fdc066e7971ff3ed3bf4c78015ed0") (:authors ("Bozhidar Batsov" . "bozhidar <at> batsov.dev")) (:maintainers ("Bozhidar Batsov" . "bozhidar <at> batsov.dev")) (:maintainer "Bozhidar Batsov" . "bozhidar <at> batsov.dev") (:keywords "project" "convenience") (:url . "https://github.com/bbatsov/projectile")) :signed nil) "/home/brent/.emacs.d/elpa/projectile-20240205.1021")
>
> I can replicate this with emacs -Q:
>
> (require 'package)
> (package-initialize)
> (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
> (package-install 'projectile)
>
> However, I think the real issue is with loading the package, not the
> installation. I originally hit this when trying to load the package with
> use-package, but then hit this version when trying to uninstall and
> reinstall. use-package reports this instead:
>
> use-package-autoload-keymap: use-package: Cannot load package.el: projectile
>
> when I try to switch projects with my projectile-command-map.
>
> I noticed a couple of recent changes when grepping the git log for
> loaddefs (Feb 3), so I'm going to try to revert to a version prior to
> that to see if that helps.
>
> Let me know if you need any more info,
> Brent Westbrook
>
> Build info:
>
> In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, cairo version
>  1.18.0) of 2024-02-05 built on keystone
> Repository revision: 95c8bfb11ec82e67652e5903495c1fcb5c61ace2
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
> System Description: Arch Linux
>
> Configured using:
>  'configure --with-native-compilation --with-json --with-x-toolkit=no
>  --with-tree-sitter'
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
> JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
> INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
> TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB
>
> Important settings:
>   value of $LANG: C.UTF-8
>   locale-coding-system: utf-8-unix

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Tue, 06 Feb 2024 20:39:02 GMT) Full text and rfc822 format available.

Notification sent to Brent Westbrook <bwestbr2 <at> go.olemiss.edu>:
bug acknowledged by developer. (Tue, 06 Feb 2024 20:39:02 GMT) Full text and rfc822 format available.

Message #13 received at 68945-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Arash Esbati <arash <at> gnu.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 68945-done <at> debbugs.gnu.org
Subject: Re: master a2201a2034a: (loaddefs-generate--parse-file): Be a bit
 more defensive
Date: Tue, 06 Feb 2024 15:38:18 -0500
> I have no clue about the code, but shouldn't this read:
>
> +          (when (symbolp name)
>                           ^^^^ -> probe
>
> ?

Indeed, thanks,

  I think this is also suggested by Philip K. in this message[1].
> [1]  https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-02/msg00249.html

Oh, indeed, there was a bug open for this one.  I think we can close it now.


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Mar 2024 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.