From ca6a1d8c632995e258c75ba21ce454705f1bfde6 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Tue, 17 Aug 2021 17:17:02 +0200 Subject: [PATCH] Revert "Downgrade notify and use RecommendedWatcher" This reverts commit 5b0c86af7d1683983a35f232baa7c98cfa3c382d. The pre-5.0.12 release of notify fixed this issue. --- Cargo.lock | 25 +++++++++++++++++++++++-- crates/vfs-notify/Cargo.toml | 2 +- crates/vfs-notify/src/lib.rs | 9 ++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7d0832bb3..6444050633 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -765,6 +765,26 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b23360e99b8717f20aaa4598f5a6541efbe30630039fbc7706cf954a87947ae" +[[package]] +name = "kqueue" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512705bfcaeb3d46379771adc69deab978355fc68fdf960f9fb11abc8d678a96" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9803ae382091c10a5c7297ffb9fde284dbc9662b249f86eacef605d97ae92d99" +dependencies = [ + "bitflags", + "libc", +] + [[package]] name = "la-arena" version = "0.2.1" @@ -945,15 +965,16 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.10" +version = "5.0.0-pre.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f18203a26893ca1d3526cf58084025d5639f91c44f8b70ab3b724f60e819a0" +checksum = "c614e7ed2b1cf82ec99aeffd8cf6225ef5021b9951148eb161393c394855032c" dependencies = [ "bitflags", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", + "kqueue", "libc", "mio", "walkdir", diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index 42200278da..0233c6da28 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml @@ -14,7 +14,7 @@ rustc-hash = "1.0" jod-thread = "0.1.0" walkdir = "2.3.1" crossbeam-channel = "0.5.0" -notify = "=5.0.0-pre.10" # check that it builds on NetBSD before upgrading +notify = "=5.0.0-pre.11" vfs = { path = "../vfs", version = "0.0.0" } paths = { path = "../paths", version = "0.0.0" } diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index a28cb7a330..960d988a4c 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs @@ -83,10 +83,9 @@ impl NotifyActor { self.watcher = None; if !config.watch.is_empty() { let (watcher_sender, watcher_receiver) = unbounded(); - let watcher = - log_notify_error(RecommendedWatcher::new_immediate(move |event| { - watcher_sender.send(event).unwrap() - })); + let watcher = log_notify_error(RecommendedWatcher::new(move |event| { + watcher_sender.send(event).unwrap() + })); self.watcher = watcher.map(|it| (it, watcher_receiver)); } @@ -215,7 +214,7 @@ impl NotifyActor { fn watch(&mut self, path: AbsPathBuf) { if let Some((watcher, _)) = &mut self.watcher { - log_notify_error(watcher.watch(&path, RecursiveMode::NonRecursive)); + log_notify_error(watcher.watch(path.as_ref(), RecursiveMode::NonRecursive)); } } fn send(&mut self, msg: loader::Message) {