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

Best practice for running a watcher sensitive to devenv.nix changes? #1363

Open
mx00s opened this issue Aug 6, 2024 · 0 comments
Open

Best practice for running a watcher sensitive to devenv.nix changes? #1363

mx00s opened this issue Aug 6, 2024 · 0 comments
Labels
question Further information is requested

Comments

@mx00s
Copy link

mx00s commented Aug 6, 2024

I ran into a minor pain point recently that could potentially inform the design of #1362. It could easily be out of scope too; I'm not sure.

I have a scripts.watch-tests.exec that uses cargo-watch to rerun tests implemented in scripts.run-tests.exec whenever files change. For the most part this works really well. I have direnv set up I just cd into my project directory and run watch-tests to get continuous feedback as I develop.

Now, the minor pain point: whenever I change devenv.nix I have to remember to ctrl+c out of that watch-tests script, patiently wait for direnv to reload, and then rerun watch-tests. Sometimes I hit ctrl+c twice, either accidentally or because I needed to do something else, and this aborts the direnv reload before it can finish. In that case, I need to remember to manually reload before I launch watch-tests again. Although the watcher I run picks up on the devenv.nix change and reruns run-tests, it doesn't actually incorporate the effects of changes to devenv.nix.

I'd prefer to have watch-tests seamlessly reload direnv whenever devenv.nix changes so I can get immediate feedback. Adding direnv reload to the start of scripts.run-tests.exec doesn't fix it.

I haven't investigated much yet, but I suspect another devenv abstraction may be more fitting than scripts. Perhaps I should revisit processes or services now that other aspects of this project's workflow have matured more.

@mx00s mx00s added the question Further information is requested label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant