target / lorri

Your project's nix-env
Apache License 2.0
992 stars 69 forks source link

Only regenerate shell_gc_root if store path changes #498

Open leotaku opened 3 years ago

leotaku commented 3 years ago

Currently, lorri may regenerate the shell_gc_root link to the project environments store path, even if that store path has not changed. With this commit, lorri will now check if the current and previous store paths are identical and, if so, avoid regenerating the symlink.

This is especially interesting as lorri instructs direnv to watch the shell_gc_root symlink, previously causing direnv to be constantly reinvoked for some projects.

If merged, this should also fix issue #387.


Closes #387.

Overview

I simply tried implementing the most obvious solution with guidance from #387. I have tested these by running the modified binary on my personal machine and with my personal projects.

Also, I am not sure if this should be classified as a feature or a fix.

Checklist

leotaku commented 3 years ago

Whoops, it seems like those CI errors are out of my control... Still, I can confirm that the ci script finishes with a exit status of zero on my machine.