Open adrianomitre opened 2 months ago
this would be a challenging this to fix I'm afraid. We have some logic for this specific to PATH but it's quite complex and I don't know if it could be reused or how easy that might be since I think it's split across the codebase.
I would just do export ORIGINAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
in your rc file then use that with mise so it is reading from an env var it's not modifying
One reason the delayed PATH entries logic is complicated is because it operates on a list variable instead of a scalar. Plus a good amount of my PR was about parsing the delayed evaluation entries in the TOML configs.
I'm not sure if the tera templates are using PRISTINE_ENV (which is the current env vars minus mise modifications) or not but they probably should. I suppose if mise was using PRISTINE_ENV and it was working correctly this shouldn't be a problem
oh interesting, looks like we set env
to PRISTINE_ENV as I thought: https://github.com/jdx/mise/blob/65694784bc1a407b34f51df6b6376e5ae23db85c/src/tera.rs#L19
however you're using get_env()
which is a tera built-in function which doesn't use PRISTINE_ENV—hence why this is happening. I would try just switching to env
. If that's the case we should update the docs. Not really to admonish using get_env()
because sometimes you may actually want that behavior.
Describe the bug
To Reproduce
[env]
in.mise.toml
"over-evaluated" times leading to ever increasing, incorrect results.Given
~/.mise.toml
:Expected behavior
The value of
LD_LIBRARY_PATH
should be:/home/linuxbrew/.linuxbrew/lib
in all the cases above.mise doctor
output