progfolio / elpaca

An elisp package manager
GNU General Public License v3.0
657 stars 33 forks source link

[Support]: Elpaca log shows issues with latex, auctex and org-roam-bibtex #263

Closed bmp closed 9 months ago

bmp commented 9 months ago

Confirmation

Elpaca Version

Elpaca 09a94ca HEAD -> master, origin/master, origin/HEAD installer: 0.6 emacs-version: GNU Emacs 29.2 (build 2, x86_64-unknown-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2024-01-20 git --version: git version 2.43.2

Operating System

OS: Void x86_64 Kernel: 6.6.16_1

Description

Thank you for the prompt response on the previous support request! As I continue to migrate from straight.el to elpaca, I continue to find some issues. Here is the output of my elpaca log,

Package Status Info Time ▼
latex failed Unable to determine repo dir: (error "Cannot determine URL from recipe: (:source nil :protocol https :inherit t :depth 1 :package \"latex\")") 00.425704
auctex failed elpaca--queue-dependencies: (error "Unable to find main elisp file for \"auctex\"") 00.576205
org-roam-bibtex failed bibtex-completion installed version (1 0 0) lower than min required 2.0.0 00.592542

Here is my relevant configuration for each of them,

  1. auctex & latex:

    
    (use-package auctex
    :ensure t)
    
    (use-package latex
    :ensure t
    :hook ((LaTeX-mode . prettify-symbols-mode))
    :bind (:map LaTeX-mode-map
                ("C-S-e" . latex-math-from-calc))
    :config
    ;; Format math as a Latex string with Calc
    (defun latex-math-from-calc ()
      "Evaluate `calc' on the contents of line at point."
      (interactive)
      (cond ((region-active-p)
             (let* ((beg (region-beginning))
                    (end (region-end))
                    (string (buffer-substring-no-properties beg end)))
               (kill-region beg end)
               (insert (calc-eval `(,string calc-language latex
                                            calc-prefer-frac t
                                            calc-angle-mode rad)))))
            (t (let ((l (thing-at-point 'line)))
                 (end-of-line 1) (kill-line 0)
                 (insert (calc-eval `(,l
                                      calc-language latex
                                      calc-prefer-frac t
                                      calc-angle-mode rad))))))))

2. `org-roam-bibtex`: 

(use-package org-roam-bibtex :ensure t :after org-roam)



I've only made modifications to `:ensure` portion while moving from `straight.el`, otherwise they are the same portion.
progfolio commented 9 months ago

Thank you for the prompt response on the previous support request! As I continue to migrate from straight.el to elpaca, I continue to find some issues. Here is the output of my elpaca log,

You're welcome.

| latex | failed | Unable to determine repo dir: (error "Cannot determine URL from recipe: (:source nil :protocol https :inherit t :depth 1 :package \"latex\")") | 00.425704 |

This is due to the fact that there is no recipe for a "latex" package provided by any of elpaca-menu-functions. That's because "latex" is a sub-feature of the "auctex" package. A general explanation of this warning can be found on the warnings and errors wiki page. You'll want to add :ensure nil for latex.

| auctex | failed | elpaca--queue-dependencies: (error "Unable to find main elisp file for \"auctex\"") | 00.576205 |

Auctex requires a :pre-build recipe keyword. I have plans to possibly provide a menu item which includes a more complete recipe, but for now you can manually specify the recipe here:

https://github.com/progfolio/elpaca/issues/191#issuecomment-1870453017

If the recipe doesn't work, search the elpaca-log for errors during the :pre-build step. A common mistake is not having the required system binaries installed.

| org-roam-bibtex | failed | bibtex-completion installed version (1 0 0) lower than min required 2.0.0 | 00.592542 |

This is due the fact that the maintainer has published a 2.0.0 version of bibtex-completion, but did not bump the Version: package header field.

https://github.com/tmalsburg/helm-bibtex/blob/bf184cc311c9e1724f8b2eaf75b9e202c3aedd16/bibtex-completion.el#L7

You should open an issue upstream with the package maintainer to remind them to bump it. In the mean time, Elpaca is flexible enough to work around this. See the recipe in the test case below. It uses the :depth, :version, and :version-regexp keywords to report the version as indicated by the latest git tag. I plan on improving the situation here as well (Elisp versioning is a mess).

Test Case [How to run this test?](https://github.com/progfolio/elpaca/wiki/Troubleshooting#the-elpaca-test-macro) ```emacs-lisp (elpaca-test :early-init (setq elpaca-menu-functions '(elpaca-menu-melpa)) :init (elpaca (bibtex-completion :version elpaca--latest-tag :version-regexp "[.[:digit:]]+" :depth nil)) (elpaca-wait) (with-current-buffer (elpaca-info 'bibtex-completion) (print (buffer-substring-no-properties (point-min) (point-max))))) ```
Host Env
elpaca36243f2 HEAD -> fix/non-nil
installer0.6
emacsGNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-02-19
gitgit version 2.43.2
Output ```emacs-lisp Elpaca menu item cache discarded due to version change. INFO Scraping files for loaddefs... INFO Scraping files for loaddefs...done GEN ../elpaca-autoloads.el Cloning into '/tmp/elpaca.Fd7tvU/elpaca/repos/elpaca'... Your branch is up to date with 'origin/master'. Checking /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-info.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-log.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-manager.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-menu-elpa.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-menu-melpa.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-menu-org.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-process.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-test.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca-ui.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca.el... Checking /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/doc... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/doc/early-init.el... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/doc/init.el... Checking /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/extensions... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/extensions/elpaca-use-package.el... Checking /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/images... Checking /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/test... Compiling /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/test/elpaca-test.el... Done (Total of 11 files compiled, 3 skipped in 4 directories) Downloading MELPA recipes... Downloading MELPA recipes...100% Indenting region... Indenting region...done Indenting region... Indenting region...done "bibtex-completion A BibTeX backend for completion frameworks source: MELPA url: https://github.com/tmalsburg/helm-bibtex menu item recipe: ( :package \"bibtex-completion\" :fetcher github :repo \"tmalsburg/helm-bibtex\" :files (\"bibtex-completion.el\") :source \"MELPA\") full recipe: ( :package \"bibtex-completion\" ;; Inherited from declaration. :version-regexp \"[.[:digit:]]+\" :version elpaca--latest-tag :depth nil ;; Inherited from elpaca-order-functions. :inherit t :protocol https ;; Inherited from elpaca-menu-item. :source \"MELPA\" :files (\"bibtex-completion.el\") :repo \"tmalsburg/helm-bibtex\" :fetcher github) dependencies: parsebib >= 1.0 s >= 1.9.0 dash >= 2.6.0 f >= 0.16.2 cl-lib >= 0.5 biblio >= 0.2 emacs >= 26.1 dependents: nil installed version: 2.0.0 bf184cc statuses: (finished activation info byte-compilation autoloads linking unblocked blocked ref-checked-out cloning queued) files: $REPOS/helm-bibtex/bibtex-completion.el → $BUILDS/bibtex-completion/bibtex-completion.el log: [2024-02-19 12:15:09] Package queued [2024-02-19 12:15:09] Continued by: elpaca--process [2024-02-19 12:15:09] Cloning [2024-02-19 12:15:09] $git clone https://github.com/tmalsburg/helm-bibtex.git /tmp/elpaca.Fd7tvU/elpaca/repos/helm-bibtex/ [2024-02-19 12:15:09] Cloning into '/tmp/elpaca.Fd7tvU/elpaca/repos/helm-bibtex'... [2024-02-19 12:15:09] Resolving deltas: 100% (1180/1180), done. [2024-02-19 12:15:09] Continued by: elpaca--clone-process-sentinel [2024-02-19 12:15:09] Continued by: elpaca--configure-remotes [2024-02-19 12:15:09] Continued by: elpaca--checkout-ref [2024-02-19 12:15:09] Continued by: elpaca--dispatch-build-commands [2024-02-19 12:15:09] Queueing Dependencies [2024-02-19 12:15:10] Blocked by: (biblio f dash s parsebib) [2024-02-19 12:15:10] Blocked by: (biblio f dash s parsebib) [2024-02-19 12:15:10] Blocked by: (biblio f dash s) [2024-02-19 12:15:10] Blocked by: (biblio f dash) [2024-02-19 12:15:11] Blocked by: (biblio f) [2024-02-19 12:15:11] Blocked by: (biblio) [2024-02-19 12:15:11] Continued by: elpaca--check-status [2024-02-19 12:15:11] Unblocked by: biblio [2024-02-19 12:15:11] Checking dependency versions [2024-02-19 12:15:11] Continued by: elpaca--check-version [2024-02-19 12:15:11] Linking build files [2024-02-19 12:15:11] Continued by: elpaca--link-build-files [2024-02-19 12:15:11] Build files linked [2024-02-19 12:15:11] Generating autoloads: /tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion [2024-02-19 12:15:11] $/usr/bin/emacs -Q -L /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/ -l /tmp/elpaca.Fd7tvU/elpaca/repos/elpaca/elpaca.el --batch --eval (progn (setq gc-cons-percentage 1.0) (elpaca-generate-autoloads \"bibtex-completion\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion\")) [2024-02-19 12:15:11] INFO Scraping files for loaddefs... [2024-02-19 12:15:11] INFO Scraping files for loaddefs...done [2024-02-19 12:15:11] GEN bibtex-completion-autoloads.el [2024-02-19 12:15:11] Continued by: #[128 \"\\302\\301\\303\\300\\\"\\\"\\207\" [(\"Autoloads Generated\" nil) elpaca--process-sentinel apply append] 6 \" (fn &rest ARGS2)\"] [2024-02-19 12:15:11] Autoloads Generated [2024-02-19 12:15:11] Byte compiling [2024-02-19 12:15:11] $/usr/bin/emacs -q --batch --eval (let ((gc-cons-percentage 1.0) (native-comp-eln-load-path '(\"/home/n/.emacs.d/eln-cache/\" \"/usr/lib/emacs/30.0.50/native-lisp/\"))) (dolist (dir '(\"/tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/parsebib\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/s\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/dash\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/f\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/biblio\" \"/tmp/elpaca.Fd7tvU/elpaca/builds/biblio-core\")) (let ((default-directory dir)) (add-to-list 'load-path dir) (normal-top-level-add-subdirs-to-load-path))) (byte-recompile-directory \"/tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion\" 0 'force)) [2024-02-19 12:15:11] Checking /tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion... [2024-02-19 12:15:11] Compiling /tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion/bibtex-completion-autoloads.el... [2024-02-19 12:15:11] Compiling /tmp/elpaca.Fd7tvU/elpaca/builds/bibtex-completion/bibtex-completion.el... [2024-02-19 12:15:11] In toplevel form: [2024-02-19 12:15:11] bibtex-completion.el:1:1: Warning: file has no ‘lexical-binding’ directive on its first line [2024-02-19 12:15:12] bibtex-completion.el:115:12: Warning: custom-declare-variable ‘bibtex-completion-find-additional-pdfs’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:157:12: Warning: custom-declare-variable ‘bibtex-completion-notes-template-multiple-files’ docstring has wrong usage of unescaped single quotes (use \\=' or different quoting such as `...') [2024-02-19 12:15:12] bibtex-completion.el:169:12: Warning: custom-declare-variable ‘bibtex-completion-notes-template-one-file’ docstring has wrong usage of unescaped single quotes (use \\=' or different quoting such as `...') [2024-02-19 12:15:12] bibtex-completion.el:281:12: Warning: custom-declare-variable ‘bibtex-completion-additional-search-fields’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:309:12: Warning: custom-declare-variable ‘bibtex-completion-cite-default-command’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:320:12: Warning: custom-declare-variable ‘bibtex-completion-cite-default-as-initial-input’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:328:12: Warning: custom-declare-variable ‘bibtex-completion-pdf-field’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:367:9: Warning: defvar ‘bibtex-completion-display-formats-internal’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:371:9: Warning: defvar ‘bibtex-completion-cache’ docstring wider than 80 characters [2024-02-19 12:15:12] bibtex-completion.el:377:9: Warning: defvar ‘bibtex-completion-string-cache’ docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-normalize-bibliography: [2024-02-19 12:15:12] bibtex-completion.el:383:2: Warning: docstring has wrong usage of unescaped single quotes (use \\=' or different quoting such as `...') [2024-02-19 12:15:12] In bibtex-completion-parse-strings: [2024-02-19 12:15:12] bibtex-completion.el:485:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-resolve-crossrefs: [2024-02-19 12:15:12] bibtex-completion.el:599:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-make-entry-hash: [2024-02-19 12:15:12] bibtex-completion.el:641:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-parse-bibliography: [2024-02-19 12:15:12] bibtex-completion.el:673:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-get-entry: [2024-02-19 12:15:12] bibtex-completion.el:699:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-find-pdf-in-field: [2024-02-19 12:15:12] bibtex-completion.el:723:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-find-pdf-in-library: [2024-02-19 12:15:12] bibtex-completion.el:768:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-open-pdf: [2024-02-19 12:15:12] bibtex-completion.el:936:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-open-any: [2024-02-19 12:15:12] bibtex-completion.el:973:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-apa-format-reference: [2024-02-19 12:15:12] bibtex-completion.el:1135:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] In bibtex-completion-edit-notes: [2024-02-19 12:15:12] bibtex-completion.el:1476:2: Warning: docstring wider than 80 characters [2024-02-19 12:15:12] Done (Total of 1 file compiled, 1 skipped) [2024-02-19 12:15:12] Continued by: #[128 \"\\302\\301\\303\\300\\\"\\\"\\207\" [(\"Byte compilation complete\" nil) elpaca--process-sentinel apply append] 6 \" (fn &rest ARGS2)\"] [2024-02-19 12:15:12] Byte compilation complete [2024-02-19 12:15:12] Compiling Info files [2024-02-19 12:15:12] Continued by: elpaca--compile-info [2024-02-19 12:15:12] Info source files not found [2024-02-19 12:15:12] Continued by: elpaca--dispatch-build-commands [2024-02-19 12:15:12] Activating package [2024-02-19 12:15:12] Package build dir added to load-path [2024-02-19 12:15:12] Caching autoloads [2024-02-19 12:15:12] Autoloads cached [2024-02-19 12:15:12] Continued by: elpaca--activate-package [2024-02-19 12:15:12] ✓ 2.694 secs " Test Env Elpaca 09a94ca HEAD -> master, origin/master, origin/HEAD installer: 0.6 emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-02-19 git --version: git version 2.43.2 ```

You can use the above recipe in a use-package declaration like so:

(use-package bibtex-completion
  :ensure ( :version elpaca--latest-tag
            :version-regexp "[.[:digit:]]+"
            :depth nil))

Does that help?

einsiedlerspiel commented 9 months ago

This is due the fact that the maintainer has published a 2.0.0 version of bibtex-completion, but did not bump the Version: package header field.

I don't think it's bibtex-completions version header that's wrong, but org-roam-bibtex's dependency field. The other components of the completions repo all also depend on 1.0.0.

Did something in elpaca change how versions are checked? Because this issue definitely newer than any header changes in either package.

\Edit: actually I might have manually edited the dependency in the source file before.

Your workaround didn't work for me since it sets the version to 0? However in the dirtiest of workarounds this:

(use-package bibtex-completion
  :ensure (:version (lambda (x) "2.0.0")))

works.

progfolio commented 9 months ago

This is due the fact that the maintainer has published a 2.0.0 version of bibtex-completion, but did not bump the Version: package header field.

I don't think it's bibtex-completions version header that's wrong, but org-roam-bibtex's dependency field. The other components of the completions repo all also depend on 1.0.0.

Long story short:

GNU ELPA uses the "Version" package header field to detect when a version has been bumped to release a new build. MELPA detects when a new tag (possibly matching a :version-regexp in the package recipe) has been pushed to build a new release.

A few authors have taken to using git tags exclusively to denote release versions. Unfortunately, this necessitates a full clone of the repository to determine the version for a given ref.

Then you have the case here where there is conflicting information. The package Version claims "1.0.0", but the latest build on MELPA stable claims version "2.0.0". Elpaca tries the Version header before it tries the tags, so it ends up reporting the incorrect version in this case.

~~Did something in elpaca change how versions are checked? Because this issue definitely newer than any header changes in either package.~~

Elpaca did not check that dependency min version requirements were satisfied prior to 85bfd9843327801ef07afc435434da3df0a1895c.

\Edit: actually I might have manually edited the dependency in the source file before.

Your workaround didn't work for me since it sets the version to 0? However in the dirtiest of workarounds this:

Check the output of the full recipe with M-x elpaca-info bibtex-completion. Do the :depth, :version, and :version-regexp values match the values in the test case I provided? The test case correctly reports installed version: 2.0.0 bf184cc. If the recipe looks good, try M-x elpaca-delete-ing and re-installing bibtex-completion.

(use-package bibtex-completion
  :ensure (:version (lambda (x) "2.0.0")))

works.

That's not a satisfactory workaround because it will require you to bump the version manually. I'd recommend the solution in the test case.

I have plans to add a menu with recipes for all these "naughty" packages which should shift some recipe maintenance burden from Elpaca users to me :).

einsiedlerspiel commented 9 months ago

I needed to delete the existing build and repo files, now it works, thanks :).

