devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Emacs unable to find devenv packages

Open ankhers opened this issue 3 years ago • 6 comments

I am really unsure if this is an issues of emacs or how devenv sets up packages. I am filing a ticket here because this is the first time I have actually had issues with it.

Essentially, I am starting a fresh project and using devenv init in order to start. I then enable languages.elixir, which supports the elixir_ls package. When I direnv allow, I get sent to a dev shell. I can then see that the elixir-ls binary and elixir packages are available. However when I use emacs to start editing the project, it cannot find the elixir-ls binary, and when I manually execute a shell command for elixir --version, I can see I am using my host elixir version instead of the newer version that was supplied by devenv.

I am really unsure of how to debug this kind of thing. But let me know what you need from me and I can do it.

ankhers avatar Nov 14 '22 16:11 ankhers

Are you launching emacs from the developer environment?

domenkozar avatar Nov 14 '22 16:11 domenkozar

I am not. I have emacs integrated with direnv. This has just worked in the past when using other tools such as numtide/devshell. But that uses use flake by default instead of a custom command. So my guess is it is somehow in how devenv is loading packages.

ankhers avatar Nov 14 '22 16:11 ankhers

Do you have the repository public so I can try to reproduce?

domenkozar avatar Nov 14 '22 16:11 domenkozar

https://github.com/ankhers/devenv-emacs

This is literally a brand new project

  1. $ mix new foo
  2. $ devenv init
  3. enable elixir language

ankhers avatar Nov 14 '22 16:11 ankhers

@ankhers and then you run devenv shell and inside emacs?

domenkozar avatar Nov 17 '22 13:11 domenkozar

I'm sorry, I forgot to include the .envrc file in that git repo. I just pushed it up. Direnv automatically calls devenv shell for me when I am in the shell and cd into the project.

Emacs I do not start within the devenv shell. I start emacs server globally with a systemd unit. I use the envrc emacs package to get direnv support.

When I open the previously linked project in emacs, I see that it is evaluating the .envrc file but then it fails to find the elixir-ls binary in my path.

If I open this project in emacs, it is able to find the package.

ankhers avatar Nov 17 '22 14:11 ankhers

I just installed devenv 0.4, and this seems to have resolved itself.

ankhers avatar Nov 28 '22 15:11 ankhers