xenodium / chatgpt-shell

A multi-llm Emacs shell (ChatGPT, Claude, Gemini, Kagi, Ollama, Perplexity) + editing integrations
https://lmno.lol/alvaro
GNU General Public License v3.0
868 stars 77 forks source link

Unable to find shell-maker (:straight) #60

Closed jmcarcell closed 1 year ago

jmcarcell commented 1 year ago

Commit ae1f3b2e1bda06e940595c7420b32c6a96fe3b80 makes me unable to start chatgpt shell because of the following error:

 ■  Warning (initialization): An error occurred while loading ‘/home/juanmi/.emacs.d/init.el’:

error: Could not find package shell-maker. Updating recipe repositories: (org-elpa melpa gnu-elpa-mirror nongnu-elpa el-get emacsmirror-mirror) with ‘straight-pull-recipe-repositories’ may fix this

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

Simply removing the version works fine for me but I'm not sure why I'm getting that. I'm using an emacs built from master from a few weeks ago and this is my straight recipe:

  (use-package chatgpt-shell
  :straight (:host github :repo "xenodium/chatgpt-shell")
  :config
   (setq chatgpt-shell-openai-key "...")
   (setq chatgpt-shell-transmitted-context-length 0)
  )
xenodium commented 1 year ago

Commit https://github.com/xenodium/chatgpt-shell/commit/ae1f3b2e1bda06e940595c7420b32c6a96fe3b80 makes me unable to start chatgpt shell

Ah, sorry... I'm working on getting it into https://github.com/melpa/melpa/pull/8479 The changes are potentially needed (to be confirmed).

Simply removing the version works fine for me

Do you mean Version: 0.18.1? From chatgpt-shell.el or the one inshell-maker.el?

At the moment, it's looking like these two files should be considered separate packages for MELPA inclusion. For now I'd prefer to keep them in the same git repo if possible, though I'm not sure if this would create other complications.

I'm not familiar with straight, but would something like the following unblock you?

(use-package shell-maker
  :straight (:host github :repo "xenodium/chatgpt-shell" :files ("shell-maker.el")))

(use-package chatgpt-shell
  :requires shell-maker
  :straight (:host github :repo "xenodium/chatgpt-shell" :files ("chatgpt-shell.el")))
jmcarcell commented 1 year ago

Do you mean Version: 0.18.1? From chatgpt-shell.el or the one inshell-maker.el?

Removing (shell-maker "0.17.1"), exactly reverting https://github.com/xenodium/chatgpt-shell/commit/ae1f3b2e1bda06e940595c7420b32c6a96fe3b80

Separating it into two packages works fine but it's a bit non-trivial configuration for a single repo until there is a recipe in melpa for shell-maker I guess.

Feel free to close

xenodium commented 1 year ago

Thank you.

Separating it into two packages works fine

Please use this for the time being as I'm trying to work through MELPA submission at the moment.

I'll add the snippet to the README until I figure out an alternative.

meliache commented 1 year ago

Just note that I had the same issue with the elpaca file manager, which is a new package manager written from scratch from the maintainer of straight and uses similar recipes. It had the same issue. The above solution for straight should probably work for elpaca as well if you just replace :straight by :elpaca, as those are valid elpaca recipes.

But I had found also a different solution for myself: I added shell-maker to the list elpaca-ignored-dependencies. That variable is usually used in elpaca for packages that are already available in Emacs core, e.g. Eglot when using Emacs >= 29, to prevent elpaca trying to pull that from source when it's listed as a dependency. My config is:

(use-package chatgpt-shell
  :preface
  (add-to-list 'elpaca-ignored-dependencies 'shell-maker)
  :elpaca (:host github :repo "xenodium/chatgpt-shell" :files (:defaults "*.el"))
  :custom
  (chatgpt-shell-chatgpt-streaming t)
  (chatgpt-shell-openai-key
   (lambda ()
     (auth-source-pass-get 'secret "access-tokens/openai.com/emacs"))))

I'm not aware of an equivalent to elpaca-ignored-dependencies for straight.el, so the above solution is more general, but for purely elpaca this seems a bit less verbose and requires one less git clone step.

Elpaca works a bit differently that it does the dependency resolution and the beginning of reading the init, before loading any other package code, because it uses the dependency information to build the queue for asynchronously pulling and bulding the packages and loading the configuration code in the use-package/elpaca blocks

xenodium commented 1 year ago

chatgpt-shell is on MELPA now. Does that help with :straight/:elpaca?

jtmoulia commented 1 year ago

Just wanted to say using the MELPA package fixed the shell-maker issue for me -- danke!

xenodium commented 1 year ago

Just wanted to say using the MELPA package fixed the shell-maker issue for me -- danke!

Thanks for confirming. Closing.