progfolio / elpaca

An elisp package manager
GNU General Public License v3.0
621 stars 30 forks source link

Bootstrapping fails at call to `autoload-rubric` #4

Closed ashton314 closed 2 years ago

ashton314 commented 2 years ago

What's wrong

I'm trying to run the example script provided in the README, and I get the following error:

Debugger entered--Lisp error: (wrong-number-of-arguments autoload-rubric 4)
  (autoload-rubric output nil 'feature 'compile)
  (write-region (autoload-rubric output nil 'feature 'compile) nil output nil 'silent)
  (let* ((default-directory dir) (auto-name (format "%s-autoloads.el" package)) (output (expand-file-name auto-name dir)) (generated-autoload-file output) (autoload-timestamps nil) (backup-inhibited t) (version-control 'never) (find-file-hook nil) (write-file-functions nil) (left-margin 0)) (write-region (autoload-rubric output nil 'feature 'compile) nil output nil 'silent) (cond ((fboundp 'loaddefs-generate) (loaddefs-generate dir auto-name nil nil nil t)) ((fboundp 'make-directory-autoloads) (make-directory-autoloads dir output)) ((fboundp 'update-directory-autoloads) (with-no-warnings (update-directory-autoloads dir)))) (let* ((buf (and t (find-buffer-visiting output)))) (if buf (kill-buffer buf) nil)) auto-name)
  elpaca-generate-autoloads("elpaca" "/Users/ashton/.emacs.d/elpaca/repos/elpaca/")
  (progn (if (= 0 (call-process "git" nil buffer t "clone" elpaca-url elpaca-repo)) nil (error "%s" (list (save-current-buffer (set-buffer buffer) (buffer-string))))) (byte-recompile-directory elpaca-repo 0 'force) (require 'elpaca) (elpaca-generate-autoloads "elpaca" elpaca-repo) (kill-buffer buffer))
  (condition-case err (progn (if (= 0 (call-process "git" nil buffer t "clone" elpaca-url elpaca-repo)) nil (error "%s" (list (save-current-buffer (set-buffer buffer) (buffer-string))))) (byte-recompile-directory elpaca-repo 0 'force) (require 'elpaca) (elpaca-generate-autoloads "elpaca" elpaca-repo) (kill-buffer buffer)) ((debug error) (delete-directory elpaca-directory 'recursive) (save-current-buffer (set-buffer buffer) (goto-char (point-max)) (insert (format "\n%S" err)) (display-buffer buffer))))
  (if buffer (condition-case err (progn (if (= 0 (call-process "git" nil buffer t "clone" elpaca-url elpaca-repo)) nil (error "%s" (list (save-current-buffer (set-buffer buffer) (buffer-string))))) (byte-recompile-directory elpaca-repo 0 'force) (require 'elpaca) (elpaca-generate-autoloads "elpaca" elpaca-repo) (kill-buffer buffer)) ((debug error) (delete-directory elpaca-directory 'recursive) (save-current-buffer (set-buffer buffer) (goto-char (point-max)) (insert (format "\n%S" err)) (display-buffer buffer)))) nil)
  (let* ((elpaca-repo (and t (expand-file-name "repos/elpaca/" elpaca-directory))) (elpaca-build (and elpaca-repo (expand-file-name "builds/elpaca/" elpaca-directory))) (elpaca-target (and elpaca-build (if (file-exists-p elpaca-build) elpaca-build elpaca-repo))) (elpaca-url (and elpaca-target "https://www.github.com/progfolio/elpaca.git")) (s (and elpaca-url (add-to-list 'load-path elpaca-target))) (s (and s (not (file-exists-p elpaca-repo)))) (buffer (and s (get-buffer-create "*elpaca-bootstrap*")))) (if buffer (condition-case err (progn (if (= 0 (call-process "git" nil buffer t "clone" elpaca-url elpaca-repo)) nil (error "%s" (list (save-current-buffer ... ...)))) (byte-recompile-directory elpaca-repo 0 'force) (require 'elpaca) (elpaca-generate-autoloads "elpaca" elpaca-repo) (kill-buffer buffer)) ((debug error) (delete-directory elpaca-directory 'recursive) (save-current-buffer (set-buffer buffer) (goto-char (point-max)) (insert (format "\n%S" err)) (display-buffer buffer)))) nil))
  load-with-code-conversion("/Users/ashton/.emacs.d/init.el" "/Users/ashton/.emacs.d/init.el" t t)
  load("/Users/ashton/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1550e63276dba1>) #f(compiled-function () #<bytecode -0x1f3c6feddc0eaeb5>) t)
  command-line()
  normal-top-level()

Directions to reproduce

Copy the example bootstrap config into a clean ~/.emacs.d/init.el. Try opening Emacs.

Looks like a commit 33dcd3360ddcc7aacab8bb6fe8986365a2aa9f66 added an extra argument to autoload-rubric.

Version information

progfolio commented 2 years ago

I'm headed into work now, but I will take a look at this when I get out. Oddly enough, describe-function reports the following signature for autoload-rubric:

autoload-rubric is an alias for ‘loaddefs-generate--rubric’ in ‘autoload.el’.

(autoload-rubric FILE &optional TYPE FEATURE COMPILE)

Which looks like it should accept up to 4 arguments. Perhaps it's the nil second arg that's gumming things up. There have been some recent changes to autoload (see how it's now an alias for the new loaddefs-generate--rubric). I'll get back to you on this soon. Thanks for the report.

ashton314 commented 2 years ago

Huh. I wonder if the three-argument version is new in Emacs 29. I'll do a little digging and report back here if I find something.

bdarcus commented 2 years ago

Huh. I wonder if the three-argument version is new in Emacs 29.

Yes, it appears so:

autoload-rubric is an alias for ‘loaddefs-generate--rubric’ in ‘autoload.el’.

(autoload-rubric FILE &optional TYPE FEATURE)
ghost commented 2 years ago

I am also seeing the same issue here after running emacs --debug-init. you can see #3 for it.

progfolio commented 2 years ago

Looks like the 4 parameter signature was short lived. I happened to be running Emacs 29 built off the version which had it. I've removed the fourth arg. Should be able to get past this now. Testing appreciated.

bdarcus commented 2 years ago

Works on my end.