9934: Revert "Downgrade notify and use RecommendedWatcher" r=lnicola a=xanderio

This reverts commit 5b0c86af7d.

The pre-5.0.12 release of notify fixed this issue.

`@lnicola` Could you verify that this now works on NetBSD?

Co-authored-by: Alexander Sieg <alex@xanderio.de>
Co-authored-by: Alexander Sieg <6298052+xanderio@users.noreply.github.com>
This commit is contained in:
bors[bot] 2021-08-17 15:49:02 +00:00 committed by GitHub
commit 75f2a5b185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 8 deletions

25
Cargo.lock generated
View file

@ -765,6 +765,26 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b23360e99b8717f20aaa4598f5a6541efbe30630039fbc7706cf954a87947ae" checksum = "8b23360e99b8717f20aaa4598f5a6541efbe30630039fbc7706cf954a87947ae"
[[package]]
name = "kqueue"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "058a107a784f8be94c7d35c1300f4facced2e93d2fbe5b1452b44e905ddca4a9"
dependencies = [
"kqueue-sys",
"libc",
]
[[package]]
name = "kqueue-sys"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587"
dependencies = [
"bitflags",
"libc",
]
[[package]] [[package]]
name = "la-arena" name = "la-arena"
version = "0.2.1" version = "0.2.1"
@ -945,15 +965,16 @@ dependencies = [
[[package]] [[package]]
name = "notify" name = "notify"
version = "5.0.0-pre.10" version = "5.0.0-pre.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51f18203a26893ca1d3526cf58084025d5639f91c44f8b70ab3b724f60e819a0" checksum = "20a629259bb2c87a884bb76f6086c8637919de6d074754341c12e5dd3aed6326"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crossbeam-channel", "crossbeam-channel",
"filetime", "filetime",
"fsevent-sys", "fsevent-sys",
"inotify", "inotify",
"kqueue",
"libc", "libc",
"mio", "mio",
"walkdir", "walkdir",

View file

@ -14,7 +14,7 @@ rustc-hash = "1.0"
jod-thread = "0.1.0" jod-thread = "0.1.0"
walkdir = "2.3.1" walkdir = "2.3.1"
crossbeam-channel = "0.5.0" crossbeam-channel = "0.5.0"
notify = "=5.0.0-pre.10" # check that it builds on NetBSD before upgrading notify = "=5.0.0-pre.12"
vfs = { path = "../vfs", version = "0.0.0" } vfs = { path = "../vfs", version = "0.0.0" }
paths = { path = "../paths", version = "0.0.0" } paths = { path = "../paths", version = "0.0.0" }

View file

@ -83,8 +83,7 @@ impl NotifyActor {
self.watcher = None; self.watcher = None;
if !config.watch.is_empty() { if !config.watch.is_empty() {
let (watcher_sender, watcher_receiver) = unbounded(); let (watcher_sender, watcher_receiver) = unbounded();
let watcher = let watcher = log_notify_error(RecommendedWatcher::new(move |event| {
log_notify_error(RecommendedWatcher::new_immediate(move |event| {
watcher_sender.send(event).unwrap() watcher_sender.send(event).unwrap()
})); }));
self.watcher = watcher.map(|it| (it, watcher_receiver)); self.watcher = watcher.map(|it| (it, watcher_receiver));
@ -215,7 +214,7 @@ impl NotifyActor {
fn watch(&mut self, path: AbsPathBuf) { fn watch(&mut self, path: AbsPathBuf) {
if let Some((watcher, _)) = &mut self.watcher { 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) { fn send(&mut self, msg: loader::Message) {