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
lorri 1.3 evaluates shell.nix on all pings #11
Comments
Pings are intended to cause unconditional evaluation, that’s their primary use. The watcher will create its own events when a file changes, so I don’t see what this would give us? |
Lorri direnv sends a ping, I assume that was the reason for this issue? It should probably send something that has the behavior you propose instead. |
Yes. I am quite sure the expected behavior I describe is the previous behavior. I have been using lorri direnv as long as I have been using lorri, and this is a new regression. It results in a very noticeable behavior: every time the prompt is displayed, lorri reevaluates and direnv displays that is redefines the environment.
I think ping is meant to trigger a rebuild only if the directory was not already watched, so that when you first enter the repo you build it, because maybe something changed in the repo when it was not watched. But afterwards, it serves no purpose, as inotify is enough. nix-direnv sends a ping on very prompt display in order to notify on the "first entering the repo" event. |
Bear in mind that But you are right, we should switch direnv over to only trigger a reeval only when nothing was watched yet, e.g. by introducing a As to it not being the case until the rewrite, it might just have been a side effect of the general brokenness of the builder. I’m certain that the semantics of ping has always been “schedule a rebuild unconditionally”. |
Having lorri direnv use a new start-watching command looks good. |
Describe the bug
lorri 1.3 evaluates shell.nix on all pings, an not only on the first one.
To Reproduce
Steps to reproduce the behavior:
Log:
Expected behavior
Lorri should evaluate shell.nix (that is, run nix-instantiate) only:
Metadata
Reproduced on top of a26745e
The text was updated successfully, but these errors were encountered: