Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doom env doesn't correctly capture my PATH #7811

Open
4 tasks done
NightMachinery opened this issue Apr 11, 2024 · 3 comments
Open
4 tasks done

doom env doesn't correctly capture my PATH #7811

NightMachinery opened this issue Apr 11, 2024 · 3 comments
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet

Comments

@NightMachinery
Copy link
Contributor

I confirm that...

  • I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved.

  • I have read "How to Debug Issues", and will use it to provide as much information about this issue as possible.

  • The issue can be reproduced on the latest available commit of Doom.

  • The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. (Unstable versions end in .50, .60, or .9x)

Expected behavior

❯ doom env --force
> Regenerating envvars file
  ✓ Generated ~/.emacs.d/.local/env

The PATH saved is:

"PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"

While my PATH has a lot of other stuff:

env -i HOME="$HOME" $SHELL -ic env
...
PATH=/home/tmptilmay/micromamba/envs/p310/bin:/home/tmptilmay/micromamba/condabin:/home/tmptilmay/miniconda3/bin:/home/tmptilmay/anaconda/bin:/home/tmptilmay/.local/share/junest/bin:/home/tmptilmay/.config/guix/current/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/tmptilmay/.local/opt/brew/sbin:/home/tmptilmay/.local/opt/brew/bin:/home/tmptilmay/.local/bin:/home/tmptilmay/.cargo/bin:/home/tmptilmay/.emacs.d/bin:/home/tmptilmay/bin:/home/tmptilmay/go/bin:/usr/local/go/bin:/home/tmptilmay/.local/opt/brew/bin:/home/tmptilmay/go/bin:/home/tmptilmay/.local/opt/go/bin:/home/tmptilmay/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/tmptilmay/.junest/usr/bin_wrappers
...
_=/usr/bin/env

Current behavior

_

Steps to reproduce

_

System Information

https://pastebin.com/rF8Bg0zg

@NightMachinery NightMachinery added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Apr 11, 2024
@hlissner
Copy link
Member

I can't reproduce Doom not picking up the $PATH from its containing environment without:

  • Running doom env from within Emacs (in vterm, eshell, etc),
  • Making the emacs executable a shim script with a shebang line invoking an interactive or sandboxed shell,
  • Running doom env from inside a directory managed with direnv, or a sub-shell spawned by nix-shell (though, env would've caught this).

Try removing the env file by hand before running doom env again: rm -f ~/.emacs.d/.local/env; doom env

@NightMachinery
Copy link
Contributor Author

NightMachinery commented Apr 11, 2024

@hlissner My emacs is indeed a shim script:

❯ cat /home/x/.junest/usr/bin_wrappers/emacs
#!/usr/bin/env bash

eval "junest_args_array=(${JUNEST_ARGS:-ns})"
junest "${junest_args_array[@]}" -- $(basename ${0}) "$@"

What should I do?


junest might be the problem ... I don't really know how junest works. I use it to install emacs without having root access.

Trying various combinations of junest and env:

env -i HOME="$HOME" ${commands[junest]} $SHELL -ic env
env -i HOME="$HOME" ${commands[junest]} ns -- $SHELL -ic env

These still catch my PATH correctly ...

@NightMachinery
Copy link
Contributor Author

@hlissner When I use exec-path-from-shell, the PATH is captured correctly.

(require 'exec-path-from-shell)
(exec-path-from-shell-initialize)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet
Projects
Status: No status
Development

No branches or pull requests

2 participants