3
43
Fork
You've already forked opencode.el
16

Can't install #13

Closed
opened 2026年01月17日 22:49:46 +01:00 by alexispurslane · 7 comments
Contributor
Copy link

I've tried cloning the repository, adding its directory to my load-path, then (require 'opencode)ing, as well as using:

(use-package opencode
 :vc (:url "https://codeberg.org/sczi/opencode.el.git"))

And after either, although it shows byte-compiling the files and everything, I'm not seeing an opencode command defined. When I run the **use-package, this is what I see:

Retrieving tag 1ca27a71cb33ee81f1d047bc9899e216168db80a into ~/.emacs.d/elpa/opencode/... done
 INFO Scraping 1 files for loaddefs...done
Checking /Users/alexispurslane/.emacs.d/elpa/opencode... [3 times]
Compiling /Users/alexispurslane/.emacs.d/elpa/opencode/opencode.el...done
Wrote /Users/alexispurslane/.emacs.d/elpa/opencode/opencode.elc
Checking /Users/alexispurslane/.emacs.d/elpa/opencode...
Done (Total of 1 file compiled, 2 skipped)
VC package ‘opencode’ installed (Version 0.0.1, Revision "1ca27a71cb33ee81f1d047bc9899e216168db80a").
I've tried cloning the repository, adding its directory to my `load-path`, then `(require 'opencode)`ing, as well as using: ```lisp (use-package opencode :vc (:url "https://codeberg.org/sczi/opencode.el.git")) ``` And after either, although it shows byte-compiling the files and everything, I'm not seeing an `opencode` command defined. When I run the **`use-package`, this is what I see: ``` Retrieving tag 1ca27a71cb33ee81f1d047bc9899e216168db80a into ~/.emacs.d/elpa/opencode/... done INFO Scraping 1 files for loaddefs...done Checking /Users/alexispurslane/.emacs.d/elpa/opencode... [3 times] Compiling /Users/alexispurslane/.emacs.d/elpa/opencode/opencode.el...done Wrote /Users/alexispurslane/.emacs.d/elpa/opencode/opencode.elc Checking /Users/alexispurslane/.emacs.d/elpa/opencode... Done (Total of 1 file compiled, 2 skipped) VC package ‘opencode’ installed (Version 0.0.1, Revision "1ca27a71cb33ee81f1d047bc9899e216168db80a"). ```
Owner
Copy link

So it looks like :vc in use package defaults to using the last commit where the version string was bumped. Which I haven't changed since the initial commit of an empty skeleton project with version 0.0.1. I'm fixing bugs almost everyday and don't want to bump the version constantly, it's better if people just configure to use the latest revision.

try:

(use-package opencode
 :vc (:url "https://codeberg.org/sczi/opencode.el" :rev :newest))

I think if it already installed the old commit that won't make it checkout the latest version without also running package-vc-upgrade

So it looks like `:vc` in use package defaults to using the last commit where the version string was bumped. Which I haven't changed since the initial commit of an empty skeleton project with version 0.0.1. I'm fixing bugs almost everyday and don't want to bump the version constantly, it's better if people just configure to use the latest revision. try: ``` (use-package opencode :vc (:url "https://codeberg.org/sczi/opencode.el" :rev :newest)) ``` I think if it already installed the old commit that won't make it checkout the latest version without also running `package-vc-upgrade`
Author
Contributor
Copy link

I'll give that a shot, thank you so much!

I'll give that a shot, thank you so much!
Author
Contributor
Copy link

It didn't help. Got Empty checkout for opencode. Also, if the revision were the problem, then why did manually cloning the repo, adding it to my load-path, and requiring it not work?

It didn't help. Got `Empty checkout for opencode`. Also, if the revision were the problem, then why did manually cloning the repo, adding it to my `load-path`, and requiring it not work?
Owner
Copy link

hm not sure maybe if the early revision is checked out and earlier in the load-path it will load that version instead of the manually cloned one?

The original issue I duplicated making .emacs.d2/init.el with:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(require 'use-package)
(setq use-package-always-ensure t)
(use-package magit)
(use-package plz)
(use-package plz-media-type)
(use-package plz-event-source)
(use-package markdown-mode)
(setq use-package-verbose t)
(use-package opencode
 :vc (:url "https://codeberg.org/sczi/opencode.el"))

and then running with emacs --init-directory ~/.emacs.d2/
And got the original issue as you described, that it downloads and bytecompiles, but the opencode command doesn't exist, and it turns out because it checked out the initial commit where the opencode command hadn't been written yet. Then I found the use-package documentation explaining it takes the latest commit where the version has changed, which hasn't changed since the initial commit. With :rev newest it didn't update the package in the moment, but if I ran package-vc-upgrade or package-delete and let it install again, then it used the latest commit.
Can you reproduce the problem with a minimal emacs config?

hm not sure maybe if the early revision is checked out and earlier in the load-path it will load that version instead of the manually cloned one? The original issue I duplicated making `.emacs.d2/init.el` with: ``` (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (require 'use-package) (setq use-package-always-ensure t) (use-package magit) (use-package plz) (use-package plz-media-type) (use-package plz-event-source) (use-package markdown-mode) (setq use-package-verbose t) (use-package opencode :vc (:url "https://codeberg.org/sczi/opencode.el")) ``` and then running with `emacs --init-directory ~/.emacs.d2/` And got the original issue as you described, that it downloads and bytecompiles, but the opencode command doesn't exist, and it turns out because it checked out the initial commit where the opencode command hadn't been written yet. Then I found the use-package documentation explaining it takes the latest commit where the version has changed, which hasn't changed since the initial commit. With `:rev newest` it didn't update the package in the moment, but if I ran `package-vc-upgrade` or `package-delete` and let it install again, then it used the latest commit. Can you reproduce the problem with a minimal emacs config?
Author
Contributor
Copy link

I'll try your minimal config and see what happens. Also, I did do a package-delete before trying your :rev :newest solution, so there's that

I'll try your minimal config and see what happens. Also, I did do a package-delete before trying your :rev :newest solution, so there's that
Author
Contributor
Copy link

Oh okay I see what happened. I accidentally corrupted load-path! yeah, the :rev :newest solution works. I'm cool to close this issue if you are! I could make a PR to add the use-package code to the README for people who want to use it if you want :)

Oh okay I see what happened. I accidentally corrupted `load-path`! yeah, the `:rev :newest` solution works. I'm cool to close this issue if you are! I could make a PR to add the `use-package` code to the README for people who want to use it if you want :)
Owner
Copy link

ok glad it worked! sure I'd welcome a PR to add it to the README. Maybe it can just replace the use-package with straight.el instructions? I didn't even realize use-package added the :vc keyword until your issue. You use to need straight.el or other 3rd party packages for that but now that it's in emacs by default, might as well just provide instructions for the default way.

ok glad it worked! sure I'd welcome a PR to add it to the README. Maybe it can just replace the use-package with straight.el instructions? I didn't even realize `use-package` added the `:vc` keyword until your issue. You use to need straight.el or other 3rd party packages for that but now that it's in emacs by default, might as well just provide instructions for the default way.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sczi/opencode.el#13
Reference in a new issue
sczi/opencode.el
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?