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

Add watch mode #8

Open
natnat-mc opened this issue Sep 13, 2020 · 3 comments
Open

Add watch mode #8

natnat-mc opened this issue Sep 13, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@natnat-mc
Copy link
Owner

inotify to get fs events, and trigger targets based on that

moonbuild -w [target] should get all targets that target depends on, find the smallest subset of directories that matches them, watch them and retrigger a build of target when any file changes. since moonbuild only rebuilds what actually changed, this should be both efficient and complete. This will not work if there's new files or dependancies, but this can be fixed by also watching Build.moon and reexecuting it every time any file changes

probably steal some code from alfons for the specifics of how to use inotify

@natnat-mc natnat-mc added the enhancement New feature or request label Sep 13, 2020
@natnat-mc
Copy link
Owner Author

need #12

@natnat-mc
Copy link
Owner Author

natnat-mc commented Nov 6, 2020

can probably use the inotifyd or busybox inotifyd command as a kind of daemon through luaposix if inotify isn't installed; maybe even an inline nodejs script using fs.watch if available

@natnat-mc
Copy link
Owner Author

  • wRMymnd seems like a decent mask for inotifyd, and it can also just write to stdout.
    • Will require a popen implementation for _cmd that supports killing the spawned process, which is nontrivial for the posix backend and complicated for the lua backend.
  • Plain inotify module seems easier to deal with if it's available.
  • Inlining a nodejs script is probably even worse so let's say I won't do this.
  • sleep-based approaches could actually work, but not with fs cache enabled.
  • Anything that touches inotify will probably need to re-run the buildfile and regenerate the depgraph if any file is created/deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant