progfolio / elpaca

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

[Support]: use-package installed version (0 2) lower than minimum required version #335

Closed emacsbliss closed 2 months ago

emacsbliss commented 2 months ago

Confirmation

Elpaca Version

Elpaca ec0e543 HEAD -> master, origin/master, origin/HEAD installer: 0.7 emacs-version: GNU Emacs 29.1.90 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2 (Build 23C64)) of 2023-12-16 git --version: git version 2.39.1

Operating System

MacOS 14.3.1 (23D60)

Description

I have below in my early-init.el:

(setq package-enable-at-startup nil
      package-quickstart nil)

then in my init.el, I copy the example config (copied) from manual:

(defvar elpaca-installer-version 0.7)
(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 elpaca-use-package
  ;; Enable Elpaca support for use-package's :ensure keyword.
  (elpaca-use-package-mode))

when I run Emacs, I got error (see screenshot)

Screenshot 2024-07-24 at 10 48 56 PM
progfolio commented 2 months ago

Thanks for taking the time to fill out a bug report.

emacs-version: GNU Emacs 29.1.90 (build 1, aarch64-apple-darwin23.2.0, NS

You are using an unstable version of Emacs which suffers from the bug I reported at the beginning of this year here:

https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-01/msg00331.html

Upgrading to a later stable version of Emacs (e.g. 29.4) will fix it.

Does that help?

emacsbliss commented 2 months ago

Great, thanks very much for the help!

I upgraded to Emacs 29.4 and problem goes away!

However if you don't mind, I encountered another issue. I want to use elpaca and write something like this (borrowed from https://github.com/seagle0128/.emacs.d/blob/master/lisp/init-ui.el#L118C1-L127C43 )

(use-package doom-modeline
  :hook (after-init . doom-modeline-mode)
  :init
  (setq doom-modeline-icon centaur-icon
        doom-modeline-minor-modes t)
  :bind (:map doom-modeline-mode-map
         ("C-<f6>" . doom-modeline-hydra/body))
  :pretty-hydra
  ((:title (pretty-hydra-title "Mode Line" 'sucicon "nf-custom-emacs" :face 'nerd-icons-purple)
    :color amaranth :quit-key ("q" "C-g"))

but I got error:

⛔ Error (use-package): Failed to parse package doom-modeline: use-package: Unrecognized keyword: :pretty-hydra

I tried to (require 'pretty-hydra) but it says can't find it even though I can see elpaca already cloned and build it and load-path has its directory in it.

progfolio commented 2 months ago

Glad it worked. Please keep each issue to one topic. It makes it easier to search for later. I've opened a separate issue for your other warning.