From 31818b9e4cf3279cd776017fc85454dc87dcbb49 Mon Sep 17 00:00:00 2001 From: flupkede Date: Tue, 15 Sep 2026 19:55:39 +0200 Subject: [PATCH] =?UTF-8?q?[worker]=20fase=20D6:=20notify=206.1=E2=86=928.?= =?UTF-8?q?2=20+=20notify-debouncer-full=200.3=E2=86=920.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debouncer absorbed Watcher (debouncer.watch()/unwatch()); root cache tracking is automatic (cache().add_root() removed). mio 0.8.11 fully out of the lock (inotify 0.9→0.11 on Linux; Windows path never used it). Validation: fmt + clippy -D warnings + 1386 tests green. --- CHANGELOG.md | 2 ++ Cargo.lock | 61 ++++++++++++++++++------------------------------ Cargo.toml | 4 ++-- src/watch/mod.rs | 17 +++++--------- 4 files changed, 33 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87239e1a..088bbe5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ finalized in place with a date — no renaming/migration step needed. - **thiserror 1.0 → 2.0 (direct).** Drop-in for all error enums (`#[error]`, `#[from]` unchanged); tantivy's chain still carries thiserror 1.x transitively until upstream moves. +- **File-watch stack majors: notify 6.1 → 8.2, notify-debouncer-full 0.3 → 0.7.** The debouncer absorbed `Watcher` into `Debouncer` itself (`debouncer.watch()/unwatch()` replace `.watcher().watch()`), and root cache tracking is now automatic, so the explicit `cache().add_root()` call goes away. The watcher's cache type now follows upstream's per-platform recommendation (`RecommendedCache`: `FileIdMap` on Windows/macOS, `NoCache` on Linux — file-ID tracking is an internal rename-detection optimization; event mapping never reads file IDs directly). Also removes `mio 0.8.11` from the lock entirely (it rode the Linux-only inotify 0.9 path; notify 8 uses inotify 0.11). + ## [1.3.19] ### Changed diff --git a/Cargo.lock b/Cargo.lock index d8257fce..7ba2bfb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1097,7 +1097,7 @@ dependencies = [ "crossterm_winapi", "derive_more", "document-features", - "mio 1.2.3", + "mio", "parking_lot", "rustix", "signal-hook", @@ -1680,16 +1680,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "filetime" -version = "0.2.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" -dependencies = [ - "cfg-if", - "libc", -] - [[package]] name = "find-msvc-tools" version = "0.1.12" @@ -2562,11 +2552,11 @@ dependencies = [ [[package]] name = "inotify" -version = "0.9.6" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "4cc00ea907cab49550b7da656f80ebb97be1b997d931fbcd28d39734e17ce592" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.2", "inotify-sys", "libc", ] @@ -3088,18 +3078,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.2.3" @@ -3305,37 +3283,44 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "notify" -version = "6.1.1" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ "bitflags 2.13.2", - "crossbeam-channel", - "filetime", "fsevent-sys", "inotify", "kqueue", "libc", "log", - "mio 0.8.11", + "mio", + "notify-types", "walkdir", - "windows-sys 0.48.0", + "windows-sys 0.60.2", ] [[package]] name = "notify-debouncer-full" -version = "0.3.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fd166739789c9ff169e654dc1501373db9d80a4c3f972817c8a4d7cf8f34e" +checksum = "c02b49179cfebc9932238d04d6079912d26de0379328872846118a0fa0dbb302" dependencies = [ - "crossbeam-channel", "file-id", "log", "notify", - "parking_lot", + "notify-types", "walkdir", ] +[[package]] +name = "notify-types" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" +dependencies = [ + "bitflags 2.13.2", +] + [[package]] name = "ntapi" version = "0.4.3" @@ -5097,7 +5082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" dependencies = [ "libc", - "mio 1.2.3", + "mio", "signal-hook", ] @@ -5784,7 +5769,7 @@ checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" dependencies = [ "bytes", "libc", - "mio 1.2.3", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", diff --git a/Cargo.toml b/Cargo.toml index 115249aa..469f1201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,8 +58,8 @@ tree-sitter-proto = "0.4.0" # File handling ignore = "0.4" -notify = { version = "6.1", default-features = false, features = ["macos_fsevent"] } -notify-debouncer-full = "0.3" +notify = { version = "8.2", default-features = false, features = ["macos_fsevent"] } +notify-debouncer-full = "0.7" walkdir = "2.5" fs2 = "0.4" # Cross-platform file locking diff --git a/src/watch/mod.rs b/src/watch/mod.rs index 92abbcfa..42ddf268 100644 --- a/src/watch/mod.rs +++ b/src/watch/mod.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Result}; use ignore::gitignore::{Gitignore, GitignoreBuilder}; -use notify::{RecommendedWatcher, RecursiveMode, Watcher}; -use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, FileIdMap}; +use notify::{RecommendedWatcher, RecursiveMode}; +use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, RecommendedCache}; use std::collections::HashSet; use std::path::{Path, PathBuf}; use std::process::Command; @@ -67,7 +67,7 @@ pub enum FileEvent { /// 3. Batched events for efficient processing pub struct FileWatcher { root: PathBuf, - debouncer: Option>, + debouncer: Option>, receiver: Option>, /// Compiled .gitignore matcher for the repo root (None if no .gitignore found). gitignore: Option, @@ -195,17 +195,12 @@ impl FileWatcher { self.receiver = Some(rx); self.debouncer = Some(debouncer); - // Start watching the root directory + // Start watching the root directory (Debouncer implements Watcher directly + // since notify-debouncer-full 0.7 and tracks file-ID cache roots itself) if let Some(ref mut debouncer) = self.debouncer { debouncer - .watcher() .watch(&self.root, RecursiveMode::Recursive) .map_err(|e| anyhow!("Failed to watch directory: {}", e))?; - - // Also watch with the cache (for file ID tracking) - debouncer - .cache() - .add_root(&self.root, RecursiveMode::Recursive); } Ok(()) @@ -219,7 +214,7 @@ impl FileWatcher { /// Stop watching pub fn stop(&mut self) { if let Some(ref mut debouncer) = self.debouncer { - let _ = debouncer.watcher().unwatch(&self.root); + let _ = debouncer.unwatch(&self.root); } self.debouncer = None; self.receiver = None;