progfolio / elpaca

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

[Support]: How to enforce the use of the (m)elpa package over the builtin #315

Closed seblemaguer closed 4 months ago

seblemaguer commented 4 months ago

Confirmation

Elpaca Version

Elpaca 43ec2d8 HEAD -> master, origin/master, origin/HEAD installer: 0.7

Operating System

linux (kubuntu 22.04.4), GNU Emacs 29.3.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-04-15

Description

Hello,

and apologies for what is likely going to be a stupid question, but after installing jsonrpc using the following command:

(use-package jsonrpc
   :ensure (:tag "1.0.25"))

it seems I am still using the builtin version.

To test this, I simply run apropos and pick up the function jsonrpc-error. The file pointed out in the help part still refers to builtin file (emacs/share/emacs/29.3.50/lisp/jsonrpc.el.gz).

Is there a way to enforce the use of the elpa version?

Thanks a lot

progfolio commented 4 months ago

Please share the output of M-x elpaca-info jsonrpc and the configuration you are using. Are there any warnings in the *Warnings* buffer when you start Emacs?

seblemaguer commented 4 months ago

Ah yes, I forgot the warning:

Warning (emacs): jsonrpc loaded before Elpaca activation

and for the info

jsonrpc [GNU-devel ELPA|GNU ELPA]
JSON-RPC library

source: GNU ELPA
url: https://elpa.gnu.org/packages/jsonrpc.html
menu item recipe:
( :package "jsonrpc"
  :repo "https://github.com/emacs-mirror/emacs"
  :local-repo "jsonrpc"
  :branch "master"
  :files ("lisp/jsonrpc.el" (:exclude
                             ".git")))
full recipe:
( :package "jsonrpc"
  ;; Inherited from declaration.
  :tag "1.0.25"
  ;; Inherited from elpaca-order-functions.
  :depth 1
  :inherit t
  :protocol https
  ;; Inherited from elpaca-menu-item.
  :files ("lisp/jsonrpc.el" (:exclude
                             ".git"))
  :branch "master"
  :local-repo "jsonrpc"
  :repo "https://github.com/emacs-mirror/emacs")
dependencies: 
  emacs >= 25.2
dependents: 
  dape
  eglot-booster
installed version: 1.0.25 d3bdf11
statuses:
  (finished activation info unblocked continued-dep queued)
files:
  $REPOS/jsonrpc/lisp/jsonrpc.el → $BUILDS/jsonrpc/jsonrpc.el
log:
  [2024-06-04 13:59:02] Package queued
  [2024-06-04 13:59:02] Continued by: elpaca--continue-dependency
  [2024-06-04 13:59:02] Continued by: elpaca--queue-dependencies
  [2024-06-04 13:59:02] No external dependencies
  [2024-06-04 13:59:02] No Info dir file found
  [2024-06-04 13:59:02] Continued by: elpaca--add-info-path
  [2024-06-04 13:59:02] Activating package
  [2024-06-04 13:59:02] Package build dir added to load-path
  [2024-06-04 13:59:02] Caching autoloads
  [2024-06-04 13:59:02] Autoloads cached
  [2024-06-04 13:59:02] Continued by: elpaca--activate-package
  [2024-06-04 13:59:02] ✓ 0.125 secs
progfolio commented 4 months ago

Warning (emacs): jsonrpc loaded before Elpaca activation

There is your issue. You need to ensure jsonrpc is not loaded prior to Elpaca activating/loading it. Please see: https://github.com/progfolio/elpaca/wiki/Warnings-and-Errors#feature-loaded-early

My guess is that you're eagerly loading one of the dependents listed by elpaca-info:

 dependents: 
  dape
  eglot-booster

Eglot perhaps.

If you're unsure, you can add the following to the beginning of your init file:

(with-eval-after-load "jsronrpc" (debug))

The resultant *backtrace* buffer should show who is requiring jsonrpc.

Does that help?

seblemaguer commented 4 months ago

yes, it did thanks a lot (I wrote ":demand t" instead of ":defer t" :facepalm: for dape).

progfolio commented 4 months ago

yes, it did thanks a lot (I wrote ":demand t" instead of ":defer t" 🤦 for dape).

Thanks for getting back to me. Glad it worked out!