progfolio / elpaca

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

[Support]: emacsql-sqlite dependency issue #85

Closed bdarcus closed 1 year ago

bdarcus commented 1 year ago

Elpaca Version

Using version 0.3

Operating System

Fedora Linux.

Description

Follow-up from Discord.

I still don't know where the problem is, and so whether this is an elpaca bug, and apologies if this is not elpaca-related.

But I keep getting this error when trying to load org-roam:

Error (use-package): citar/:config: Cannot open load file: No such file or directory, emacsql-sqlite

Here's the config I'm using, and the key packages at play are:

I was trying to sort out a load order problem among them, and think in doing so, ran into this problem.

But since I'm not directly installing or configuring emacsql, am wondering if it's something or other with elpaca?

progfolio commented 1 year ago

Please include the output of M-x elpaca-version and the use-package declarations for the packages.

bdarcus commented 1 year ago

How do I capture that output, so I can paste it?

progfolio commented 1 year ago

You should be able to copy it from the *Messages* buffer after executing the command.

progfolio commented 1 year ago

I've cloned the full configuration you've linked into a temporary environment and everything installed cleanly. Is there something else that needs to be done to trigger the error you're seeing? It's also difficult for me to reproduce anything on my end because the set up assumes local files exist, which I do not have (e.g. ~/org/*.bib).

Error (use-package): citar/:config: Cannot open load file: No such file or directory, emacsql-sqlite

That error message indicates that something is trying to load emacsql-sqlite during the :config stanza of the citar's use-package declaration. I haven't seen anything to indicate this is a bug with Elpaca yet. My advice would be to start simpler. Use a single file for the init and add each use-package declaration one at a time. That will help narrow down when the problem occurs. The elpaca-test macro can be useful for this as well. e.g.

(elpaca-test
  :dir "elpaca.test"
  :init
  ;;bootstrap is already included, just add init forms...
  (elpaca elpaca-use-package (elpaca-use-package-mode) (setq elpaca-use-package-by-default t))
  (elpaca-wait)
  ;;etc
  )
bdarcus commented 1 year ago

Doh!

EDIT: sorry I was working on this as you posted, and missed your's. Will review now.

Version

Elpaca 2bbd509 HEAD -> master, origin/master, origin/HEAD
installer:      0.3
emacs-version:  GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6)
 of 2023-03-12
git --version:  git version 2.39.2

Config

This generates the error, upon opening Emacs:

(use-package org-roam
  :elpaca (org-roam :host github :repo "org-roam/org-roam")
  :init (setq org-roam-v2-ack t)
  :custom
  (org-roam-directory "~/org/roam")
  (org-roam-capture-templates
   '(("d" "default" plain
      "%?"
      :target
      (file+head
       "%<%Y%m%d%H%M%S>-${slug}.org"
       "#+title: ${title}\n")
      :unnarrowed t)
     ("n" "literature note" plain
      "%?"
      :target
      (file+head
       "%(expand-file-name \"biblio\" org-roam-directory)/${citekey}.org"
       "#+title: ${citekey}.${author} :: ${title}.\n#+created: %U\n#+last_modified: %U\n\n")
      :unnarrowed t))))

(use-package citar-org-roam
  :after (citar org-roam)
  :config (citar-org-roam-mode)
  :custom
  (citar-org-roam-capture-template-key "n")
  (citar-org-roam-subdir "biblio"))

(use-package citar
  :custom
  (citar-bibliography bd/bibliography)
  (citar-notes-paths bd/notes)
  (citar-library-paths bd/library-files)
  (org-cite-global-bibliography bd/bibliography)
  (org-cite-insert-processor 'citar)
  (org-cite-follow-processor 'citar)
  (org-cite-activate-processor 'csl-activate)
  :hook
  (org-mode . citar-capf-setup)
  (markdown-mode . citar-capf-setup)
  (LaTeX-mode . citar-capf-setup))
bdarcus commented 1 year ago

I've cloned the full configuration you've linked into a temporary environment and everything installed cleanly. Is there something else that needs to be done to trigger the error you're seeing? It's also difficult for me to reproduce anything on my end because the set up assumes local files exist, which I do not have (e.g. ~/org/*.bib).

I was trying to figure out how to simplify it in posting the above reply, but not having much luck. Sorry about that.

Error (use-package): citar/:config: Cannot open load file: No such file or directory, emacsql-sqlite

That error message indicates that something is trying to load emacsql-sqlite during the :config stanza of the citar's use-package declaration.

In reviewing the details, I did modify it to the above, which now generates a different error, specific to org-roam and emacsql-sqlite, again upon opening Emacs:

⛔ Error (use-package): org-roam/:catch: Cannot open load file: No such file or directory, emacsql-sqlite

I haven't seen anything to indicate this is a bug with Elpaca yet. My advice would be to start simpler. Use a single file for the init and add each use-package declaration one at a time. That will help narrow down when the problem occurs.

OK.

The elpaca-test macro can be useful for this as well...

I've seen you mention the test macro elsewhere, I think, but I wasn't clear how to use it. But looking at the docstrings now, things are more clear!

Will give it a shot.

I have, FWIW, been using the new --init-directory option in Emacs 29 to test this.

progfolio commented 1 year ago

Try evaluating the following in your *scratch* buffer:

(elpaca-test
  :dir "elpaca.85"
  :early-init (setq inhibit-splash-screen t
                    native-comp-jit-compilation nil)
  (load-theme 'modus-vivendi t)
  :init
  (elpaca elpaca-use-package
    (elpaca-use-package-mode)
    (setq elpaca-use-package-by-default t))
  (elpaca-wait)

  (use-package org-roam
    :elpaca (org-roam :host github :repo "org-roam/org-roam")
    :init (setq org-roam-v2-ack t)
    :custom
    (org-roam-directory "~/org/roam")
    (org-roam-capture-templates
     '(("d" "default" plain
        "%?"
        :target
        (file+head
         "%<%Y%m%d%H%M%S>-${slug}.org"
         "#+title: ${title}\n")
        :unnarrowed t)
       ("n" "literature note" plain
        "%?"
        :target
        (file+head
         "%(expand-file-name \"biblio\" org-roam-directory)/${citekey}.org"
         "#+title: ${citekey}.${author} :: ${title}.\n#+created: %U\n#+last_modified: %U\n\n")
        :unnarrowed t))))

  (use-package citar-org-roam
    :after (citar org-roam)
    :config (citar-org-roam-mode)
    :custom
    (citar-org-roam-capture-template-key "n")
    (citar-org-roam-subdir "biblio"))

  (use-package citar
    :custom
    (org-cite-insert-processor 'citar)
    (org-cite-follow-processor 'citar)
    (org-cite-activate-processor 'csl-activate)
    :hook
    (org-mode . citar-capf-setup)
    (markdown-mode . citar-capf-setup)
    (LaTeX-mode . citar-capf-setup)))

It will install everything in a temporary environment and launch a new Emacs session. On my end, everything installs cleanly and I get no errors. However, I'm on Emacs 30.

bdarcus commented 1 year ago

On my end, everything installs cleanly and I get no errors.

Same here.

However, I'm on Emacs 30.

Maybe I'll update my Emacs build.

Anyway, below is the final minimal version I needed, with the paths set, and vertico added.

No errors, and citar-org-roam-mode is correctly set, when first running a citar command.

I just needed to run org-roam-db-sync for the note indicators to correctly show up citar.

image

I'll close this, then, and see if I can rebuild back up a simple single-file version.

Thanks much for the help!

(elpaca-test
  :dir "elpaca.85"
  :early-init (setq inhibit-splash-screen t
                    native-comp-jit-compilation nil)
  (load-theme 'modus-vivendi t)
  :init
  (elpaca elpaca-use-package
    (elpaca-use-package-mode)
    (setq elpaca-use-package-by-default t))
  (elpaca-wait)

  (use-package vertico
    :init
    (vertico-mode))

  (use-package org-roam
    :elpaca (org-roam :host github :repo "org-roam/org-roam")
    :init (setq org-roam-v2-ack t)
    :custom
    (org-roam-directory "~/org/roam")
    (org-roam-capture-templates
     '(("d" "default" plain
        "%?"
        :target
        (file+head
         "%<%Y%m%d%H%M%S>-${slug}.org"
         "#+title: ${title}\n")
        :unnarrowed t)
       ("n" "literature note" plain
        "%?"
        :target
        (file+head
         "%(expand-file-name \"biblio\" org-roam-directory)/${citekey}.org"
         "#+title: ${citekey}.${author} :: ${title}.\n#+created: %U\n#+last_modified: %U\n\n")
        :unnarrowed t))))

  (use-package citar-org-roam
    :after (citar org-roam)
    :config (citar-org-roam-mode)
    :custom
    (citar-org-roam-capture-template-key "n")
    (citar-org-roam-subdir "biblio"))

  (use-package citar
    :custom
    (citar-bibliography "~/org/bib/academic.bib")
    (citar-notes-paths '("~/org/roam/biblio"))
    (org-cite-insert-processor 'citar)
    (org-cite-follow-processor 'citar)
    (org-cite-activate-processor 'csl-activate)
    :hook
    (org-mode . citar-capf-setup)
    (markdown-mode . citar-capf-setup)
    (LaTeX-mode . citar-capf-setup)))
bdarcus commented 1 year ago

Update: I ended up deleting the local elpaca directory and reinstalling everything. That solved it, for whatever reason.