MELPA detects when a new tag (possibly matching a :version-regexp in the package recipe) has been pushed to build a new release.

So the issue with bibtex-completion specifically seems to be that there are three MELPA packages (helm-*, ivy-* and bibtex-completion) living in that repo with independent version numbers in their header but the git tag corresponds to the helm package specifically.

progfolio commented 9 months ago

Lou Woell @.***> writes:

I needed to delete the existing build and repo files, now it works, thanks :).

MELPA detects when a new tag (possibly matching a :version-regexp in the package recipe) has been pushed to build a new release.

So the issue with bibtex-completion specifically seems to be that there are three MELPA packages (helm-, ivy- and bibtex-completion) living in that repo with independent version numbers in their header but the git tag corresponds to the helm package specifically.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

Yes. Either they would have to add a :version-regexp to each MELPA recipe for the independent packages, or keep the version in sync for all of them.

bmp commented 9 months ago

Thank you @progfolio, I have these issues sorted out now. Here are the respective pieces I am using now,

  1. auctex and latex

    
    (use-package auctex
    :ensure (:pre-build (("./autogen.sh")
          ("./configure"
           "--without-texmf-dir"
           "--with-packagelispdir=./"
           "--with-packagedatadir=./")
          ("make"))
        :build (:not elpaca--compile-info) ;; Make will take care of this step
        :files ("*.el" "doc/*.info*" "etc" "images" "latex" "style")
        :version (lambda (_) (require 'tex-site) AUCTeX-version)))
    
    (use-package latex
    :ensure nil
    :hook ((LaTeX-mode . prettify-symbols-mode))
    :bind (:map LaTeX-mode-map
        ("C-S-e" . latex-math-from-calc))
    :config
    ;; Format math as a Latex string with Calc
    (defun latex-math-from-calc ()
      "Evaluate `calc' on the contents of line at point."
      (interactive)
      (cond ((region-active-p)
         (let* ((beg (region-beginning))
            (end (region-end))
            (string (buffer-substring-no-properties beg end)))
           (kill-region beg end)
           (insert (calc-eval `(,string calc-language latex
                        calc-prefer-frac t
                        calc-angle-mode rad)))))
        (t (let ((l (thing-at-point 'line)))
         (end-of-line 1) (kill-line 0)
         (insert (calc-eval `(,l
                      calc-language latex
                      calc-prefer-frac t
                      calc-angle-mode rad))))))))
2. `org-roam-bibtex`, I had to delete `bibtex-completion` (which also meant both `org-ref` and `org-roam-bibtex`) before it worked for me.

(use-package bibtex-completion :ensure ( :version elpaca--latest-tag :version-regexp "[.[:digit:]]+" :depth nil))

(use-package org-roam-bibtex :ensure t :after org-roam :config (require 'org-ref))