progfolio / elpaca

An elisp package manager
GNU General Public License v3.0
634 stars 31 forks source link

[Bug]: "(void-function \(setf\ funcall\))" with Emacs 30 #150

Closed ashton314 closed 1 year ago

ashton314 commented 1 year ago

Elpaca Version

Elpaca 2e65018 HEAD -> master, origin/master, origin/HEAD
installer:      0.5
emacs-version:  GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin22.5.0, NS appkit-2299.60 Version 13.4.1 (Build 22F82))
 of 2023-06-26
git --version:  git version 2.39.2
You can run the command ‘elpaca-version’ with M-x el-ve
Elpaca 2e65018 HEAD -> master, origin/master, origin/HEAD
installer:      0.5
emacs-version:  GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin22.5.0, NS appkit-2299.60 Version 13.4.1 (Build 22F82))
 of 2023-06-26
git --version:  git version 2.39.2

Operating System

macOS 13.4.1

Description

Output from running with --debug-init flag

Debugger entered--Lisp error: (void-function \(setf\ funcall\))
  (\(setf\ funcall\) (cons (setq p (cons item-4 '((vertico-mode)))) (funcall v v)) v v)
  (if p (setcdr p '((vertico-mode))) (\(setf\ funcall\) (cons (setq p (cons item-4 '((vertico-mode)))) (funcall v v)) v v))
  (progn (if p (setcdr p '((vertico-mode))) (\(setf\ funcall\) (cons (setq p (cons item-4 '(...))) (funcall v v)) v v)) '((vertico-mode)))
  (let* ((v #'(lambda (cl-x) (progn (progn (nth 7 cl-x))))) (v q-5) (p (assq item-4 (funcall v v)))) (progn (if p (setcdr p '((vertico-mode))) (\(setf\ funcall\) (cons (setq p (cons item-4 '...)) (funcall v v)) v v)) '((vertico-mode))))
  (if item-4 (let* ((v #'(lambda (cl-x) (progn (progn ...)))) (v q-5) (p (assq item-4 (funcall v v)))) (progn (if p (setcdr p '((vertico-mode))) (\(setf\ funcall\) (cons (setq p (cons item-4 ...)) (funcall v v)) v v)) '((vertico-mode)))) (let* ((x (cons item-4 '((vertico-mode)))) (v #'(lambda (cl-x) (progn (progn ...)))) (v q-5)) (\(setf\ funcall\) (cons x (funcall v v)) v v)))
  (let* ((order-3 'vertico) (item-4 (elpaca--first order-3)) (q-5 (or (and after-init-time (elpaca--q (elpaca-get item-4))) (car elpaca--queues)))) (if item-4 (let* ((v #'(lambda (cl-x) (progn ...))) (v q-5) (p (assq item-4 (funcall v v)))) (progn (if p (setcdr p '(...)) (\(setf\ funcall\) (cons (setq p ...) (funcall v v)) v v)) '((vertico-mode)))) (let* ((x (cons item-4 '(...))) (v #'(lambda (cl-x) (progn ...))) (v q-5)) (\(setf\ funcall\) (cons x (funcall v v)) v v))) (if order-3 (progn (elpaca--queue order-3 q-5))) (if after-init-time (progn (let* ((e (and t (elpaca-get item-4)))) (if e (progn (elpaca--maybe-log t) (elpaca--unprocess e) (let* (... ...) (\(setf\ funcall\) ... v v))) nil)) (if (member this-command '(eval-last-sexp eval-defun)) (progn (elpaca-process-queues))) (if (member this-command '(eval-region eval-buffer org-ctrl-c-ctrl-c)) (progn (if elpaca--interactive-timer (progn (cancel-timer elpaca--interactive-timer))) (run-at-time elpaca-interactive-interval nil #'elpaca-process-queues))))) nil)
  load-with-code-conversion("/Users/ashton/Sync/repos/build-emacs-for-macos/bui..." "/Users/ashton/Sync/repos/build-emacs-for-macos/bui..." t t)
  load("/Users/ashton/Sync/repos/build-emacs-for-macos/bui..." noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode -0x1429890d970be58f>) #f(compiled-function () #<bytecode 0x1cb3c78112d30589>) t)
  command-line()
  normal-top-level()

Files

early-init.el

(setq package-enable-at-startup nil)

init.el

(defvar elpaca-installer-version 0.5)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
                              :ref nil
                              :files (:defaults (:exclude "extensions"))
                              :build (:not elpaca--activate-package)))
(let* ((repo  (expand-file-name "elpaca/" elpaca-repos-directory))
       (build (expand-file-name "elpaca/" elpaca-builds-directory))
       (order (cdr elpaca-order))
       (default-directory repo))
  (add-to-list 'load-path (if (file-exists-p build) build repo))
  (unless (file-exists-p repo)
    (make-directory repo t)
    (when (< emacs-major-version 28) (require 'subr-x))
    (condition-case-unless-debug err
        (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
                 ((zerop (call-process "git" nil buffer t "clone"
                                       (plist-get order :repo) repo)))
                 ((zerop (call-process "git" nil buffer t "checkout"
                                       (or (plist-get order :ref) "--"))))
                 (emacs (concat invocation-directory invocation-name))
                 ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
                                       "--eval" "(byte-recompile-directory \".\" 0 'force)")))
                 ((require 'elpaca))
                 ((elpaca-generate-autoloads "elpaca" repo)))
            (progn (message "%s" (buffer-string)) (kill-buffer buffer))
          (error "%s" (with-current-buffer buffer (buffer-string))))
      ((error) (warn "%s" err) (delete-directory repo 'recursive))))
  (unless (require 'elpaca-autoloads nil t)
    (require 'elpaca)
    (elpaca-generate-autoloads "elpaca" repo)
    (load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))

;;; ---------------------------- Elpaca auxiliary setup -----------------------------------

;; Block until current queue processed.
(elpaca-wait)

(elpaca vertico
  (vertico-mode))
ashton314 commented 1 year ago

Just seeing this on a fresh install of Emacs 30. If I don't use elpaca in the init file, it will still load up, and I can install packages one-off with elpaca-try just fine.

progfolio commented 1 year ago

Just seeing this on a fresh install of Emacs 30. If I don't use elpaca in the init file, it will still load up, and I can install packages one-off with elpaca-try just fine.

Interesting. That suggests there's something off with the expansion. Can you try evaluating the following test case in your *scratch* buffer? It should install everything in a clean, temporary environment. When it's finished, a result buffer should pop-up when Emacs is idle.

Test Case ```emacs-lisp (elpaca-test :dir "elpaca.vertico" :early-init (setq package-enable-at-startup nil) :init (elpaca vertico (vertico-mode) (message "PASS")) (elpaca-wait)) ```
Host Env
elpaca2e65018 HEAD -> master, origin/master, origin/HEAD
isntaller0.5
emacsGNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-06-21
gitgit version 2.41.0
Output ```emacs-lisp INFO Scraping files for loaddefs... INFO Scraping files for loaddefs...done GEN ../elpaca-autoloads.el Cloning into '/tmp/elpaca.vertico/elpaca/repos/elpaca'... Your branch is up to date with 'origin/master'. Checking /tmp/elpaca.vertico/elpaca/repos/elpaca... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-info.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-log.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-manager.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-menu-gnu-elpa-mirror.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-menu-melpa.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-menu-non-gnu-elpa.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-menu-org.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-process.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-test.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca-ui.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/elpaca.el... Checking /tmp/elpaca.vertico/elpaca/repos/elpaca/doc... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/doc/early-init.el... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/doc/init.el... Checking /tmp/elpaca.vertico/elpaca/repos/elpaca/extensions... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/extensions/elpaca-use-package.el... Checking /tmp/elpaca.vertico/elpaca/repos/elpaca/images... Checking /tmp/elpaca.vertico/elpaca/repos/elpaca/test... Compiling /tmp/elpaca.vertico/elpaca/repos/elpaca/test/elpaca-test.el... Done (Total of 12 files compiled, 3 skipped in 4 directories) Downloading MELPA recipes... Downloading MELPA recipes...100% Downloading GNU ELPA recipes... Downloading GNU ELPA recipes...100% Downloading NonGNU ELPA recipes... Downloading NonGNU ELPA recipes...100% PASS Test Env Elpaca 2e65018 HEAD -> master, origin/master, origin/HEAD installer: 0.5 emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-06-21 git --version: git version 2.41.0 ```
progfolio commented 1 year ago

Updated today and haven't been able to reproduce on:

GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-06-28

progfolio commented 1 year ago

Recent upstream activity which looks relevant:

https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00785.html

which links to the following upstream bug reports:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64315 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64292

The timeline would explain why your version expanded incorrectly and both the versions I tried did not. Upgrading Emacs may fix the issue.

ashton314 commented 1 year ago

Will try when I get the chance

ashton314 commented 1 year ago

Just tried on master; looks like it's fixed!

Still blows my mind that Elpaca can install 120 packages (168 counting dependencies) in under a minute. Incredible work on this, Nicholas. Thank you 🙏🏼

progfolio commented 1 year ago

Just tried on master; looks like it's fixed! Still blows my mind that Elpaca can install 120 packages (168 counting dependencies) in under a minute. Incredible work on this, Nicholas. Thank you 🙏🏼

As always, this is great to hear. Thanks again.