progfolio / elpaca

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

[Support]: ".d" Suffix dropped when cloning package from "emacs.d" repo #361

Closed jsyjr closed 1 month ago

jsyjr commented 1 month ago

Confirmation

Elpaca Version

Elpaca 7b5e269 grafted, HEAD -> master, origin/master, origin/HEAD installer: 0.7 emacs-version: GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.6.0, NS appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-08 git --version: git version 2.39.5 (Apple Git-154) Elpaca 7b5e269 grafted, HEAD -> master, origin/master, origin/HEAD installer: 0.7 emacs-version: GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.6.0, NS appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-08 git --version: git version 2.39.5 (Apple Git-154)

Operating System

MacOS version 15.0

Description

I am trying to follow Josh Caswell's "swifter" work. In my emacs .init.el I use use-package, elpaca and elpaca-use-package. My stanza to install Josh's my-swift-mode looks like this:

(use-package my-swift-mode
  :ensure (:host codeberg :repo "woolsweater/.emacs.d/"
                 :files (:defaults "modules/*.el" "startup/*.el" "wool-util/*.el"))
 :mode "\\.swift\\'" )`

Unfortunately, elpaca is unable to clone that repository because it drops the trailing 'd' in '.emacs.d'.

progfolio commented 1 month ago

Unfortunately, elpaca is unable to clone that repository because it drops the trailing 'd' in '.emacs.d'.

This is by design. File suffixes are dropped because there are a number of elisp packages which are hosted in repositories which include a ".el" suffix. You can use the :repo recipe keyword to rename the repository locally. See the following test case:

Test Case [How to run this test?](https://github.com/progfolio/elpaca/wiki/Troubleshooting#the-elpaca-test-macro) ```emacs-lisp (elpaca-test :init (elpaca (my-swift-mode :host codeberg :repo ("woolsweater/.emacs.d" . "my-swift-mode") :files (:defaults "modules/*.el" "startup/*.el" "wool-util/*.el") :wait t)) (princ (elpaca-info 'my-swift-mode))) ```
Host Env
elpaca02d97bf HEAD -> master, origin/master, origin/HEAD
installer0.7
emacsGNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-09-12
gitgit version 2.46.0
Output ```emacs-lisp Elpaca menu item cache discarded due to version change. INFO Scraping 16 files for loaddefs... INFO Scraping 16 files for loaddefs...done GEN ../elpaca-autoloads.el Cloning into '/tmp/elpaca.Hpmh0C/elpaca/repos/elpaca'... Your branch is up to date with 'origin/master'. Checking /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-info.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-log.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-manager.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-menu-elpa.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-menu-melpa.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-menu-org.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-process.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-test.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca-ui.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca.el... Checking /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/doc... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/doc/early-init.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/doc/init.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/doc/installer.el... Checking /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/extensions... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/extensions/elpaca-use-package.el... Checking /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/images... Checking /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/test... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/test/elpaca-test.el... Compiling /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/test/elpaca-tests.el... Done (Total of 12 files compiled, 4 skipped in 4 directories) Downloading MELPA recipes... Downloading MELPA recipes...100% Downloading NonGNU-devel ELPA... Downloading GNU-devel ELPA... Downloading NonGNU ELPA... Downloading GNU ELPA... my-swift-mode Not available in menu functions source: Init file full recipe: ( :package "my-swift-mode" ;; Inherited from declaration. :wait t :files (:defaults "modules/*.el" "startup/*.el" "wool-util/*.el") :repo ("woolsweater/.emacs.d" . "my-swift-mode") :host codeberg ;; Inherited from elpaca-order-functions. :depth 1 :inherit t :protocol https) dependencies: consult >= 0.9 eglot >= 1.7 jsonrpc >= 1.0.14 flymake >= 1.0.9 project >= 0.3.0 xref >= 1.0.1 eldoc >= 1.11.0 smartparens >= 0 solarized-theme >= 0 dash >= 2.16 swift-mode >= 8.3.0 seq >= 2.3 tree-sitter >= 0.15 tsc >= 0.15 dependents: nil statuses: (finished activation info byte-compilation autoloads linking unblocked blocked ref-checked-out cloning queued) files: $REPOS/my-swift-mode/wool-util/wool-util.el → $BUILDS/my-swift-mode/wool-util.el $REPOS/my-swift-mode/startup/.dir-locals.el → $BUILDS/my-swift-mode/.dir-locals.el $REPOS/my-swift-mode/startup/appearance.el → $BUILDS/my-swift-mode/appearance.el $REPOS/my-swift-mode/startup/builtin.el → $BUILDS/my-swift-mode/builtin.el $REPOS/my-swift-mode/startup/externals.el → $BUILDS/my-swift-mode/externals.el $REPOS/my-swift-mode/startup/general.el → $BUILDS/my-swift-mode/general.el $REPOS/my-swift-mode/startup/keyboard.el → $BUILDS/my-swift-mode/keyboard.el $REPOS/my-swift-mode/startup/mouse.el → $BUILDS/my-swift-mode/mouse.el $REPOS/my-swift-mode/modules/conjecture.el → $BUILDS/my-swift-mode/conjecture.el $REPOS/my-swift-mode/modules/convexed.el → $BUILDS/my-swift-mode/convexed.el $REPOS/my-swift-mode/modules/curds-and-whey.el → $BUILDS/my-swift-mode/curds-and-whey.el $REPOS/my-swift-mode/modules/initialize.el → $BUILDS/my-swift-mode/initialize.el $REPOS/my-swift-mode/modules/monospace-mode.el → $BUILDS/my-swift-mode/monospace-mode.el $REPOS/my-swift-mode/modules/my-objc-mode.el → $BUILDS/my-swift-mode/my-objc-mode.el $REPOS/my-swift-mode/modules/my-swift-mode.el → $BUILDS/my-swift-mode/my-swift-mode.el $REPOS/my-swift-mode/modules/preen.el → $BUILDS/my-swift-mode/preen.el $REPOS/my-swift-mode/modules/sfsymbols-modeline.el → $BUILDS/my-swift-mode/sfsymbols-modeline.el $REPOS/my-swift-mode/modules/strings-mode.el → $BUILDS/my-swift-mode/strings-mode.el $REPOS/my-swift-mode/modules/sunglass.el → $BUILDS/my-swift-mode/sunglass.el $REPOS/my-swift-mode/modules/tree-sitter-grammar-mode.el → $BUILDS/my-swift-mode/tree-sitter-grammar-mode.el $REPOS/my-swift-mode/early-init.el → $BUILDS/my-swift-mode/early-init.el $REPOS/my-swift-mode/init.el → $BUILDS/my-swift-mode/init.el log: [2024-09-23 05:11:21] Package queued [2024-09-23 05:11:21] Continued by: elpaca--process [2024-09-23 05:11:21] Cloning [2024-09-23 05:11:21] $git clone --depth 1 https://codeberg.org/woolsweater/.emacs.d.git /tmp/elpaca.Hpmh0C/elpaca/repos/my-swift-mode/ [2024-09-23 05:11:21] Cloning into '/tmp/elpaca.Hpmh0C/elpaca/repos/my-swift-mode'... [2024-09-23 05:11:22] remote: Enumerating objects: 132, done. [2024-09-23 05:11:22] remote: Counting objects: 100% (132/132), done. [2024-09-23 05:11:22] remote: Compressing objects: 100% (116/116), done. [2024-09-23 05:11:23] remote: Total 132 (delta 3), reused 99 (delta 3), pack-reused 0 (from 0) [2024-09-23 05:11:23] Receiving objects: 100% (132/132), 99.93 KiB | 244.00 KiB/s, done. [2024-09-23 05:11:23] Resolving deltas: 100% (3/3), done. [2024-09-23 05:11:23] Continued by: elpaca--clone-process-sentinel [2024-09-23 05:11:23] Continued by: elpaca--configure-remotes [2024-09-23 05:11:23] Continued by: elpaca--checkout-ref [2024-09-23 05:11:23] Continued by: elpaca--dispatch-build-commands [2024-09-23 05:11:23] Queueing Dependencies [2024-09-23 05:11:24] Blocked by: (tsc tree-sitter swift-mode dash solarized-theme smartparens consult) [2024-09-23 05:11:24] Blocked by: (tsc tree-sitter swift-mode dash solarized-theme smartparens consult) [2024-09-23 05:11:24] Blocked by: (tsc tree-sitter dash solarized-theme smartparens consult) [2024-09-23 05:11:24] Blocked by: (tsc tree-sitter dash solarized-theme smartparens) [2024-09-23 05:11:25] Blocked by: (tsc tree-sitter solarized-theme smartparens) [2024-09-23 05:11:25] Blocked by: (tree-sitter solarized-theme smartparens) [2024-09-23 05:11:25] Blocked by: (solarized-theme smartparens) [2024-09-23 05:11:26] Blocked by: (solarized-theme) [2024-09-23 05:11:26] Continued by: elpaca--check-status [2024-09-23 05:11:26] Unblocked by: solarized-theme [2024-09-23 05:11:26] Checking dependency versions [2024-09-23 05:11:26] Continued by: elpaca--check-version [2024-09-23 05:11:26] Linking build files [2024-09-23 05:11:26] Continued by: elpaca--link-build-files [2024-09-23 05:11:26] Build files linked [2024-09-23 05:11:26] Generating autoloads: /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode [2024-09-23 05:11:26] $/usr/bin/emacs -Q -L /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/ -l /tmp/elpaca.Hpmh0C/elpaca/repos/elpaca/elpaca.el --batch --eval (progn (setq gc-cons-percentage 1.0) (elpaca-generate-autoloads "my-swift-mode" "/tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode")) [2024-09-23 05:11:26] INFO Scraping 21 files for loaddefs... [2024-09-23 05:11:26] INFO Scraping 21 files for loaddefs...done [2024-09-23 05:11:26] GEN my-swift-mode-autoloads.el [2024-09-23 05:11:26] Continued by: #[128 "\302\301\303\300\"\"\207" [("Autoloads Generated" nil) elpaca--process-sentinel apply append] 6 " (fn &rest ARGS2)"] [2024-09-23 05:11:26] Autoloads Generated [2024-09-23 05:11:26] Byte compiling [2024-09-23 05:11:26] $/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/31.0.50/native-lisp/"))) (dolist (dir '("/tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode" "/tmp/elpaca.Hpmh0C/elpaca/builds/consult" "/tmp/elpaca.Hpmh0C/elpaca/builds/smartparens" "/tmp/elpaca.Hpmh0C/elpaca/builds/dash" "/tmp/elpaca.Hpmh0C/elpaca/builds/solarized-theme" "/tmp/elpaca.Hpmh0C/elpaca/builds/swift-mode" "/tmp/elpaca.Hpmh0C/elpaca/builds/tree-sitter" "/tmp/elpaca.Hpmh0C/elpaca/builds/tsc")) (let ((default-directory dir)) (add-to-list 'load-path dir) (normal-top-level-add-subdirs-to-load-path))) (byte-recompile-directory "/tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode" 0 'force)) [2024-09-23 05:11:26] Checking /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/appearance.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] appearance.el:5:11: Error: Cannot open load file: No such file or directory, wool-setup [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/builtin.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] builtin.el:7:11: Error: Cannot open load file: No such file or directory, init-defs [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/conjecture.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/convexed.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/curds-and-whey.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/early-init.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/externals.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] externals.el:9:11: Error: Cannot open load file: No such file or directory, init-defs [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/general.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] general.el:9:11: Error: Cannot open load file: No such file or directory, init-defs [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/init.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] init.el:8:11: Error: Cannot open load file: No such file or directory, init-defs [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/initialize.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] initialize.el:5:11: Error: Cannot open load file: No such file or directory, wool-setup [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/keyboard.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] keyboard.el:9:11: Error: Cannot open load file: No such file or directory, wool-setup [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/monospace-mode.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] monospace-mode.el:1:1: Warning: file has no ‘lexical-binding’ directive on its first line [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/mouse.el... [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] mouse.el:7:11: Error: Cannot open load file: No such file or directory, wool-setup [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/my-objc-mode.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/my-swift-mode-autoloads.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/my-swift-mode.el... [2024-09-23 05:11:26] tsc-dyn-get: Using source :github (:loaded nil :recorded 0.18.0 :requested 0.18.0) [2024-09-23 05:11:26] tsc-dyn-get: Recorded version already satifies requested -> loading [2024-09-23 05:11:26] In toplevel form: [2024-09-23 05:11:26] my-swift-mode.el:25:11: Error: Cannot open load file: No such file or directory, wool-setup [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/preen.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/sfsymbols-modeline.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/strings-mode.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/sunglass.el... [2024-09-23 05:11:26] In sunglass:visible-foreground-for-background: [2024-09-23 05:11:26] sunglass.el:22:2: Warning: docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/tree-sitter-grammar-mode.el... [2024-09-23 05:11:26] Compiling /tmp/elpaca.Hpmh0C/elpaca/builds/my-swift-mode/wool-util.el... [2024-09-23 05:11:26] Done (Total of 12 files compiled, 9 failed, 1 skipped) [2024-09-23 05:11:26] Continued by: #[128 "\302\301\303\300\"\"\207" [("Byte compilation complete" nil) elpaca--process-sentinel apply append] 6 " (fn &rest ARGS2)"] [2024-09-23 05:11:26] Byte compilation complete [2024-09-23 05:11:26] Compiling Info files [2024-09-23 05:11:26] Continued by: elpaca--compile-info [2024-09-23 05:11:26] Info source files not found [2024-09-23 05:11:26] Continued by: elpaca--dispatch-build-commands [2024-09-23 05:11:26] Activating package [2024-09-23 05:11:26] Package build dir added to load-path [2024-09-23 05:11:26] Caching autoloads [2024-09-23 05:11:26] Autoloads cached [2024-09-23 05:11:26] Continued by: elpaca--activate-package [2024-09-23 05:11:26] ✓ 4.843 secs ```

Side note: There are quite few compilation errors in the output due to the repository not being set up like a proper elisp package. You may be able to get Elpaca to work with someone's .emacs.d, but it's not the primary design goal.

Does that help?

jsyjr commented 1 month ago

Thanks for the prompt reply. And good to know the rationale for the by-design behavior.

I have been able to run your elpaca-test form successfully. The many errors you mentioned are expected. I will address them in due course.

Between your elpaca-test example and the :repo documentation plus some experimentation, I was able to determine that my ":host codeberg" construct, though undiagnosed, would never work (:source ends up being nil).

I have finally ended up with this working form:

(use-package my-swift-mode
  :ensure (:repo "https://codeberg.org/woolsweater/.emacs.d.git"
                 :files (:default "*/*"))
  :mode "\\.swift\\'"
  )

Thanks - /john

progfolio commented 1 month ago

Glad you were able to get something working.

I was able to determine that my ":host codeberg" construct, though undiagnosed, would never work (:source ends up being nil).

Could you clarify what you mean here? Where is :source nil and what issue does that cause?

jsyjr commented 1 month ago

I have debug-on-error turned on. When I used the :host codeberg construct, I got a backtrace that included an empty :source value in numerous call frames near the top of the stack. I guessed (perhaps incorrectly) that the fact that elpaca's cache directory includes no codeberg entry might be the issue. That prompted me to try the :repo "full URL" construct.

On reviewing :host's documentation https://github.com/progfolio/elpaca/blob/master/doc/manual.md#host--fetcher :

A symbol or string representing the hosting service of the repository. Strings

are inserted in the URI verbatim.

the second sentence seems inaccurate. ':host github' surely inserts ' github.com', not verbatim 'github'. Does ':host codeberg' insert incorrectly 'codeberg.com' or does elpaca know enough to insert ' codeberg.org'?

/john

On Mon, Sep 23, 2024 at 4:48 PM Nicholas Vollmer @.***> wrote:

Glad you were able to get something working.

I was able to determine that my ":host codeberg" construct, though undiagnosed, would never work (:source ends up being nil).

Could you clarify what you mean here? Where is :source nil and what issue does that cause?

— Reply to this email directly, view it on GitHub https://github.com/progfolio/elpaca/issues/361#issuecomment-2369352807, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6DG43UNIKLJJMSQWL7EDZYB5B5AVCNFSM6AAAAABOVEYTIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRZGM2TEOBQG4 . You are receiving this because you modified the open/close state.Message ID: @.***>

-- John Yates 505 Tremont St, #803 Boston, MA 02116

progfolio commented 1 month ago

I guessed (perhaps incorrectly) that the fact that elpaca's cache directory includes no codeberg entry might be the issue.

The cache directory is mostly for storing computed recipes from various ELPAs. For example, melpa.eld will include recipes which specify :fetcher codeberg.

the second sentence seems inaccurate.

The full second sentence is:

Strings are inserted in the URI verbatim.

When a symbol is used, such as github or codeberg, the appropriate host should be computed. e.g. coderberg mapping to "codeberg.org". I plan on making the symbols more configurable in the future and will add more on that to the manual once it is implemented.

jsyjr commented 1 month ago

Thanks for the prompt, informative follow up.

And since I don't believe that I have said it yet, thank you so much for elpaca. I love it.

/john

On Thu, Sep 26, 2024 at 8:24 AM Nicholas Vollmer @.***> wrote:

I guessed (perhaps incorrectly) that the fact that elpaca's cache directory includes no codeberg entry might be the issue.

The cache directory is mostly for storing computed recipes from various ELPAs. For example, melpa.eld will include recipes which specify :fetcher codeberg.

the second sentence seems inaccurate.

The full second sentence is:

Strings are inserted in the URI verbatim.

When a symbol is used, such as github or codeberg, the appropriate host should be computed. e.g. coderberg mapping to "codeberg.org". I plan on making the symbols more configurable in the future and will add more on that to the manual once it is implemented.

— Reply to this email directly, view it on GitHub https://github.com/progfolio/elpaca/issues/361#issuecomment-2376806689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6DGY7VHMOT45DKGTHDZDZYP4HBAVCNFSM6AAAAABOVEYTIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZWHAYDMNRYHE . You are receiving this because you modified the open/close state.Message ID: @.***>

-- John Yates 505 Tremont St, #803 Boston, MA 02116

progfolio commented 1 month ago

And thank you for the kind words. Glad you're finding Elpaca useful.