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

addon messing with 44 variables with empty envrc #471

Open
endigma opened this issue Apr 24, 2023 · 15 comments
Open

addon messing with 44 variables with empty envrc #471

endigma opened this issue Apr 24, 2023 · 15 comments
Labels
question Further information is requested

Comments

@endigma
Copy link

endigma commented Apr 24, 2023

using fish shell + starship, addon causes integrated terminals to fail to load.

This only happens with this addon, not with direnv in general. Not sure how to debug this even

@endigma
Copy link
Author

endigma commented Apr 24, 2023

image
This is in the addon logs, may have something to do with this?

@endigma
Copy link
Author

endigma commented Apr 24, 2023

image

The addon also reports +0/~44/-0, which is odd, as the .envrc is empty.

@endigma endigma changed the title mktemp: failed to create file via template '/.psub.XXXXXXXXXX': Permission denied addon messing with 44 variables with empty envrc Apr 24, 2023
@mkhl
Copy link
Contributor

mkhl commented Apr 24, 2023

FWIW it does work for me:
image

You'll have to give me a lot more to be able to help. Maybe… tell me a bit about your system? How did you install the software and how are you running it? Where are fish and starship located? Does it matter where the workspace with the empty .envrc is? How reproducible is this behavior?
I have no idea if I can help you but without more info I can't even start trying…

My 🔮 believes that nix is involved but I can't figure out how yet.

Also screenshots don't help without you describing why you included them, and are strictly worse than just posting the screenshotted text. Especially when the screenshots are severely cropped, like the extension output above. Which other environment variables were changed and how? Which internal direnv variables were changed?

@mkhl mkhl added the question Further information is requested label Apr 24, 2023
@endigma
Copy link
Author

endigma commented Apr 24, 2023

  • Void Linux 6.1.21_1 # 1 SMP PREEMPT_DYNAMIC Fri Mar 24 00:43:29 UTC 2023 x86_64 GNU/Linux

  • Starship and direnv both installed through xbps

  • The .envrc doesn't even have to exist, it always does it.

Full extension output on failure:
https://gist.github.com/endigma/7f135a9f002f33e0a1974b413acad068

@mkhl
Copy link
Contributor

mkhl commented Apr 24, 2023

Thanks. Those variables are consistent with what a nix shell defines, the extension unsetting them all seems really weird…

You wouldn't happen to have installed vscode with nix, or started it from a nix-shell?

Does the direnv: Reset and reload environment change anything?

@endigma
Copy link
Author

endigma commented Apr 24, 2023

I'm currently working, and reproducing this requires reloading the window which breaks live share. I'll do any experimentation later.

No vscode nix, just normal systemwide nix afaik. I use any-nix-shell to make nix-shell work with fish when I do use it, which works completely fine outside of vscode with the addon enabled.

@mkhl
Copy link
Contributor

mkhl commented Apr 24, 2023

There's no rush, I'm about to go to sleep anyways :)

@endigma
Copy link
Author

endigma commented May 5, 2023

This probably had something to do with having multiple direnv extensions installed. 😅

@endigma endigma closed this as completed May 5, 2023
@endigma
Copy link
Author

endigma commented May 5, 2023

Nevermind, just happened again. I was in some sort of limbo and reloaded and it's back.

No envrc in this folder, nor any parent. direnv status reports nothing, except that my bash path is in my nix store, which is abnormal.

Reset and reload does nothing.

direnv status
direnv exec path /usr/bin/direnv
DIRENV_CONFIG /home/end/.config/direnv
bash_path /nix/store/pk3kkaafln68gzxawk57qp9m5h5285va-bash-interactive-5.2-p15/bin/bash
disable_stdin false
warn_timeout 5s
whitelist.prefix [/home/end/repos/hussleinc/mesa]
whitelist.exact map[]
No .envrc or .env loaded
No .envrc or .env found

@endigma endigma reopened this May 5, 2023
@endigma
Copy link
Author

endigma commented May 5, 2023

Adding

echo "Hello"

to .envrc seems to prevent the envar overwrite from happening, status bar now reads +0/~0/-0. There is a different issue now though, see following comment.

@endigma
Copy link
Author

endigma commented May 5, 2023

When it's "working", starship reports I'm in impure / nix-shell, but the only package seems to be nix-shell.

> nix-shell-info
nix-shell

> which bash
/nix/store/pk3kkaafln68gzxawk57qp9m5h5285va-bash-interactive-5.2-p15/bin/bash

> which ls
/nix/store/lyicmql3ws929d7azr65h25b2hyakmb6-coreutils-9.1/bin/ls

> which cargo # something a default nix-shell wouldn't provide
/home/end/.cargo/bin/cargo

This is consistent with behavior when running, for example, nix-shell -p bash, except that there's no shell.nix anywhere in the parent directories and use nix is not mentioned in the envrc.

@endigma
Copy link
Author

endigma commented May 5, 2023

If I use direnv block to block the almost-empty .envrc, the nix-shell goes away and I'm left with a stock environment.

direnv: error /tmp/tmp.inFuqoP3N6/.envrc is blocked. Run `direnv allow` to approve its content
> which bash
/usr/bin/bash

@endigma
Copy link
Author

endigma commented May 7, 2023

I think this error is caused by any-nix-shell. I use this with fish. Are you able to reproduce with this installed?

@mkhl
Copy link
Contributor

mkhl commented May 18, 2023

Sorry, I haven't found the time to try and reproduce this with any-nix-shell yet, but I agree that it seems to be caused by it.

Could you try running without it? Nix started shipping with some fish integration in $HOME/.nix-profile/etc/profile.d/nix.fish at some point.

@endigma
Copy link
Author

endigma commented May 19, 2023

I've had it disabled for a while, don't really use nix-shell anymore so it hasn't been a huge issue. It would be good to have this fixed though. I recall having some other intermittent issues but none as consistently disruptive as the one that happens with any-nix-shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants