-
Notifications
You must be signed in to change notification settings - Fork 29
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
File watcher recognizes only first file change #517
Comments
hey! i can't reproduce this, here's my command log output: log outputlu@koishi weird-oranda-test > oranda dev
↪ >o_o< INFO: Found 3 paths to watch, starting watch...
↪ >o_o< DEBUG: Files watched: ["/Users/lu/Projects/Checkouts/weird-oranda-test/README.md", "./oranda.json", "/Users/lu/Projects/Checkouts/weird-oranda-test/Cargo.toml"]
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`.
✓ >o_o< SUCCESS: Your project is available at: http://127.0.0.1:7979
↪ >o_o< INFO: Path(s) ["/Users/lu/Projects/Checkouts/weird-oranda-test/oranda.json"] changed, rebuilding...
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`.
↪ >o_o< INFO: Path(s) ["/Users/lu/Projects/Checkouts/weird-oranda-test/oranda.json"] changed, rebuilding...
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`.
↪ >o_o< INFO: Path(s) ["/Users/lu/Projects/Checkouts/weird-oranda-test/README.md"] changed, rebuilding...
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`.
↪ >o_o< INFO: Path(s) ["/Users/lu/Projects/Checkouts/weird-oranda-test/README.md"] changed, rebuilding...
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`.
↪ >o_o< INFO: Path(s) ["/Users/lu/Projects/Checkouts/weird-oranda-test/README.md"] changed, rebuilding...
↪ >o_o< INFO: Running build...
↪ >o_o< INFO: Building components: artifacts
✓ >o_o< SUCCESS: Your site build is located in `public`. maybe you're running into some file-descriptor-related trouble? we use notify under the hood, maybe you can try seeing if you run into the same kinds of issues using something like |
I tried it again and this time changing I don't usually use cargo-watch and don't have it at the ready, so testing that will have to wait for another day. One bit that (according to prior experience) could be important: I have taken the binary from the tarball download, but not precompiled itself. Maybe the issue only appears with that pre-built binary. |
there shouldn't be a difference between those two versions. can you paste your log output (specifically the "Files watched" line)? |
For the record: In the case I remember, the binary in question was built on a CI with a different version of some (system) library than expected and that resulted in a bug. If I find the time I might build oranda from source myself and see how the resulting binary behaves. Here is the log:
|
In any case, this sounds more like something related to the library we use for file watching (https://github.com/notify-rs/notify), so maybe it's worth filing a bug there? All we do on oranda's side is listen to events from that library, so it shouldn't really happen according to our usage. |
It could be related to the way vim writes backups; see notify-rs/notify#394. A recommendation there is to watch the whole directory. The way the library is used is still in the scope of this project. |
Stumbled on this issue... I recently dealt with what I imagine is this same issue in another program. The gist is that some editors may rename/remove files on save which can bork watching depending on how you handle it. I haven't dug into how This is documented in the notify crate (although this seems to be a common issue to run into still. It feels like switching to the "new" file on rename/removal is the common desired case) https://docs.rs/notify/latest/notify/event/enum.EventKind.html#variant.Remove
|
Using
oranda dev
(version 0.1.0) inside of a Rust project path only seems to detect the first change to a file, but not subsequent changes.How I can reproduce it:
README.md
andoranda.json
exist in the same path.orange dev
.oranda.json
(to a different theme). Project gets rebuild.oranda.json
again. Project is not rebuild, no new command output.README.md
. Project gets rebuild.README.md
again. Project is not rebuild, no new command output.The text was updated successfully, but these errors were encountered: