From ade3b7540c0b61df94a08da2612416b72b2be8a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:42:17 +0000 Subject: [PATCH 1/2] build(deps): bump notify from 5.0.0-pre.15 to 5.0.0-pre.16 Bumps [notify](https://github.com/notify-rs/notify) from 5.0.0-pre.15 to 5.0.0-pre.16. - [Release notes](https://github.com/notify-rs/notify/releases) - [Changelog](https://github.com/notify-rs/notify/blob/main/CHANGELOG.md) - [Commits](https://github.com/notify-rs/notify/compare/5.0.0-pre.15...notify-5.0.0-pre.16) --- updated-dependencies: - dependency-name: notify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- src/uu/tail/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fb493ad7..fb4759638 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1201,9 +1201,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.15" +version = "5.0.0-pre.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7" +checksum = "530f6314d6904508082f4ea424a0275cf62d341e118b313663f266429cb19693" dependencies = [ "bitflags", "crossbeam-channel", diff --git a/src/uu/tail/Cargo.toml b/src/uu/tail/Cargo.toml index 05791cda3..269bb490d 100644 --- a/src/uu/tail/Cargo.toml +++ b/src/uu/tail/Cargo.toml @@ -18,7 +18,7 @@ path = "src/tail.rs" [dependencies] clap = { version = "3.2", features = ["wrap_help", "cargo"] } libc = "0.2.126" -notify = { version = "=5.0.0-pre.15", features=["macos_kqueue"]} +notify = { version = "=5.0.0-pre.16", features=["macos_kqueue"]} uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer", "lines"] } [target.'cfg(windows)'.dependencies] From 0e96cfa14b882b38f41eb1b6e75914a2a967e0e8 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Mon, 15 Aug 2022 18:11:46 +0300 Subject: [PATCH 2/2] tail: fix notify usage for new version --- src/uu/tail/src/tail.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index bc02fe41f..486a7c127 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -853,21 +853,20 @@ fn start_watcher_thread(settings: &mut Settings) -> Result; - let watcher_config = notify::poll::PollWatcherConfig { - poll_interval: settings.sleep_sec, + let watcher_config = notify::Config::default() + .with_poll_interval(settings.sleep_sec) /* NOTE: By enabling compare_contents, performance will be significantly impacted as all files will need to be read and hashed at each `poll_interval`. However, this is necessary to pass: "gnu/tests/tail-2/F-vs-rename.sh" */ - compare_contents: true, - }; + .with_compare_contents(true); if settings.use_polling || RecommendedWatcher::kind() == WatcherKind::PollWatcher { settings.use_polling = true; // We have to use polling because there's no supported backend - watcher = Box::new(notify::PollWatcher::with_config(tx, watcher_config).unwrap()); + watcher = Box::new(notify::PollWatcher::new(tx, watcher_config).unwrap()); } else { let tx_clone = tx.clone(); - match notify::RecommendedWatcher::new(tx) { + match notify::RecommendedWatcher::new(tx, notify::Config::default()) { Ok(w) => watcher = Box::new(w), Err(e) if e.to_string().starts_with("Too many open files") => { /* @@ -882,8 +881,7 @@ fn start_watcher_thread(settings: &mut Settings) -> Result return Err(USimpleError::new(1, e.to_string())), };