From e7e397a6282a190835bcab502cf32202807b4bed Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 27 Apr 2024 10:13:51 +0200 Subject: [PATCH 1/9] fix(build.ninja): make Cargo.nix indirect input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit that way it’s not passed as $in to the build rule, which broke the nix invocation. --- build.ninja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ninja b/build.ninja index 46104128..0ff259f1 100644 --- a/build.ninja +++ b/build.ninja @@ -19,7 +19,7 @@ build run-ci-checks : run-ci-checks ./shell.nix rule build-ci-files command = eval $$(nix-build $in -A writeConfig) -build .github/workflows/ci.yml : build-ci-files ./.github/workflows/ci.nix ./Cargo.nix +build .github/workflows/ci.yml : build-ci-files ./.github/workflows/ci.nix | ./Cargo.nix # update Cargo.nix from Cargo.toml rule update-cargo-nix From 22ca1b4577fdfb0da5ffd5de85d94edf07bc2c08 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 27 Apr 2024 10:57:41 +0200 Subject: [PATCH 2/9] chore(Cargo.toml): Update crossbeam_channel and notify crossbeam_channel should work as before, there were no functional changes. inotify is a major version, so it changes watching behaviour by a bit, making some of the tests fail. --- Cargo.lock | 355 ++++++---------- Cargo.nix | 1104 +++++++++++++++++++++++++------------------------- Cargo.toml | 4 +- src/watch.rs | 5 +- 4 files changed, 690 insertions(+), 778 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6f3b027..424fcec4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -41,12 +41,6 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -[[package]] -name = "anymap" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" - [[package]] name = "atomicwrites" version = "0.2.5" @@ -55,7 +49,7 @@ checksum = "6a2baf2feb820299c53c7ad1cc4f5914a220a1cb76d7ce321d2522a94b54651f" dependencies = [ "nix 0.14.1", "tempdir", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -66,7 +60,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi 0.1.19", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -141,16 +135,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "chashmap" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" -dependencies = [ - "owning_ref", - "parking_lot", -] - [[package]] name = "clap" version = "2.34.0" @@ -167,22 +151,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.3.9" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.6.6" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -dependencies = [ - "cfg-if 0.1.10", - "lazy_static", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "ctrlc" @@ -191,7 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" dependencies = [ "nix 0.28.0", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -230,7 +210,7 @@ checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -241,7 +221,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -251,7 +231,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -278,24 +258,14 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys", -] - -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags 1.2.1", - "fsevent-sys", + "windows-sys 0.52.0", ] [[package]] name = "fsevent-sys" -version = "2.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] @@ -306,22 +276,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags 1.2.1", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "getrandom" version = "0.1.16" @@ -388,9 +342,9 @@ dependencies = [ [[package]] name = "inotify" -version = "0.7.1" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ "bitflags 1.2.1", "inotify-sys", @@ -415,15 +369,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "is-terminal" version = "0.4.12" @@ -432,7 +377,7 @@ checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi 0.3.9", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -442,26 +387,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "kqueue" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "kqueue-sys", + "libc", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "kqueue-sys" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.2.1", + "libc", +] [[package]] -name = "lazycell" -version = "1.3.0" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" @@ -520,12 +469,6 @@ dependencies = [ "vec1", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "md5" version = "0.7.0" @@ -558,56 +501,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", ] [[package]] @@ -650,24 +551,21 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.1" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d742ae493f34bd2e20ec2f3c1276fc1981343a8efd7ef12bca4368d0303bed50" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "anymap", - "bitflags 1.2.1", - "chashmap", + "bitflags 2.5.0", "crossbeam-channel", "filetime", - "fsevent", "fsevent-sys", "inotify", - "kernel32-sys", + "kqueue", "libc", + "log", "mio", - "mio-extras", "walkdir", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -709,37 +607,6 @@ dependencies = [ "regex", ] -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "parking_lot" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -dependencies = [ - "owning_ref", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -dependencies = [ - "libc", - "rand 0.4.6", - "smallvec", - "winapi 0.3.9", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -821,7 +688,7 @@ dependencies = [ "libc", "rand_core 0.3.1", "rdrand", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -959,7 +826,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -978,7 +845,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1033,15 +900,6 @@ dependencies = [ "serde", ] -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - [[package]] name = "slog" version = "2.7.0" @@ -1061,21 +919,6 @@ dependencies = [ "time", ] -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "strsim" version = "0.8.0" @@ -1145,7 +988,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand 2.0.2", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1156,7 +999,7 @@ checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" dependencies = [ "dirs-next", "rustversion", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1305,12 +1148,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -1321,12 +1158,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -1339,7 +1170,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1348,13 +1179,37 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1363,45 +1218,81 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.4" @@ -1410,16 +1301,12 @@ checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows_x86_64_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" diff --git a/Cargo.nix b/Cargo.nix index 50a922ca..a76c3815 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -165,7 +165,7 @@ rec { dependencies = [ { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: ("windows" == target."os"); features = [ "consoleapi" "errhandlingapi" "fileapi" "handleapi" "processenv" ]; } @@ -189,17 +189,6 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "anymap" = rec { - crateName = "anymap"; - version = "0.12.1"; - edition = "2015"; - sha256 = "0i23vv38i22aazp5z2hz0a44b943b6w5121kwwnpq1brpm1l559k"; - authors = [ - "Chris Morgan " - ]; - features = { - }; - }; "atomicwrites" = rec { crateName = "atomicwrites"; version = "0.2.5"; @@ -220,7 +209,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "winbase" ]; } @@ -249,7 +238,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "consoleapi" "processenv" "minwinbase" "minwindef" "winbase" ]; } @@ -441,26 +430,6 @@ rec { "Zicklag " ]; - }; - "chashmap" = rec { - crateName = "chashmap"; - version = "2.2.2"; - edition = "2015"; - sha256 = "0igsvpc2ajd6w68w4dwn0fln6yww8gq4pq9x02wj36g3q71a6hgz"; - authors = [ - "ticki " - ]; - dependencies = [ - { - name = "owning_ref"; - packageId = "owning_ref"; - } - { - name = "parking_lot"; - packageId = "parking_lot"; - } - ]; - }; "clap" = rec { crateName = "clap"; @@ -519,45 +488,32 @@ rec { }; "crossbeam-channel" = rec { crateName = "crossbeam-channel"; - version = "0.3.9"; - edition = "2015"; - sha256 = "1ylyzb1m9qbvd1nd3vy38x9073wdmcy295ncjs7wf7ap476pzv68"; - authors = [ - "The Crossbeam Project Developers" - ]; + version = "0.5.12"; + edition = "2021"; + sha256 = "159gp30clv2ci3r473659ii04pjznspb3g9gwkhj2lavkhmb0gdb"; dependencies = [ { name = "crossbeam-utils"; packageId = "crossbeam-utils"; + usesDefaultFeatures = false; } ]; - + features = { + "default" = [ "std" ]; + "std" = [ "crossbeam-utils/std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; }; "crossbeam-utils" = rec { crateName = "crossbeam-utils"; - version = "0.6.6"; - edition = "2015"; - sha256 = "1rk0r9n04bmq4a3g2q5qhvvlmrmx780gc6h9lmc94mwndslkz5q4"; - authors = [ - "The Crossbeam Project Developers" - ]; - dependencies = [ - { - name = "cfg-if"; - packageId = "cfg-if 0.1.10"; - } - { - name = "lazy_static"; - packageId = "lazy_static"; - optional = true; - } - ]; + version = "0.8.19"; + edition = "2021"; + sha256 = "0iakrb1b8fjqrag7wphl94d10irhbh2fw1g444xslsywqyn3p3i4"; features = { "default" = [ "std" ]; - "lazy_static" = [ "dep:lazy_static" ]; - "std" = [ "lazy_static" ]; + "loom" = [ "dep:loom" ]; }; - resolvedDefaultFeatures = [ "default" "lazy_static" "std" ]; + resolvedDefaultFeatures = [ "std" ]; }; "ctrlc" = rec { crateName = "ctrlc"; @@ -577,7 +533,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_System_Threading" "Win32_Security" "Win32_System_Console" ]; } @@ -585,7 +541,7 @@ rec { devDependencies = [ { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = {target, features}: (target."windows" or false); features = [ "Win32_Storage_FileSystem" "Win32_Foundation" "Win32_System_IO" "Win32_System_Console" ]; } @@ -679,7 +635,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "knownfolders" "objbase" "shlobj" "winbase" "winerror" ]; } @@ -708,7 +664,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "knownfolders" "objbase" "shlobj" "winbase" "winerror" ]; } @@ -744,7 +700,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_System_Diagnostics_Debug" ]; } @@ -821,38 +777,18 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_Storage_FileSystem" ]; } ]; - }; - "fsevent" = rec { - crateName = "fsevent"; - version = "0.4.0"; - edition = "2015"; - sha256 = "1djxnc2fmv265xqf1iyfz56smh13v9r1p0w9125wjg6k3fyx3dss"; - authors = [ - "Pierre Baillet " - ]; - dependencies = [ - { - name = "bitflags"; - packageId = "bitflags 1.2.1"; - } - { - name = "fsevent-sys"; - packageId = "fsevent-sys"; - } - ]; - }; "fsevent-sys" = rec { crateName = "fsevent-sys"; - version = "2.0.1"; - edition = "2015"; - sha256 = "18246vxk7rqn52m0sfrhivxq802i34p2wqqx5zsa0pamjj5086zl"; + version = "4.1.0"; + edition = "2018"; + sha256 = "1liz67v8b0gcs8r31vxkvm2jzgl9p14i78yfqx81c8sdv817mvkn"; authors = [ "Pierre Baillet " ]; @@ -873,36 +809,6 @@ rec { "Erick Tryzelaar " ]; - }; - "fuchsia-zircon" = rec { - crateName = "fuchsia-zircon"; - version = "0.3.3"; - edition = "2015"; - sha256 = "10jxc5ks1x06gpd0xg51kcjrxr35nj6qhx2zlc5n7bmskv3675rf"; - authors = [ - "Raph Levien " - ]; - dependencies = [ - { - name = "bitflags"; - packageId = "bitflags 1.2.1"; - } - { - name = "fuchsia-zircon-sys"; - packageId = "fuchsia-zircon-sys"; - } - ]; - - }; - "fuchsia-zircon-sys" = rec { - crateName = "fuchsia-zircon-sys"; - version = "0.3.3"; - edition = "2015"; - sha256 = "19zp2085qsyq2bh1gvcxq1lb8w6v6jj9kbdkhpdjrl95fypakjix"; - authors = [ - "Raph Levien " - ]; - }; "getrandom 0.1.16" = rec { crateName = "getrandom"; @@ -1096,9 +1002,9 @@ rec { }; "inotify" = rec { crateName = "inotify"; - version = "0.7.1"; - edition = "2015"; - sha256 = "0byhq4x4b2rlbkmfrab5dni39wiq2ls1hv1nhggp7rla5inwc5j8"; + version = "0.9.6"; + edition = "2018"; + sha256 = "1zxb04c4qccp8wnr3v04l503qpxzxzzzph61amlqbsslq4z9s1pq"; authors = [ "Hanno Braun " "Félix Saparelli " @@ -1121,12 +1027,9 @@ rec { ]; features = { "default" = [ "stream" ]; - "futures" = [ "dep:futures" ]; - "mio" = [ "dep:mio" ]; - "stream" = [ "futures" "mio" "tokio" "tokio-io" "tokio-reactor" ]; + "futures-core" = [ "dep:futures-core" ]; + "stream" = [ "futures-core" "tokio" ]; "tokio" = [ "dep:tokio" ]; - "tokio-io" = [ "dep:tokio-io" ]; - "tokio-reactor" = [ "dep:tokio-reactor" ]; }; }; "inotify-sys" = rec { @@ -1167,23 +1070,6 @@ rec { "web-sys" = [ "dep:web-sys" ]; }; }; - "iovec" = rec { - crateName = "iovec"; - version = "0.1.4"; - edition = "2015"; - sha256 = "0ph73qygwx8i0mblrf110cj59l00gkmsgrpzz1rm85syz5pymcxj"; - authors = [ - "Carl Lerche " - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - target = { target, features }: (target."unix" or false); - } - ]; - - }; "is-terminal" = rec { crateName = "is-terminal"; version = "0.4.12"; @@ -1206,7 +1092,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_Storage_FileSystem" "Win32_System_Console" ]; } @@ -1232,25 +1118,43 @@ rec { "no-panic" = [ "dep:no-panic" ]; }; }; - "kernel32-sys" = rec { - crateName = "kernel32-sys"; - version = "0.2.2"; - edition = "2015"; - sha256 = "1389av0601a9yz8dvx5zha9vmkd6ik7ax0idpb032d28555n41vm"; - libName = "kernel32"; + "kqueue" = rec { + crateName = "kqueue"; + version = "1.0.8"; + edition = "2018"; + sha256 = "033x2knkbv8d3jy6i9r32jcgsq6zm3g97zh5la43amkv3g5g2ivl"; authors = [ - "Peter Atashian " + "William Orr " ]; dependencies = [ { - name = "winapi"; - packageId = "winapi 0.2.8"; + name = "kqueue-sys"; + packageId = "kqueue-sys"; + } + { + name = "libc"; + packageId = "libc"; } ]; - buildDependencies = [ + + }; + "kqueue-sys" = rec { + crateName = "kqueue-sys"; + version = "1.0.4"; + edition = "2018"; + sha256 = "12w3wi90y4kwis4k9g6fp0kqjdmc6l00j16g8mgbhac7vbzjb5pd"; + authors = [ + "William Orr " + "Daniel (dmilith) Dettlaff " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags 1.2.1"; + } { - name = "winapi-build"; - packageId = "winapi-build"; + name = "libc"; + packageId = "libc"; } ]; @@ -1268,21 +1172,6 @@ rec { "spin_no_std" = [ "spin" ]; }; }; - "lazycell" = rec { - crateName = "lazycell"; - version = "1.3.0"; - edition = "2015"; - sha256 = "0m8gw7dn30i0zjjpjdyf6pc16c34nl71lpv461mix50x3p70h3c3"; - authors = [ - "Alex Crichton " - "Nikita Pekin " - ]; - features = { - "clippy" = [ "dep:clippy" ]; - "nightly-testing" = [ "clippy" "nightly" ]; - "serde" = [ "dep:serde" ]; - }; - }; "libc" = rec { crateName = "libc"; version = "0.2.153"; @@ -1486,17 +1375,6 @@ rec { } ]; - }; - "maybe-uninit" = rec { - crateName = "maybe-uninit"; - version = "2.0.0"; - edition = "2015"; - sha256 = "004y0nzmpfdrhz251278341z6ql34iv1k6dp1h6af7d6nd6jwc30"; - authors = [ - "est31 " - "The Rust Project Developers" - ]; - }; "md5" = rec { crateName = "md5"; @@ -1585,35 +1463,19 @@ rec { }; "mio" = rec { crateName = "mio"; - version = "0.6.23"; - edition = "2015"; - sha256 = "1i2c1vl8lr45apkh8xbh9k56ihfsmqff5l7s2fya7whvp7sndzaa"; + version = "0.8.11"; + edition = "2018"; + sha256 = "034byyl0ardml5yliy1hmvx8arkmn9rv479pid794sm07ia519m4"; authors = [ "Carl Lerche " + "Thomas de Zeeuw " + "Tokio Contributors " ]; dependencies = [ { - name = "cfg-if"; - packageId = "cfg-if 0.1.10"; - } - { - name = "fuchsia-zircon"; - packageId = "fuchsia-zircon"; - target = { target, features }: ("fuchsia" == target."os"); - } - { - name = "fuchsia-zircon-sys"; - packageId = "fuchsia-zircon-sys"; - target = { target, features }: ("fuchsia" == target."os"); - } - { - name = "iovec"; - packageId = "iovec"; - } - { - name = "kernel32-sys"; - packageId = "kernel32-sys"; - target = { target, features }: (target."windows" or false); + name = "libc"; + packageId = "libc"; + target = { target, features }: ("wasi" == target."os"); } { name = "libc"; @@ -1623,118 +1485,26 @@ rec { { name = "log"; packageId = "log"; + optional = true; } { - name = "miow"; - packageId = "miow"; - target = { target, features }: (target."windows" or false); - } - { - name = "net2"; - packageId = "net2"; - } - { - name = "slab"; - packageId = "slab"; - } - { - name = "winapi"; - packageId = "winapi 0.2.8"; - target = { target, features }: (target."windows" or false); - } - ]; - features = { - "default" = [ "with-deprecated" ]; - }; - resolvedDefaultFeatures = [ "default" "with-deprecated" ]; - }; - "mio-extras" = rec { - crateName = "mio-extras"; - version = "2.0.6"; - edition = "2018"; - sha256 = "069gfhlv0wlwfx1k2sriwfws490kjp490rv2qivyfb01j3i3yh2j"; - authors = [ - "Carl Lerche " - "David Hotham" - ]; - dependencies = [ - { - name = "lazycell"; - packageId = "lazycell"; - } - { - name = "log"; - packageId = "log"; - } - { - name = "mio"; - packageId = "mio"; - } - { - name = "slab"; - packageId = "slab"; - } - ]; - - }; - "miow" = rec { - crateName = "miow"; - version = "0.2.2"; - edition = "2015"; - sha256 = "0kcl8rnv0bhiarcdakik670w8fnxzlxhi1ys7152sck68510in7b"; - authors = [ - "Alex Crichton " - ]; - dependencies = [ - { - name = "kernel32-sys"; - packageId = "kernel32-sys"; - } - { - name = "net2"; - packageId = "net2"; - usesDefaultFeatures = false; - } - { - name = "winapi"; - packageId = "winapi 0.2.8"; - } - { - name = "ws2_32-sys"; - packageId = "ws2_32-sys"; - } - ]; - - }; - "net2" = rec { - crateName = "net2"; - version = "0.2.39"; - edition = "2015"; - sha256 = "1b1lxvs192xsvqnszcz7dn4dw3fsvzxnc23qvq39scx26s068fxi"; - authors = [ - "Alex Crichton " - ]; - dependencies = [ - { - name = "cfg-if"; - packageId = "cfg-if 0.1.10"; - } - { - name = "libc"; - packageId = "libc"; - target = { target, features }: ((target."unix" or false) || ("wasi" == target."os")); + name = "wasi"; + packageId = "wasi 0.11.0+wasi-snapshot-preview1"; + target = { target, features }: ("wasi" == target."os"); } { - name = "winapi"; - packageId = "winapi 0.3.9"; + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; target = { target, features }: (target."windows" or false); - features = [ "handleapi" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ]; + features = [ "Win32_Foundation" "Win32_Networking_WinSock" "Win32_Storage_FileSystem" "Win32_System_IO" "Win32_System_WindowsProgramming" ]; } ]; features = { - "default" = [ "duration" ]; + "default" = [ "log" ]; + "log" = [ "dep:log" ]; + "os-ext" = [ "os-poll" "windows-sys/Win32_System_Pipes" "windows-sys/Win32_Security" ]; }; - resolvedDefaultFeatures = [ "default" "duration" ]; + resolvedDefaultFeatures = [ "default" "log" "os-ext" "os-poll" ]; }; "nix 0.14.1" = rec { crateName = "nix"; @@ -1857,82 +1627,101 @@ rec { }; "notify" = rec { crateName = "notify"; - version = "5.0.0-pre.1"; - edition = "2018"; - sha256 = "0l7d7cqd0s23r8mz2zpxiqx3908rziv14g1gxhh2xg9l7x4swhnp"; + version = "6.1.1"; + edition = "2021"; + sha256 = "0bad98r0ilkhhq2jg3zs11zcqasgbvxia8224wpasm74n65vs1b2"; authors = [ "Félix Saparelli " "Daniel Faust " + "Aron Heinecke " ]; dependencies = [ - { - name = "anymap"; - packageId = "anymap"; - } { name = "bitflags"; - packageId = "bitflags 1.2.1"; - } - { - name = "chashmap"; - packageId = "chashmap"; + packageId = "bitflags 2.5.0"; + target = { target, features }: ("macos" == target."os"); } { name = "crossbeam-channel"; packageId = "crossbeam-channel"; + optional = true; } { name = "filetime"; packageId = "filetime"; } - { - name = "fsevent"; - packageId = "fsevent"; - target = { target, features }: ("macos" == target."os"); - } { name = "fsevent-sys"; packageId = "fsevent-sys"; + optional = true; target = { target, features }: ("macos" == target."os"); } { name = "inotify"; packageId = "inotify"; usesDefaultFeatures = false; - target = { target, features }: ("linux" == target."os"); + target = { target, features }: (("linux" == target."os") || ("android" == target."os")); } { - name = "kernel32-sys"; - packageId = "kernel32-sys"; - target = { target, features }: (target."windows" or false); + name = "kqueue"; + packageId = "kqueue"; + target = { target, features }: (("freebsd" == target."os") || ("openbsd" == target."os") || ("netbsd" == target."os") || ("dragonflybsd" == target."os")); + } + { + name = "kqueue"; + packageId = "kqueue"; + optional = true; + target = { target, features }: ("macos" == target."os"); } { name = "libc"; packageId = "libc"; } + { + name = "log"; + packageId = "log"; + } { name = "mio"; packageId = "mio"; - target = { target, features }: ("linux" == target."os"); + target = { target, features }: (("freebsd" == target."os") || ("openbsd" == target."os") || ("netbsd" == target."os") || ("dragonflybsd" == target."os")); + features = [ "os-ext" ]; } { - name = "mio-extras"; - packageId = "mio-extras"; - target = { target, features }: ("linux" == target."os"); + name = "mio"; + packageId = "mio"; + target = { target, features }: (("linux" == target."os") || ("android" == target."os")); + features = [ "os-ext" ]; } { - name = "walkdir"; + name = "mio"; + packageId = "mio"; + optional = true; + target = { target, features }: ("macos" == target."os"); + features = [ "os-ext" ]; + } + { + name = "walkdir"; packageId = "walkdir"; } { - name = "winapi"; - packageId = "winapi 0.3.9"; + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; target = { target, features }: (target."windows" or false); + features = [ "Win32_System_Threading" "Win32_Foundation" "Win32_Storage_FileSystem" "Win32_Security" "Win32_System_WindowsProgramming" "Win32_System_IO" ]; } ]; features = { + "crossbeam-channel" = [ "dep:crossbeam-channel" ]; + "default" = [ "macos_fsevent" "crossbeam-channel" ]; + "fsevent-sys" = [ "dep:fsevent-sys" ]; + "kqueue" = [ "dep:kqueue" ]; + "macos_fsevent" = [ "fsevent-sys" ]; + "macos_kqueue" = [ "kqueue" "mio" ]; + "mio" = [ "dep:mio" ]; "serde" = [ "dep:serde" ]; }; + resolvedDefaultFeatures = [ "crossbeam-channel" "default" "fsevent-sys" "macos_fsevent" ]; }; "num-conv" = rec { crateName = "num-conv"; @@ -2031,85 +1820,6 @@ rec { ]; }; - "owning_ref" = rec { - crateName = "owning_ref"; - version = "0.3.3"; - edition = "2015"; - sha256 = "0dqgf5hwbmvkf2ffbik5xmhvaqvqi6iklhwk9x47n0wycd0lzy6d"; - authors = [ - "Marvin Löbel " - ]; - dependencies = [ - { - name = "stable_deref_trait"; - packageId = "stable_deref_trait"; - } - ]; - - }; - "parking_lot" = rec { - crateName = "parking_lot"; - version = "0.4.8"; - edition = "2015"; - sha256 = "0ph0kv3dfcxpjbi83wkzammqb7lm95j8in7w7hz17hgkjxdqz78l"; - authors = [ - "Amanieu d'Antras " - ]; - dependencies = [ - { - name = "owning_ref"; - packageId = "owning_ref"; - optional = true; - } - { - name = "parking_lot_core"; - packageId = "parking_lot_core"; - } - ]; - features = { - "deadlock_detection" = [ "parking_lot_core/deadlock_detection" ]; - "default" = [ "owning_ref" ]; - "nightly" = [ "parking_lot_core/nightly" ]; - "owning_ref" = [ "dep:owning_ref" ]; - }; - resolvedDefaultFeatures = [ "default" "owning_ref" ]; - }; - "parking_lot_core" = rec { - crateName = "parking_lot_core"; - version = "0.2.14"; - edition = "2015"; - sha256 = "1yip8m6npxb87ilnn0q774psp1zd0vgv66fcjkkvr9rlyz6aicad"; - authors = [ - "Amanieu d'Antras " - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - target = { target, features }: (target."unix" or false); - } - { - name = "rand"; - packageId = "rand 0.4.6"; - } - { - name = "smallvec"; - packageId = "smallvec"; - } - { - name = "winapi"; - packageId = "winapi 0.3.9"; - target = { target, features }: (target."windows" or false); - features = [ "winnt" "ntstatus" "minwindef" "winerror" "winbase" "errhandlingapi" "handleapi" ]; - } - ]; - features = { - "backtrace" = [ "dep:backtrace" ]; - "deadlock_detection" = [ "petgraph" "thread-id" "backtrace" ]; - "petgraph" = [ "dep:petgraph" ]; - "thread-id" = [ "dep:thread-id" ]; - }; - }; "powerfmt" = rec { crateName = "powerfmt"; version = "0.2.0"; @@ -2333,7 +2043,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "minwindef" "ntsecapi" "profileapi" "winnt" ]; } @@ -2767,7 +2477,7 @@ rec { dependencies = [ { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "std" "errhandlingapi" "winerror" "fileapi" "winbase" ]; } @@ -2856,7 +2566,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Foundation" "Win32_Networking_WinSock" "Win32_NetworkManagement_IpHelper" "Win32_System_Threading" ]; } @@ -3046,26 +2756,6 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "slab" = rec { - crateName = "slab"; - version = "0.4.9"; - edition = "2018"; - sha256 = "0rxvsgir0qw5lkycrqgb1cxsvxzjv9bmx73bk5y42svnzfba94lg"; - authors = [ - "Carl Lerche " - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg"; - } - ]; - features = { - "default" = [ "std" ]; - "serde" = [ "dep:serde" ]; - }; - resolvedDefaultFeatures = [ "default" "std" ]; - }; "slog" = rec { crateName = "slog"; version = "2.7.0"; @@ -3120,41 +2810,6 @@ rec { "serde_json" = [ "dep:serde_json" ]; }; }; - "smallvec" = rec { - crateName = "smallvec"; - version = "0.6.14"; - edition = "2015"; - sha256 = "1q4hz0ssnv24s6fq5kfp2wzrrprrrjiwc42a0h7s7nwym3mwlzxr"; - libPath = "lib.rs"; - authors = [ - "Simon Sapin " - ]; - dependencies = [ - { - name = "maybe-uninit"; - packageId = "maybe-uninit"; - } - ]; - features = { - "default" = [ "std" ]; - "serde" = [ "dep:serde" ]; - }; - resolvedDefaultFeatures = [ "default" "std" ]; - }; - "stable_deref_trait" = rec { - crateName = "stable_deref_trait"; - version = "1.2.0"; - edition = "2015"; - sha256 = "1lxjr8q2n534b2lhkxd6l6wcddzjvnksi58zv11f9y0jjmr15wd8"; - authors = [ - "Robert Grosse " - ]; - features = { - "default" = [ "std" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ "alloc" "default" "std" ]; - }; "strsim" = rec { crateName = "strsim"; version = "0.8.0"; @@ -3345,7 +3000,7 @@ rec { } { name = "windows-sys"; - packageId = "windows-sys"; + packageId = "windows-sys 0.52.0"; target = { target, features }: (target."windows" or false); features = [ "Win32_Storage_FileSystem" "Win32_Foundation" ]; } @@ -3374,7 +3029,7 @@ rec { } { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "consoleapi" "wincon" "handleapi" "fileapi" ]; } @@ -3747,6 +3402,7 @@ rec { "rustc-dep-of-std" = [ "compiler_builtins" "core" "rustc-std-workspace-alloc" ]; "rustc-std-workspace-alloc" = [ "dep:rustc-std-workspace-alloc" ]; }; + resolvedDefaultFeatures = [ "default" "std" ]; }; "wasi 0.9.0+wasi-snapshot-preview1" = rec { crateName = "wasi"; @@ -3765,17 +3421,7 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "winapi 0.2.8" = rec { - crateName = "winapi"; - version = "0.2.8"; - edition = "2015"; - sha256 = "0yh816lh6lf56dpsgxy189c2ai1z3j8mw9si6izqb6wsjkbcjz8n"; - authors = [ - "Peter Atashian " - ]; - - }; - "winapi 0.3.9" = rec { + "winapi" = rec { crateName = "winapi"; version = "0.3.9"; edition = "2015"; @@ -3798,18 +3444,7 @@ rec { features = { "debug" = [ "impl-debug" ]; }; - resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "fileapi" "handleapi" "knownfolders" "minwinbase" "minwindef" "ntsecapi" "ntstatus" "objbase" "processenv" "profileapi" "shlobj" "std" "sysinfoapi" "winbase" "wincon" "winerror" "winnt" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ]; - }; - "winapi-build" = rec { - crateName = "winapi-build"; - version = "0.1.1"; - edition = "2015"; - sha256 = "1g4rqsgjky0a7530qajn2bbfcrl2v0zb39idgdws9b1l7gp5wc9d"; - libName = "build"; - authors = [ - "Peter Atashian " - ]; - + resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "fileapi" "handleapi" "knownfolders" "minwinbase" "minwindef" "ntsecapi" "objbase" "processenv" "profileapi" "shlobj" "std" "sysinfoapi" "winbase" "wincon" "winerror" "winnt" ]; }; "winapi-i686-pc-windows-gnu" = rec { crateName = "winapi-i686-pc-windows-gnu"; @@ -3832,7 +3467,7 @@ rec { dependencies = [ { name = "winapi"; - packageId = "winapi 0.3.9"; + packageId = "winapi"; target = { target, features }: (target."windows" or false); features = [ "std" "consoleapi" "errhandlingapi" "fileapi" "minwindef" "processenv" "sysinfoapi" "winbase" "wincon" "winerror" "winnt" ]; } @@ -3849,7 +3484,300 @@ rec { ]; }; - "windows-sys" = rec { + "windows-sys 0.48.0" = rec { + crateName = "windows-sys"; + version = "0.48.0"; + edition = "2018"; + sha256 = "1aan23v5gs7gya1lc46hqn9mdh8yph3fhxmhxlw36pn6pqc28zb7"; + authors = [ + "Microsoft" + ]; + dependencies = [ + { + name = "windows-targets"; + packageId = "windows-targets 0.48.5"; + } + ]; + features = { + "Wdk_System" = [ "Wdk" ]; + "Wdk_System_OfflineRegistry" = [ "Wdk_System" ]; + "Win32_Data" = [ "Win32" ]; + "Win32_Data_HtmlHelp" = [ "Win32_Data" ]; + "Win32_Data_RightsManagement" = [ "Win32_Data" ]; + "Win32_Data_Xml" = [ "Win32_Data" ]; + "Win32_Data_Xml_MsXml" = [ "Win32_Data_Xml" ]; + "Win32_Data_Xml_XmlLite" = [ "Win32_Data_Xml" ]; + "Win32_Devices" = [ "Win32" ]; + "Win32_Devices_AllJoyn" = [ "Win32_Devices" ]; + "Win32_Devices_BiometricFramework" = [ "Win32_Devices" ]; + "Win32_Devices_Bluetooth" = [ "Win32_Devices" ]; + "Win32_Devices_Communication" = [ "Win32_Devices" ]; + "Win32_Devices_DeviceAccess" = [ "Win32_Devices" ]; + "Win32_Devices_DeviceAndDriverInstallation" = [ "Win32_Devices" ]; + "Win32_Devices_DeviceQuery" = [ "Win32_Devices" ]; + "Win32_Devices_Display" = [ "Win32_Devices" ]; + "Win32_Devices_Enumeration" = [ "Win32_Devices" ]; + "Win32_Devices_Enumeration_Pnp" = [ "Win32_Devices_Enumeration" ]; + "Win32_Devices_Fax" = [ "Win32_Devices" ]; + "Win32_Devices_FunctionDiscovery" = [ "Win32_Devices" ]; + "Win32_Devices_Geolocation" = [ "Win32_Devices" ]; + "Win32_Devices_HumanInterfaceDevice" = [ "Win32_Devices" ]; + "Win32_Devices_ImageAcquisition" = [ "Win32_Devices" ]; + "Win32_Devices_PortableDevices" = [ "Win32_Devices" ]; + "Win32_Devices_Properties" = [ "Win32_Devices" ]; + "Win32_Devices_Pwm" = [ "Win32_Devices" ]; + "Win32_Devices_Sensors" = [ "Win32_Devices" ]; + "Win32_Devices_SerialCommunication" = [ "Win32_Devices" ]; + "Win32_Devices_Tapi" = [ "Win32_Devices" ]; + "Win32_Devices_Usb" = [ "Win32_Devices" ]; + "Win32_Devices_WebServicesOnDevices" = [ "Win32_Devices" ]; + "Win32_Foundation" = [ "Win32" ]; + "Win32_Gaming" = [ "Win32" ]; + "Win32_Globalization" = [ "Win32" ]; + "Win32_Graphics" = [ "Win32" ]; + "Win32_Graphics_Dwm" = [ "Win32_Graphics" ]; + "Win32_Graphics_Gdi" = [ "Win32_Graphics" ]; + "Win32_Graphics_Hlsl" = [ "Win32_Graphics" ]; + "Win32_Graphics_OpenGL" = [ "Win32_Graphics" ]; + "Win32_Graphics_Printing" = [ "Win32_Graphics" ]; + "Win32_Graphics_Printing_PrintTicket" = [ "Win32_Graphics_Printing" ]; + "Win32_Management" = [ "Win32" ]; + "Win32_Management_MobileDeviceManagementRegistration" = [ "Win32_Management" ]; + "Win32_Media" = [ "Win32" ]; + "Win32_Media_Audio" = [ "Win32_Media" ]; + "Win32_Media_Audio_Apo" = [ "Win32_Media_Audio" ]; + "Win32_Media_Audio_DirectMusic" = [ "Win32_Media_Audio" ]; + "Win32_Media_Audio_Endpoints" = [ "Win32_Media_Audio" ]; + "Win32_Media_Audio_XAudio2" = [ "Win32_Media_Audio" ]; + "Win32_Media_DeviceManager" = [ "Win32_Media" ]; + "Win32_Media_DxMediaObjects" = [ "Win32_Media" ]; + "Win32_Media_KernelStreaming" = [ "Win32_Media" ]; + "Win32_Media_LibrarySharingServices" = [ "Win32_Media" ]; + "Win32_Media_MediaPlayer" = [ "Win32_Media" ]; + "Win32_Media_Multimedia" = [ "Win32_Media" ]; + "Win32_Media_Speech" = [ "Win32_Media" ]; + "Win32_Media_Streaming" = [ "Win32_Media" ]; + "Win32_Media_WindowsMediaFormat" = [ "Win32_Media" ]; + "Win32_NetworkManagement" = [ "Win32" ]; + "Win32_NetworkManagement_Dhcp" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Dns" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_InternetConnectionWizard" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_IpHelper" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_MobileBroadband" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Multicast" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Ndis" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetBios" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetManagement" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetShell" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetworkDiagnosticsFramework" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_NetworkPolicyServer" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_P2P" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_QoS" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Rras" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_Snmp" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WNet" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WebDav" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WiFi" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsConnectNow" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsConnectionManager" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsFilteringPlatform" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsFirewall" = [ "Win32_NetworkManagement" ]; + "Win32_NetworkManagement_WindowsNetworkVirtualization" = [ "Win32_NetworkManagement" ]; + "Win32_Networking" = [ "Win32" ]; + "Win32_Networking_ActiveDirectory" = [ "Win32_Networking" ]; + "Win32_Networking_BackgroundIntelligentTransferService" = [ "Win32_Networking" ]; + "Win32_Networking_Clustering" = [ "Win32_Networking" ]; + "Win32_Networking_HttpServer" = [ "Win32_Networking" ]; + "Win32_Networking_Ldap" = [ "Win32_Networking" ]; + "Win32_Networking_NetworkListManager" = [ "Win32_Networking" ]; + "Win32_Networking_RemoteDifferentialCompression" = [ "Win32_Networking" ]; + "Win32_Networking_WebSocket" = [ "Win32_Networking" ]; + "Win32_Networking_WinHttp" = [ "Win32_Networking" ]; + "Win32_Networking_WinInet" = [ "Win32_Networking" ]; + "Win32_Networking_WinSock" = [ "Win32_Networking" ]; + "Win32_Networking_WindowsWebServices" = [ "Win32_Networking" ]; + "Win32_Security" = [ "Win32" ]; + "Win32_Security_AppLocker" = [ "Win32_Security" ]; + "Win32_Security_Authentication" = [ "Win32_Security" ]; + "Win32_Security_Authentication_Identity" = [ "Win32_Security_Authentication" ]; + "Win32_Security_Authentication_Identity_Provider" = [ "Win32_Security_Authentication_Identity" ]; + "Win32_Security_Authorization" = [ "Win32_Security" ]; + "Win32_Security_Authorization_UI" = [ "Win32_Security_Authorization" ]; + "Win32_Security_ConfigurationSnapin" = [ "Win32_Security" ]; + "Win32_Security_Credentials" = [ "Win32_Security" ]; + "Win32_Security_Cryptography" = [ "Win32_Security" ]; + "Win32_Security_Cryptography_Catalog" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_Certificates" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_Sip" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_Cryptography_UI" = [ "Win32_Security_Cryptography" ]; + "Win32_Security_DiagnosticDataQuery" = [ "Win32_Security" ]; + "Win32_Security_DirectoryServices" = [ "Win32_Security" ]; + "Win32_Security_EnterpriseData" = [ "Win32_Security" ]; + "Win32_Security_ExtensibleAuthenticationProtocol" = [ "Win32_Security" ]; + "Win32_Security_Isolation" = [ "Win32_Security" ]; + "Win32_Security_LicenseProtection" = [ "Win32_Security" ]; + "Win32_Security_NetworkAccessProtection" = [ "Win32_Security" ]; + "Win32_Security_Tpm" = [ "Win32_Security" ]; + "Win32_Security_WinTrust" = [ "Win32_Security" ]; + "Win32_Security_WinWlx" = [ "Win32_Security" ]; + "Win32_Storage" = [ "Win32" ]; + "Win32_Storage_Cabinets" = [ "Win32_Storage" ]; + "Win32_Storage_CloudFilters" = [ "Win32_Storage" ]; + "Win32_Storage_Compression" = [ "Win32_Storage" ]; + "Win32_Storage_DataDeduplication" = [ "Win32_Storage" ]; + "Win32_Storage_DistributedFileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_EnhancedStorage" = [ "Win32_Storage" ]; + "Win32_Storage_FileHistory" = [ "Win32_Storage" ]; + "Win32_Storage_FileServerResourceManager" = [ "Win32_Storage" ]; + "Win32_Storage_FileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_Imapi" = [ "Win32_Storage" ]; + "Win32_Storage_IndexServer" = [ "Win32_Storage" ]; + "Win32_Storage_InstallableFileSystems" = [ "Win32_Storage" ]; + "Win32_Storage_IscsiDisc" = [ "Win32_Storage" ]; + "Win32_Storage_Jet" = [ "Win32_Storage" ]; + "Win32_Storage_OfflineFiles" = [ "Win32_Storage" ]; + "Win32_Storage_OperationRecorder" = [ "Win32_Storage" ]; + "Win32_Storage_Packaging" = [ "Win32_Storage" ]; + "Win32_Storage_Packaging_Appx" = [ "Win32_Storage_Packaging" ]; + "Win32_Storage_Packaging_Opc" = [ "Win32_Storage_Packaging" ]; + "Win32_Storage_ProjectedFileSystem" = [ "Win32_Storage" ]; + "Win32_Storage_StructuredStorage" = [ "Win32_Storage" ]; + "Win32_Storage_Vhd" = [ "Win32_Storage" ]; + "Win32_Storage_VirtualDiskService" = [ "Win32_Storage" ]; + "Win32_Storage_Vss" = [ "Win32_Storage" ]; + "Win32_Storage_Xps" = [ "Win32_Storage" ]; + "Win32_Storage_Xps_Printing" = [ "Win32_Storage_Xps" ]; + "Win32_System" = [ "Win32" ]; + "Win32_System_AddressBook" = [ "Win32_System" ]; + "Win32_System_Antimalware" = [ "Win32_System" ]; + "Win32_System_ApplicationInstallationAndServicing" = [ "Win32_System" ]; + "Win32_System_ApplicationVerifier" = [ "Win32_System" ]; + "Win32_System_AssessmentTool" = [ "Win32_System" ]; + "Win32_System_ClrHosting" = [ "Win32_System" ]; + "Win32_System_Com" = [ "Win32_System" ]; + "Win32_System_Com_CallObj" = [ "Win32_System_Com" ]; + "Win32_System_Com_ChannelCredentials" = [ "Win32_System_Com" ]; + "Win32_System_Com_Events" = [ "Win32_System_Com" ]; + "Win32_System_Com_Marshal" = [ "Win32_System_Com" ]; + "Win32_System_Com_StructuredStorage" = [ "Win32_System_Com" ]; + "Win32_System_Com_UI" = [ "Win32_System_Com" ]; + "Win32_System_Com_Urlmon" = [ "Win32_System_Com" ]; + "Win32_System_ComponentServices" = [ "Win32_System" ]; + "Win32_System_Console" = [ "Win32_System" ]; + "Win32_System_Contacts" = [ "Win32_System" ]; + "Win32_System_CorrelationVector" = [ "Win32_System" ]; + "Win32_System_DataExchange" = [ "Win32_System" ]; + "Win32_System_DeploymentServices" = [ "Win32_System" ]; + "Win32_System_DesktopSharing" = [ "Win32_System" ]; + "Win32_System_DeveloperLicensing" = [ "Win32_System" ]; + "Win32_System_Diagnostics" = [ "Win32_System" ]; + "Win32_System_Diagnostics_Ceip" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_ClrProfiling" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_Debug" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_Debug_ActiveScript" = [ "Win32_System_Diagnostics_Debug" ]; + "Win32_System_Diagnostics_Debug_Extensions" = [ "Win32_System_Diagnostics_Debug" ]; + "Win32_System_Diagnostics_Etw" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_ProcessSnapshotting" = [ "Win32_System_Diagnostics" ]; + "Win32_System_Diagnostics_ToolHelp" = [ "Win32_System_Diagnostics" ]; + "Win32_System_DistributedTransactionCoordinator" = [ "Win32_System" ]; + "Win32_System_Environment" = [ "Win32_System" ]; + "Win32_System_ErrorReporting" = [ "Win32_System" ]; + "Win32_System_EventCollector" = [ "Win32_System" ]; + "Win32_System_EventLog" = [ "Win32_System" ]; + "Win32_System_EventNotificationService" = [ "Win32_System" ]; + "Win32_System_GroupPolicy" = [ "Win32_System" ]; + "Win32_System_HostCompute" = [ "Win32_System" ]; + "Win32_System_HostComputeNetwork" = [ "Win32_System" ]; + "Win32_System_HostComputeSystem" = [ "Win32_System" ]; + "Win32_System_Hypervisor" = [ "Win32_System" ]; + "Win32_System_IO" = [ "Win32_System" ]; + "Win32_System_Iis" = [ "Win32_System" ]; + "Win32_System_Ioctl" = [ "Win32_System" ]; + "Win32_System_JobObjects" = [ "Win32_System" ]; + "Win32_System_Js" = [ "Win32_System" ]; + "Win32_System_Kernel" = [ "Win32_System" ]; + "Win32_System_LibraryLoader" = [ "Win32_System" ]; + "Win32_System_Mailslots" = [ "Win32_System" ]; + "Win32_System_Mapi" = [ "Win32_System" ]; + "Win32_System_Memory" = [ "Win32_System" ]; + "Win32_System_Memory_NonVolatile" = [ "Win32_System_Memory" ]; + "Win32_System_MessageQueuing" = [ "Win32_System" ]; + "Win32_System_MixedReality" = [ "Win32_System" ]; + "Win32_System_Mmc" = [ "Win32_System" ]; + "Win32_System_Ole" = [ "Win32_System" ]; + "Win32_System_ParentalControls" = [ "Win32_System" ]; + "Win32_System_PasswordManagement" = [ "Win32_System" ]; + "Win32_System_Performance" = [ "Win32_System" ]; + "Win32_System_Performance_HardwareCounterProfiling" = [ "Win32_System_Performance" ]; + "Win32_System_Pipes" = [ "Win32_System" ]; + "Win32_System_Power" = [ "Win32_System" ]; + "Win32_System_ProcessStatus" = [ "Win32_System" ]; + "Win32_System_RealTimeCommunications" = [ "Win32_System" ]; + "Win32_System_Recovery" = [ "Win32_System" ]; + "Win32_System_Registry" = [ "Win32_System" ]; + "Win32_System_RemoteAssistance" = [ "Win32_System" ]; + "Win32_System_RemoteDesktop" = [ "Win32_System" ]; + "Win32_System_RemoteManagement" = [ "Win32_System" ]; + "Win32_System_RestartManager" = [ "Win32_System" ]; + "Win32_System_Restore" = [ "Win32_System" ]; + "Win32_System_Rpc" = [ "Win32_System" ]; + "Win32_System_Search" = [ "Win32_System" ]; + "Win32_System_Search_Common" = [ "Win32_System_Search" ]; + "Win32_System_SecurityCenter" = [ "Win32_System" ]; + "Win32_System_ServerBackup" = [ "Win32_System" ]; + "Win32_System_Services" = [ "Win32_System" ]; + "Win32_System_SettingsManagementInfrastructure" = [ "Win32_System" ]; + "Win32_System_SetupAndMigration" = [ "Win32_System" ]; + "Win32_System_Shutdown" = [ "Win32_System" ]; + "Win32_System_StationsAndDesktops" = [ "Win32_System" ]; + "Win32_System_SubsystemForLinux" = [ "Win32_System" ]; + "Win32_System_SystemInformation" = [ "Win32_System" ]; + "Win32_System_SystemServices" = [ "Win32_System" ]; + "Win32_System_TaskScheduler" = [ "Win32_System" ]; + "Win32_System_Threading" = [ "Win32_System" ]; + "Win32_System_Time" = [ "Win32_System" ]; + "Win32_System_TpmBaseServices" = [ "Win32_System" ]; + "Win32_System_UpdateAgent" = [ "Win32_System" ]; + "Win32_System_UpdateAssessment" = [ "Win32_System" ]; + "Win32_System_UserAccessLogging" = [ "Win32_System" ]; + "Win32_System_VirtualDosMachines" = [ "Win32_System" ]; + "Win32_System_WindowsProgramming" = [ "Win32_System" ]; + "Win32_System_WindowsSync" = [ "Win32_System" ]; + "Win32_System_Wmi" = [ "Win32_System" ]; + "Win32_UI" = [ "Win32" ]; + "Win32_UI_Accessibility" = [ "Win32_UI" ]; + "Win32_UI_Animation" = [ "Win32_UI" ]; + "Win32_UI_ColorSystem" = [ "Win32_UI" ]; + "Win32_UI_Controls" = [ "Win32_UI" ]; + "Win32_UI_Controls_Dialogs" = [ "Win32_UI_Controls" ]; + "Win32_UI_Controls_RichEdit" = [ "Win32_UI_Controls" ]; + "Win32_UI_HiDpi" = [ "Win32_UI" ]; + "Win32_UI_Input" = [ "Win32_UI" ]; + "Win32_UI_Input_Ime" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Ink" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_KeyboardAndMouse" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Pointer" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Radial" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_Touch" = [ "Win32_UI_Input" ]; + "Win32_UI_Input_XboxController" = [ "Win32_UI_Input" ]; + "Win32_UI_InteractionContext" = [ "Win32_UI" ]; + "Win32_UI_LegacyWindowsEnvironmentFeatures" = [ "Win32_UI" ]; + "Win32_UI_Magnification" = [ "Win32_UI" ]; + "Win32_UI_Notifications" = [ "Win32_UI" ]; + "Win32_UI_Ribbon" = [ "Win32_UI" ]; + "Win32_UI_Shell" = [ "Win32_UI" ]; + "Win32_UI_Shell_Common" = [ "Win32_UI_Shell" ]; + "Win32_UI_Shell_PropertiesSystem" = [ "Win32_UI_Shell" ]; + "Win32_UI_TabletPC" = [ "Win32_UI" ]; + "Win32_UI_TextServices" = [ "Win32_UI" ]; + "Win32_UI_WindowsAndMessaging" = [ "Win32_UI" ]; + "Win32_UI_Wpf" = [ "Win32_UI" ]; + "Win32_Web" = [ "Win32" ]; + "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; + }; + resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_IO" "Win32_System_Pipes" "Win32_System_Threading" "Win32_System_WindowsProgramming" "default" ]; + }; + "windows-sys 0.52.0" = rec { crateName = "windows-sys"; version = "0.52.0"; edition = "2021"; @@ -3860,7 +3788,7 @@ rec { dependencies = [ { name = "windows-targets"; - packageId = "windows-targets"; + packageId = "windows-targets 0.52.4"; } ]; features = { @@ -4096,7 +4024,54 @@ rec { }; resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_NetworkManagement" "Win32_NetworkManagement_IpHelper" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_Threading" "default" ]; }; - "windows-targets" = rec { + "windows-targets 0.48.5" = rec { + crateName = "windows-targets"; + version = "0.48.5"; + edition = "2018"; + sha256 = "034ljxqshifs1lan89xwpcy1hp0lhdh4b5n0d2z4fwjx2piacbws"; + authors = [ + "Microsoft" + ]; + dependencies = [ + { + name = "windows_aarch64_gnullvm"; + packageId = "windows_aarch64_gnullvm 0.48.5"; + target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-pc-windows-gnullvm"); + } + { + name = "windows_aarch64_msvc"; + packageId = "windows_aarch64_msvc 0.48.5"; + target = { target, features }: (("aarch64" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); + } + { + name = "windows_i686_gnu"; + packageId = "windows_i686_gnu 0.48.5"; + target = { target, features }: (("x86" == target."arch") && ("gnu" == target."env") && (!(target."windows_raw_dylib" or false))); + } + { + name = "windows_i686_msvc"; + packageId = "windows_i686_msvc 0.48.5"; + target = { target, features }: (("x86" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); + } + { + name = "windows_x86_64_gnu"; + packageId = "windows_x86_64_gnu 0.48.5"; + target = { target, features }: (("x86_64" == target."arch") && ("gnu" == target."env") && (!("llvm" == target."abi")) && (!(target."windows_raw_dylib" or false))); + } + { + name = "windows_x86_64_gnullvm"; + packageId = "windows_x86_64_gnullvm 0.48.5"; + target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnullvm"); + } + { + name = "windows_x86_64_msvc"; + packageId = "windows_x86_64_msvc 0.48.5"; + target = { target, features }: (("x86_64" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); + } + ]; + + }; + "windows-targets 0.52.4" = rec { crateName = "windows-targets"; version = "0.52.4"; edition = "2021"; @@ -4107,43 +4082,53 @@ rec { dependencies = [ { name = "windows_aarch64_gnullvm"; - packageId = "windows_aarch64_gnullvm"; + packageId = "windows_aarch64_gnullvm 0.52.4"; target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-pc-windows-gnullvm"); } { name = "windows_aarch64_msvc"; - packageId = "windows_aarch64_msvc"; + packageId = "windows_aarch64_msvc 0.52.4"; target = { target, features }: (("aarch64" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); } { name = "windows_i686_gnu"; - packageId = "windows_i686_gnu"; + packageId = "windows_i686_gnu 0.52.4"; target = { target, features }: (("x86" == target."arch") && ("gnu" == target."env") && (!(target."windows_raw_dylib" or false))); } { name = "windows_i686_msvc"; - packageId = "windows_i686_msvc"; + packageId = "windows_i686_msvc 0.52.4"; target = { target, features }: (("x86" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); } { name = "windows_x86_64_gnu"; - packageId = "windows_x86_64_gnu"; + packageId = "windows_x86_64_gnu 0.52.4"; target = { target, features }: (("x86_64" == target."arch") && ("gnu" == target."env") && (!("llvm" == target."abi")) && (!(target."windows_raw_dylib" or false))); } { name = "windows_x86_64_gnullvm"; - packageId = "windows_x86_64_gnullvm"; + packageId = "windows_x86_64_gnullvm 0.52.4"; target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnullvm"); } { name = "windows_x86_64_msvc"; - packageId = "windows_x86_64_msvc"; + packageId = "windows_x86_64_msvc 0.52.4"; target = { target, features }: (("x86_64" == target."arch") && ("msvc" == target."env") && (!(target."windows_raw_dylib" or false))); } ]; }; - "windows_aarch64_gnullvm" = rec { + "windows_aarch64_gnullvm 0.48.5" = rec { + crateName = "windows_aarch64_gnullvm"; + version = "0.48.5"; + edition = "2018"; + sha256 = "1n05v7qblg1ci3i567inc7xrkmywczxrs1z3lj3rkkxw18py6f1b"; + authors = [ + "Microsoft" + ]; + + }; + "windows_aarch64_gnullvm 0.52.4" = rec { crateName = "windows_aarch64_gnullvm"; version = "0.52.4"; edition = "2021"; @@ -4153,7 +4138,17 @@ rec { ]; }; - "windows_aarch64_msvc" = rec { + "windows_aarch64_msvc 0.48.5" = rec { + crateName = "windows_aarch64_msvc"; + version = "0.48.5"; + edition = "2018"; + sha256 = "1g5l4ry968p73g6bg6jgyvy9lb8fyhcs54067yzxpcpkf44k2dfw"; + authors = [ + "Microsoft" + ]; + + }; + "windows_aarch64_msvc 0.52.4" = rec { crateName = "windows_aarch64_msvc"; version = "0.52.4"; edition = "2021"; @@ -4163,7 +4158,17 @@ rec { ]; }; - "windows_i686_gnu" = rec { + "windows_i686_gnu 0.48.5" = rec { + crateName = "windows_i686_gnu"; + version = "0.48.5"; + edition = "2018"; + sha256 = "0gklnglwd9ilqx7ac3cn8hbhkraqisd0n83jxzf9837nvvkiand7"; + authors = [ + "Microsoft" + ]; + + }; + "windows_i686_gnu 0.52.4" = rec { crateName = "windows_i686_gnu"; version = "0.52.4"; edition = "2021"; @@ -4173,7 +4178,17 @@ rec { ]; }; - "windows_i686_msvc" = rec { + "windows_i686_msvc 0.48.5" = rec { + crateName = "windows_i686_msvc"; + version = "0.48.5"; + edition = "2018"; + sha256 = "01m4rik437dl9rdf0ndnm2syh10hizvq0dajdkv2fjqcywrw4mcg"; + authors = [ + "Microsoft" + ]; + + }; + "windows_i686_msvc 0.52.4" = rec { crateName = "windows_i686_msvc"; version = "0.52.4"; edition = "2021"; @@ -4183,7 +4198,17 @@ rec { ]; }; - "windows_x86_64_gnu" = rec { + "windows_x86_64_gnu 0.48.5" = rec { + crateName = "windows_x86_64_gnu"; + version = "0.48.5"; + edition = "2018"; + sha256 = "13kiqqcvz2vnyxzydjh73hwgigsdr2z1xpzx313kxll34nyhmm2k"; + authors = [ + "Microsoft" + ]; + + }; + "windows_x86_64_gnu 0.52.4" = rec { crateName = "windows_x86_64_gnu"; version = "0.52.4"; edition = "2021"; @@ -4193,7 +4218,17 @@ rec { ]; }; - "windows_x86_64_gnullvm" = rec { + "windows_x86_64_gnullvm 0.48.5" = rec { + crateName = "windows_x86_64_gnullvm"; + version = "0.48.5"; + edition = "2018"; + sha256 = "1k24810wfbgz8k48c2yknqjmiigmql6kk3knmddkv8k8g1v54yqb"; + authors = [ + "Microsoft" + ]; + + }; + "windows_x86_64_gnullvm 0.52.4" = rec { crateName = "windows_x86_64_gnullvm"; version = "0.52.4"; edition = "2021"; @@ -4203,36 +4238,23 @@ rec { ]; }; - "windows_x86_64_msvc" = rec { + "windows_x86_64_msvc 0.48.5" = rec { crateName = "windows_x86_64_msvc"; - version = "0.52.4"; - edition = "2021"; - sha256 = "1n0yc7xiv9iki1j3xl8nxlwwkr7dzsnwwvycvgxxv81d5bjm5drj"; + version = "0.48.5"; + edition = "2018"; + sha256 = "0f4mdp895kkjh9zv8dxvn4pc10xr7839lf5pa9l0193i2pkgr57d"; authors = [ "Microsoft" ]; }; - "ws2_32-sys" = rec { - crateName = "ws2_32-sys"; - version = "0.2.1"; - edition = "2015"; - sha256 = "0ppscg5qfqaw0gzwv2a4nhn5bn01ff9iwn6ysqnzm4n8s3myz76m"; - libName = "ws2_32"; + "windows_x86_64_msvc 0.52.4" = rec { + crateName = "windows_x86_64_msvc"; + version = "0.52.4"; + edition = "2021"; + sha256 = "1n0yc7xiv9iki1j3xl8nxlwwkr7dzsnwwvycvgxxv81d5bjm5drj"; authors = [ - "Peter Atashian " - ]; - dependencies = [ - { - name = "winapi"; - packageId = "winapi 0.2.8"; - } - ]; - buildDependencies = [ - { - name = "winapi-build"; - packageId = "winapi-build"; - } + "Microsoft" ]; }; diff --git a/Cargo.toml b/Cargo.toml index c22c7da1..85842689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,9 @@ edition = "2021" # before updating dependencies: we want to keep the rustc compatible with 1.41.0 for now (start of 2020). [dependencies] # central features -notify = "= 5.0.0-pre.1" +notify = "6.1.1" atomicwrites = "0.2.5" -crossbeam-channel = "0.3.8" +crossbeam-channel = "0.5.12" nix = "0.20.0" regex = "1.4.3" tempfile = "3.1.0" diff --git a/src/watch.rs b/src/watch.rs index 8389c19c..fab935f5 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -77,7 +77,10 @@ impl Watch { let (tx, rx) = chan::unbounded(); Ok(Watch { - notify: Watcher::new(tx, Duration::from_millis(100))?, + notify: notify::Watcher::new( + tx, + notify::Config::default().with_poll_interval(Duration::from_millis(100)), + )?, watches: HashSet::new(), rx, logger, From 7442674ace4b2a001683b7aaea5f9c6701de37f6 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 27 Apr 2024 12:55:12 +0200 Subject: [PATCH 3/9] feat(Async): add Async::run_with_stop_signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function allows us to spawn a cooperative async, which is asked to stop when the async is dropped. We don’t add a timeout when waiting in the drop, meaning if the inner async ignores the channel it might block execution. --- src/run_async.rs | 67 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/src/run_async.rs b/src/run_async.rs index 7ae6b449..dc77aaac 100644 --- a/src/run_async.rs +++ b/src/run_async.rs @@ -13,10 +13,21 @@ pub struct Async { result_chan: chan::Receiver, /// whether the thread should linger (aka detach) after this Async is dropped linger: bool, + /// Stop signal that gets sent to the thread that potentially signed up for it + stop_signal_tx: Option>, } +/// A stop signal sent to the async thread when it should stop what it’s doing. +pub struct StopSignal(); + impl Drop for Async { fn drop(&mut self) { + // send the thread the stop signal if it requested it + if let Some(stop_signal) = self.stop_signal_tx.as_ref() { + stop_signal + .send(StopSignal()) + .expect("The async thread was not ready to receive the stop message it requested") + } // when the Async should not linger, we have to wait for it to finish here. if !self.linger { self.thread @@ -26,6 +37,10 @@ impl Drop for Async { } } +/// This value should be returned from a thread when the stop signal has been received. Do not construct (TODO: how to prevent other modules from constructing?) +#[derive(Debug)] +pub struct StopReceived(); + impl Async { /// Create a new Async that runs a function in a thread. /// @@ -38,7 +53,25 @@ impl Async { F: std::panic::UnwindSafe, F: Send + 'static, { - Self::run_inner(logger, f, false) + Self::run_inner(logger, f, false, None) + } + + /// Create a new Async that runs a function in a thread. + /// + /// You can read the result either by blocking + /// or by using the `chan` method to get a channel that receives exactly + /// one result as soon as the the function is done. + /// + /// The function *should* listen on the stop signal channel + /// so that it can abort and be joined when it is requested to. + pub fn run_with_stop_signal(logger: &slog::Logger, f: F) -> Self + where + F: FnOnce(chan::Receiver) -> Res, + F: std::panic::UnwindSafe, + F: Send + 'static, + { + let (stop_signal_tx, stop_signal_rx) = chan::bounded(1); + Self::run_inner(logger, || f(stop_signal_rx), false, Some(stop_signal_tx)) } /// Create a new Async that runs a function in a thread. @@ -56,10 +89,15 @@ impl Async { F: std::panic::UnwindSafe, F: Send + 'static, { - Self::run_inner(logger, f, true) + Self::run_inner(logger, f, true, None) } - fn run_inner(logger: &slog::Logger, f: F, linger: bool) -> Self + fn run_inner( + logger: &slog::Logger, + f: F, + linger: bool, + stop_signal_tx: Option>, + ) -> Self where F: FnOnce() -> Res, F: std::panic::UnwindSafe, @@ -80,6 +118,7 @@ impl Async { thread, result_chan: rx, linger, + stop_signal_tx, } } @@ -112,6 +151,11 @@ impl Async { #[cfg(test)] mod tests { + use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }; + use super::*; #[test] @@ -151,4 +195,21 @@ mod tests { ); // At least you can’t block twice, because the .block() call consumes the Async } + + #[test] + /// Checks that the stop signal is sent as expected, and allows the thread to be joined. + fn test_stop_signal() { + let was_stopped = Arc::new(AtomicBool::new(false)); + let was_stopped2 = was_stopped.clone(); + + let a = + Async::run_with_stop_signal(&crate::logging::test_logger(), move |stop_signal_rx| { + chan::select! { + recv(stop_signal_rx) -> _ => { was_stopped2.store(true, Ordering::Relaxed) } + } + }); + + drop(a); + assert_eq!(was_stopped.load(Ordering::Relaxed), true) + } } From be5d5d3efc0a462886a3024df79fe542283e37e6 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 14:20:36 +0200 Subject: [PATCH 4/9] feat(watcher): Use notify_debouncer_full Based on code by @nyarly, this debounces watch events before filtering file paths. `notify_debouncer_full` will do the hard part of making sure spurious events are sufficiently removed before we match on them. From the docs: * Only emits a single Rename event if the rename From and To events can be matched * Merges multiple Rename events * Takes Rename events into account and updates paths for events that occurred before the rename event, but which haven't been emitted, yet * Optionally keeps track of the file system IDs all files and stiches rename events together (FSevents, Windows) * Emits only one Remove event when deleting a directory (inotify) * Doesn't emit duplicate create events * Doesn't emit Modify events after a Create event --- Cargo.lock | 80 ++++++++++- Cargo.nix | 214 +++++++++++++++++++++++++++- Cargo.toml | 7 + src/build_loop.rs | 32 ++--- src/watch.rs | 346 ++++++++++++++++++++++++++++++---------------- 5 files changed, 537 insertions(+), 142 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 424fcec4..cf35fa3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -249,6 +249,15 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +[[package]] +name = "file-id" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6584280525fb2059cba3db2c04abf947a1a29a45ddae89f3870f8281704fafc9" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "filetime" version = "0.2.23" @@ -257,7 +266,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -434,6 +443,16 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.21" @@ -456,6 +475,7 @@ dependencies = [ "md5", "nix 0.20.2", "notify", + "notify-debouncer-full", "proptest", "regex", "serde", @@ -568,6 +588,20 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "notify-debouncer-full" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f5dab59c348b9b50cf7f261960a20e389feb2713636399cd9082cd4b536154" +dependencies = [ + "crossbeam-channel", + "file-id", + "log", + "notify", + "parking_lot", + "walkdir", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -607,6 +641,29 @@ dependencies = [ "regex", ] +[[package]] +name = "parking_lot" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.5.1", + "smallvec", + "windows-targets 0.52.4", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -774,6 +831,15 @@ dependencies = [ "bitflags 1.2.1", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -869,6 +935,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "serde" version = "1.0.197" @@ -919,6 +991,12 @@ dependencies = [ "time", ] +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "strsim" version = "0.8.0" diff --git a/Cargo.nix b/Cargo.nix index a76c3815..2d06ce5c 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -752,6 +752,27 @@ rec { }; resolvedDefaultFeatures = [ "alloc" "default" "std" ]; }; + "file-id" = rec { + crateName = "file-id"; + version = "0.2.1"; + edition = "2021"; + crateBin = []; + sha256 = "1jdg9xq830hghzrqkbnx8nda58a7z6mh8b6vlg5mj87v4l2ji135"; + authors = [ + "Daniel Faust " + ]; + dependencies = [ + { + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; + target = { target, features }: (target."windows" or false); + features = [ "Win32_Storage_FileSystem" "Win32_Foundation" ]; + } + ]; + features = { + "serde" = [ "dep:serde" ]; + }; + }; "filetime" = rec { crateName = "filetime"; version = "0.2.23"; @@ -772,7 +793,7 @@ rec { } { name = "redox_syscall"; - packageId = "redox_syscall"; + packageId = "redox_syscall 0.4.1"; target = { target, features }: ("redox" == target."os"); } { @@ -1230,6 +1251,34 @@ rec { }; resolvedDefaultFeatures = [ "elf" "errno" "general" "ioctl" "no_std" ]; }; + "lock_api" = rec { + crateName = "lock_api"; + version = "0.4.12"; + edition = "2021"; + sha256 = "05qvxa6g27yyva25a5ghsg85apdxkvr77yhkyhapj6r8vnf8pbq7"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "scopeguard"; + packageId = "scopeguard"; + usesDefaultFeatures = false; + } + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg"; + } + ]; + features = { + "default" = [ "atomic_usize" ]; + "owning_ref" = [ "dep:owning_ref" ]; + "serde" = [ "dep:serde" ]; + }; + resolvedDefaultFeatures = [ "atomic_usize" "default" ]; + }; "log" = rec { crateName = "log"; version = "0.4.21"; @@ -1322,6 +1371,10 @@ rec { name = "notify"; packageId = "notify"; } + { + name = "notify-debouncer-full"; + packageId = "notify-debouncer-full"; + } { name = "regex"; packageId = "regex"; @@ -1723,6 +1776,49 @@ rec { }; resolvedDefaultFeatures = [ "crossbeam-channel" "default" "fsevent-sys" "macos_fsevent" ]; }; + "notify-debouncer-full" = rec { + crateName = "notify-debouncer-full"; + version = "0.3.1"; + edition = "2021"; + sha256 = "0m31ad5wv0lhrncn6qqk4zmryf0fl9h1j9kzrx89p2rlkjsxmxa9"; + libName = "notify_debouncer_full"; + authors = [ + "Daniel Faust " + ]; + dependencies = [ + { + name = "crossbeam-channel"; + packageId = "crossbeam-channel"; + optional = true; + } + { + name = "file-id"; + packageId = "file-id"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "notify"; + packageId = "notify"; + } + { + name = "parking_lot"; + packageId = "parking_lot"; + } + { + name = "walkdir"; + packageId = "walkdir"; + } + ]; + features = { + "crossbeam" = [ "crossbeam-channel" "notify/crossbeam-channel" ]; + "crossbeam-channel" = [ "dep:crossbeam-channel" ]; + "default" = [ "crossbeam" ]; + }; + resolvedDefaultFeatures = [ "crossbeam" "crossbeam-channel" "default" ]; + }; "num-conv" = rec { crateName = "num-conv"; version = "0.1.0"; @@ -1820,6 +1916,73 @@ rec { ]; }; + "parking_lot" = rec { + crateName = "parking_lot"; + version = "0.12.2"; + edition = "2021"; + sha256 = "1ys2dzz6cysjmwyivwxczl1ljpcf5cj4qmhdj07d5bkc9z5g0jky"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "lock_api"; + packageId = "lock_api"; + } + { + name = "parking_lot_core"; + packageId = "parking_lot_core"; + } + ]; + features = { + "arc_lock" = [ "lock_api/arc_lock" ]; + "deadlock_detection" = [ "parking_lot_core/deadlock_detection" ]; + "nightly" = [ "parking_lot_core/nightly" "lock_api/nightly" ]; + "owning_ref" = [ "lock_api/owning_ref" ]; + "serde" = [ "lock_api/serde" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "parking_lot_core" = rec { + crateName = "parking_lot_core"; + version = "0.9.10"; + edition = "2021"; + sha256 = "1y3cf9ld9ijf7i4igwzffcn0xl16dxyn4c5bwgjck1dkgabiyh0y"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 1.0.0"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (target."unix" or false); + } + { + name = "redox_syscall"; + packageId = "redox_syscall 0.5.1"; + target = { target, features }: ("redox" == target."os"); + } + { + name = "smallvec"; + packageId = "smallvec"; + } + { + name = "windows-targets"; + packageId = "windows-targets 0.52.4"; + target = { target, features }: (target."windows" or false); + } + ]; + features = { + "backtrace" = [ "dep:backtrace" ]; + "deadlock_detection" = [ "petgraph" "thread-id" "backtrace" ]; + "petgraph" = [ "dep:petgraph" ]; + "thread-id" = [ "dep:thread-id" ]; + }; + }; "powerfmt" = rec { crateName = "powerfmt"; version = "0.2.0"; @@ -2265,7 +2428,7 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "redox_syscall" = rec { + "redox_syscall 0.4.1" = rec { crateName = "redox_syscall"; version = "0.4.1"; edition = "2018"; @@ -2285,6 +2448,26 @@ rec { "rustc-dep-of-std" = [ "core" "bitflags/rustc-dep-of-std" ]; }; }; + "redox_syscall 0.5.1" = rec { + crateName = "redox_syscall"; + version = "0.5.1"; + edition = "2018"; + sha256 = "0zja6y3av9z50gg1hh0vsc053941wng21r43whhk8mfb9n4m5426"; + libName = "syscall"; + authors = [ + "Jeremy Soller " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags 2.5.0"; + } + ]; + features = { + "core" = [ "dep:core" ]; + "rustc-dep-of-std" = [ "core" "bitflags/rustc-dep-of-std" ]; + }; + }; "redox_users" = rec { crateName = "redox_users"; version = "0.4.5"; @@ -2648,6 +2831,18 @@ rec { ]; }; + "scopeguard" = rec { + crateName = "scopeguard"; + version = "1.2.0"; + edition = "2015"; + sha256 = "0jcz9sd47zlsgcnm1hdw0664krxwb5gczlif4qngj2aif8vky54l"; + authors = [ + "bluss" + ]; + features = { + "default" = [ "use_std" ]; + }; + }; "serde" = rec { crateName = "serde"; version = "1.0.197"; @@ -2810,6 +3005,21 @@ rec { "serde_json" = [ "dep:serde_json" ]; }; }; + "smallvec" = rec { + crateName = "smallvec"; + version = "1.13.2"; + edition = "2018"; + sha256 = "0rsw5samawl3wsw6glrsb127rx6sh89a8wyikicw6dkdcjd1lpiw"; + authors = [ + "The Servo Project Developers" + ]; + features = { + "arbitrary" = [ "dep:arbitrary" ]; + "const_new" = [ "const_generics" ]; + "drain_keep_rest" = [ "drain_filter" ]; + "serde" = [ "dep:serde" ]; + }; + }; "strsim" = rec { crateName = "strsim"; version = "0.8.0"; diff --git a/Cargo.toml b/Cargo.toml index 85842689..89074d21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,11 @@ thiserror = "1.0" # TODO: update to 0.3 structopt.version = "0.2" + +# TODO: update to 0.3 structopt.default-features = false + +# TODO: update to 0.3 structopt.features = [ # "default", "suggestions", @@ -55,11 +59,14 @@ lazy_static = "1.4.0" md5 = "0.7.0" vec1 = ">= 1.1.0, <1.7.0" human-panic = { path = "vendor/human-panic" } +notify-debouncer-full = "0.3.1" [dev-dependencies] # 1.0.0 requires at least rust 1.50 proptest.version = "0.10.1" +# 1.0.0 requires at least rust 1.50 proptest.default-features = false +# 1.0.0 requires at least rust 1.50 proptest.features = [ "std", # reenable if proptest kills the test runner diff --git a/src/build_loop.rs b/src/build_loop.rs index 4d376b6e..43821d1c 100644 --- a/src/build_loop.rs +++ b/src/build_loop.rs @@ -170,9 +170,10 @@ impl<'a> BuildLoop<'a> { nix_gc_root_user_dir: project::NixGcRootUserDir, logger: slog::Logger, ) -> anyhow::Result> { - let mut watch = Watch::new(logger.clone()).map_err(|err| anyhow!(err))?; + let watch = Watch::new(&logger).map_err(|err| anyhow!(err))?; watch - .extend(vec![WatchPathBuf::Normal( + .add_to_watch_tx + .send(vec![WatchPathBuf::Normal( project.nix_file.as_absolute_path().to_owned(), )]) .with_context(|| { @@ -201,7 +202,7 @@ impl<'a> BuildLoop<'a> { rx_ping: chan::Receiver<()>, ) -> crate::Never { let mut current_build = BuildState::NotRunning; - let rx_watcher = self.watch.rx.clone(); + let rx_watcher = self.watch.watch_events_rx.clone(); loop { debug!(self.logger, "looping build_loop"; @@ -247,19 +248,13 @@ impl<'a> BuildLoop<'a> { // watcher found file change recv(rx_watcher) -> msg => match msg { - Ok(msg) => { - match self.watch.process_watch_events(msg) { - Some(changed) => { - // TODO: this is not a started, this is just a scheduled! - send_event(Event::Started { - nix_file: self.project.nix_file.clone(), - reason: Reason::FilesChanged(changed) - }); - self.start_or_schedule_build(&mut current_build) - }, - // No relevant file events - None => {} - } + Ok(changed) => { + // TODO: this is not a started, this is just a scheduled! + send_event(Event::Started { + nix_file: self.project.nix_file.clone(), + reason: Reason::FilesChanged(changed) + }); + self.start_or_schedule_build(&mut current_build) }, Err(chan::RecvError) => debug!(self.logger, "notify chan was disconnected"; "project" => &self.project.nix_file) @@ -340,7 +335,10 @@ impl<'a> BuildLoop<'a> { debug!(self.logger, "paths reduced"; "from" => original_paths_len, "to" => paths.len()); // add all new (reduced) nix sources to the input source watchlist - self.watch.extend(paths.into_iter().collect::>())?; + self.watch + .add_to_watch_tx + .send(paths.into_iter().collect::>()) + .map_err(BuildError::io)?; // root the result self.project diff --git a/src/watch.rs b/src/watch.rs index fab935f5..dd0feb1f 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -1,14 +1,19 @@ //! Recursively watch paths for changes, in an extensible and //! cross-platform way. +use chan::{select, Receiver, Sender}; use crossbeam_channel as chan; use notify::event::ModifyKind; use notify::{EventKind, RecommendedWatcher, RecursiveMode, Watcher}; -use slog::{debug, info}; +use notify_debouncer_full::{DebounceEventResult, DebouncedEvent, Debouncer, FileIdMap}; +use slog::{debug, info, warn}; use std::collections::HashSet; use std::path::{Path, PathBuf}; +use std::sync::Mutex; use std::time::Duration; +use crate::run_async::{Async, StopSignal}; + /// Represents if a path to watch should be watched recursively by the watcher or not #[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)] pub enum WatchPathBuf { @@ -49,16 +54,41 @@ impl WatchPathBuf { /// A dynamic list of paths to watch for changes, and /// react to changes when they occur. +/// +/// It runs a thread, which is stopped once this struct is dropped. pub struct Watch { - /// Event receiver. Process using `Watch::process`. - pub rx: chan::Receiver>, - /// OS-based notification when any file we watched changes. - notify: RecommendedWatcher, - /// The list of files we are watching; + /// Receives watch events. When receiving events, run `Watch::process` on them + pub watch_events_rx: chan::Receiver>, + /// Extend the watch list with an additional list of paths. /// - /// Invariant: all paths in here should be canonicalized. - watches: HashSet, - logger: slog::Logger, + /// Note: Watch maintains a list of already watched paths, and + /// will not add duplicates. + pub add_to_watch_tx: chan::Sender>, + /// Thread that waits for events. + #[allow(dead_code)] + watch_thread: Async<()>, +} + +impl Watch { + /// Instantiate a new Watch. + pub fn new(logger: &slog::Logger) -> Result { + let (filtered_events_tx, filtered_events_rx) = chan::unbounded(); + let (user_requests_tx, user_requests_rx) = chan::unbounded(); + + let mut filter = Mutex::new(Filter::new(user_requests_rx, filtered_events_tx, logger)?); + let watch_thread = Async::run_with_stop_signal(logger, move |stop_signal_rx| { + filter + .get_mut() + .expect("watcher mutex poisoned") + .loop_on_events(stop_signal_rx) + }); + + Ok(Watch { + watch_events_rx: filtered_events_rx, + add_to_watch_tx: user_requests_tx, + watch_thread, + }) + } } /// A debug message string that can only be displayed via `Debug`. @@ -71,77 +101,138 @@ struct FilteredOut<'a> { path: PathBuf, } -impl Watch { - /// Instantiate a new Watch. - pub fn new(logger: slog::Logger) -> Result { - let (tx, rx) = chan::unbounded(); +struct Filter { + /// The low-level watcher + filesystem_watcher: Debouncer, + /// Unfiltered events from `notify` library + filesystem_events_rx: Receiver, + /// User requests to add more paths to our watcher + user_requests_rx: Receiver>, + /// Channel we send filtered messages to + filtered_events_tx: Sender>, + /// Set of currently watched paths + current_watched: HashSet, + logger: slog::Logger, +} - Ok(Watch { - notify: notify::Watcher::new( - tx, - notify::Config::default().with_poll_interval(Duration::from_millis(100)), +impl Filter { + fn new( + user_requests_rx: Receiver>, + filtered_events_tx: Sender>, + logger: &slog::Logger, + ) -> notify::Result { + let (filesystem_events_tx, filesystem_events_rx) = chan::unbounded(); + + Ok(Filter { + filesystem_watcher: notify_debouncer_full::new_debouncer( + Duration::from_millis(200), + None, + filesystem_events_tx, )?, - watches: HashSet::new(), - rx, - logger, + filesystem_events_rx, + user_requests_rx, + filtered_events_tx, + current_watched: HashSet::new(), + logger: logger.clone(), }) } - /// Process `notify::Event`s coming in via `Watch::rx`. - /// - /// Returns a list of „interesting“ paths. - /// - /// `None` if there were no relevant changes. - pub fn process_watch_events( - &self, - event: notify::Result, - ) -> Option> { - match event { - Ok(event) => { - { - let event = &event; - debug!(self.logger, "Watch Event: {:#?}", event); - match &event.kind { - notify::event::EventKind::Remove(_) if !event.paths.is_empty() => { - info!(self.logger, "identified removal: {:?}", &event.paths); - } - _ => { - debug!(self.logger, "watch event"; "event" => ?event); - } - } - }; - let notify::Event { paths, kind, .. } = event; - let interesting_paths: Vec = paths - .into_iter() - .filter(|path| { - // We ignore metadata modification events for the profiles directory - // tree as it is a symlink forest that is used to keep track of - // channels and nix will uconditionally update the metadata of each - // link in this forest. See https://github.com/NixOS/nix/blob/629b9b0049363e091b76b7f60a8357d9f94733cc/src/libstore/local-store.cc#L74-L80 - // for the unconditional update. These metadata modification events are - // spurious annd they can easily cause a rebuild-loop when a shell.nix - // file does not pin its version of nixpkgs or other channels. When - // a Nix channel is updated we receive many other types of events, so - // ignoring these metadata modifications will not impact lorri's - // ability to correctly watch for channel changes. - if let EventKind::Modify(ModifyKind::Metadata(_)) = kind { - if path.starts_with(Path::new("/nix/var/nix/profiles/per-user")) { - return false; + fn loop_on_events(&mut self, stop_signal_rx: chan::Receiver) { + loop { + select! { + + // stop this watcher + recv(stop_signal_rx) -> _ => { + debug!(self.logger, "watch filter loop received stop signal, stopping"); + break; + }, + + // Handle file events + recv(self.filesystem_events_rx) -> msg => match msg { + Ok( DebounceEventResult::Ok(event)) => { + let paths = self.process_watch_events(event); + if !paths.is_empty() { + if let Err(e) = self.filtered_events_tx.send(paths) { + warn!(self.logger, "filtered_events_tx send error"; "error" => ?e) } + }}, + Ok(DebounceEventResult::Err(errs)) => { + warn!(self.logger, "notify library threw errors: {:#?}", errs); + continue + }, + Err(_recv_error) => { + debug!(self.logger, "filesystem notify channel was disconnected"); + return + } + }, + + // Add new files to watch + recv(self.user_requests_rx) -> msg => match msg { + Ok(paths) => { + let path_log = format!("{:?}", paths); + if let Err(e) = self.extend(paths) { + warn!(self.logger, "error extending watch paths:"; "error" => ?e, "paths" => path_log) } - self.path_match(path) - }) - .collect(); - match interesting_paths.is_empty() { - true => None, - false => Some(interesting_paths), + }, + Err(chan::RecvError) => { + debug!(self.logger, "watch extension channel was disconnected"); + return + } } } - Err(err) => { - slog::warn!(self.logger, "notify library threw error: {}", err); - None + } + } + + /// Process `notify::Event`s coming in via `Watch::rx`. + /// + /// Returns a list of „interesting“ paths, if any. + fn process_watch_events(&self, events: Vec) -> Vec { + let mut interesting_paths = vec![]; + for event in &events { + { + match event.kind { + notify::event::EventKind::Remove(_) if !event.paths.is_empty() => { + info!(self.logger, "identified removal: {:?}", &event.paths); + } + _ => { + debug!(self.logger, "watch event"; "event" => ?event); + } + } + }; + let notify::Event { + ref paths, kind, .. + } = event.event; + for path in paths { + // We ignore metadata modification events for the profiles directory + // tree as it is a symlink forest that is used to keep track of + // channels and nix will uconditionally update the metadata of each + // link in this forest. See https://github.com/NixOS/nix/blob/629b9b0049363e091b76b7f60a8357d9f94733cc/src/libstore/local-store.cc#L74-L80 + // for the unconditional update. These metadata modification events are + // spurious annd they can easily cause a rebuild-loop when a shell.nix + // file does not pin its version of nixpkgs or other channels. When + // a Nix channel is updated we receive many other types of events, so + // ignoring these metadata modifications will not impact lorri's + // ability to correctly watch for channel changes. + if let EventKind::Modify(ModifyKind::Metadata(_)) = kind { + if path.starts_with(Path::new("/nix/var/nix/profiles/per-user")) { + continue; + } + } + + if self.path_match(path) { + interesting_paths.push((path, event)) + } } } + if interesting_paths.is_empty() { + debug!(self.logger, "generated no interesting paths"); + } else { + debug!(self.logger, "generated interesting paths"; "paths" => ?interesting_paths); + } + interesting_paths + .into_iter() + .map(|(path, _)| path.clone()) + .collect() } /// Extend the watch list with an additional list of paths. @@ -171,18 +262,22 @@ impl Watch { ) } else { let this = &mut *self; - if !this.watches.contains(&p) { + if !this.current_watched.contains(&p) { debug!(this.logger, "watching path"; "path" => p.to_str()); - this.notify.watch(&p, RecursiveMode::NonRecursive)?; - this.watches.insert(p.clone()); + this.filesystem_watcher + .watcher() + .watch(&p, RecursiveMode::NonRecursive)?; + this.current_watched.insert(p.clone()); } if let Some(parent) = p.parent() { - if !this.watches.contains(parent) { + if !this.current_watched.contains(parent) { debug!(this.logger, "watching parent path"; "parent_path" => parent.to_str()); - this.notify.watch(parent, RecursiveMode::NonRecursive)?; + this.filesystem_watcher + .watcher() + .watch(parent, RecursiveMode::NonRecursive)?; } } } @@ -205,7 +300,7 @@ impl Watch { fn path_match(&self, event_path: &Path) -> bool { let event_parent = event_path.parent(); - self.watches.iter().any(|watched: &PathBuf| { + self.current_watched.iter().any(|watched: &PathBuf| { if event_path == watched { debug!( self.logger, @@ -359,17 +454,17 @@ mod tests { F: Fn(&PathBuf) -> bool, { let start = time::Instant::now(); - let mut rest = timeout.clone(); + let mut rest = timeout; let mut seen: Vec = vec![]; let mut i = 0; loop { println!("loop {} rest: {}ms, seen: {:?}", i, rest.as_millis(), seen); - i = i + 1; - let recv = watch.rx.recv_timeout(rest); - println!("recv: {:#?}", recv); - let files = recv - .map_or(None, |e| watch.process_watch_events(e)) - .unwrap_or(vec![]); + i += 1; + let files = watch + .watch_events_rx + .recv_timeout(rest) + .expect("working notify in tests"); + println!("files: {:#?}", files); seen.extend(files.clone()); for f in files { if pred(&f) { @@ -387,9 +482,9 @@ mod tests { /// Assert no watcher event happens until the timeout fn assert_none_within(watch: &Watch, timeout: Duration) { - let res = watch.rx.recv_timeout(timeout); + let res = watch.watch_events_rx.recv_timeout(timeout); match res { - Err(_) => return, + Err(_) => (), Ok(watch_result) => { panic!( "expected no file change notification for; but these files changed: {:?}", @@ -445,7 +540,7 @@ mod tests { // Note, this is racey in the kernel. Otherwise I'd assert // this is empty. sleep(WATCHER_TIMEOUT); - watcher.rx.try_iter(); + watcher.event_rx.try_iter(); } #[cfg(not(target_os = "macos"))] @@ -460,12 +555,13 @@ mod tests { #[test] fn trivial_watch_whole_directory() { - let mut watcher = Watch::new(crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); watcher - .extend(vec![WatchPathBuf::Recursive(t.to_path_buf())]) + .add_to_watch_tx + .send(vec![WatchPathBuf::Recursive(t.to_path_buf())]) .unwrap(); expect_bash(r#"echo 1 > "$1/baz""#, [t]); @@ -478,12 +574,13 @@ mod tests { #[test] fn trivial_watch_directory_not_recursively() { - let mut watcher = Watch::new(crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); watcher - .extend(vec![WatchPathBuf::Normal(t.to_path_buf())]) + .add_to_watch_tx + .send(vec![WatchPathBuf::Normal(t.to_path_buf())]) .unwrap(); expect_bash(r#"touch "$1/baz""#, [t]); @@ -496,13 +593,15 @@ mod tests { #[test] fn trivial_watch_specific_file() { - let mut watcher = Watch::new(crate::logging::test_logger()).expect("failed creating Watch"); + let mut watcher = + Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1""#, [t]); expect_bash(r#"touch "$1/foo""#, [t]); watcher - .extend(vec![WatchPathBuf::Recursive(t.join("foo"))]) + .add_to_watch_tx + .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) .unwrap(); macos_eat_late_notifications(&mut watcher); @@ -512,37 +611,40 @@ mod tests { }) } - // TODO: this test is bugged, but in order to figure out what is wrong, we should add some sort of provenance to our watcher filter functions first. - // #[test] - // fn rename_over_vim() { - // // Vim renames files in to place for atomic writes - // let mut watcher = Watch::new(crate::logging::test_logger()).expect("failed creating Watch"); - - // with_test_tempdir(|t| { - // expect_bash(r#"mkdir -p "$1""#, [t]); - // expect_bash(r#"touch "$1/foo""#, [t]); - // watcher - // .extend(vec![WatchPathBuf::Recursive(t.join("foo"))]) - // .unwrap(); - // macos_eat_late_notifications(&mut watcher); - - // // bar is not watched, expect error - // expect_bash(r#"echo 1 > "$1/bar""#, [t]); - // assert_none_within(&watcher, WATCHER_TIMEOUT); - - // // Rename bar to foo, expect a notification - // expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); - // assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); - - // // Do it a second time - // expect_bash(r#"echo 1 > "$1/bar""#, [t]); - // assert_none_within(&watcher, WATCHER_TIMEOUT); - - // // Rename bar to foo, expect a notification - // expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); - // assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); - // }) - // } + // TODO: this test is bugged, but in order to figure out what is wrong, + // we should add some sort of provenance to our watcher filter functions first. + #[test] + fn rename_over_vim() { + // Vim renames files in to place for atomic writes + let mut watcher = + Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); + + with_test_tempdir(|t| { + expect_bash(r#"mkdir -p "$1""#, [t]); + expect_bash(r#"touch "$1/foo""#, [t]); + watcher + .add_to_watch_tx + .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) + .unwrap(); + macos_eat_late_notifications(&mut watcher); + + // bar is not watched, expect error + expect_bash(r#"echo 1 > "$1/bar""#, [t]); + assert_none_within(&watcher, WATCHER_TIMEOUT); + + // Rename bar to foo, expect a notification + expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); + assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); + + // Do it a second time + expect_bash(r#"echo 1 > "$1/bar""#, [t]); + assert_none_within(&watcher, WATCHER_TIMEOUT); + + // Rename bar to foo, expect a notification + expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); + assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); + }) + } #[test] fn walk_path_topo_filetree() { From a020d649f5984a9e657b506d73c7bf9b04b44ba7 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 15:58:42 +0200 Subject: [PATCH 5/9] fix(watcher): rephrase macos event drop test fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `macos_eat_late_notifications` is now less straightforward to implement, because we separated `Watch` from `Filter` and don’t expose the filter channel anymore. So instead let’s pass an optional duration, during which the first event is dropped. This somewhat complicates the event loop, but it can’t be helped, I think?? --- src/watch.rs | 71 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/src/watch.rs b/src/watch.rs index dd0feb1f..04e24704 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -72,10 +72,22 @@ pub struct Watch { impl Watch { /// Instantiate a new Watch. pub fn new(logger: &slog::Logger) -> Result { + Self::new_impl(logger, None) + } + + fn new_impl( + logger: &slog::Logger, + drop_first_event_within: Option, + ) -> Result { let (filtered_events_tx, filtered_events_rx) = chan::unbounded(); let (user_requests_tx, user_requests_rx) = chan::unbounded(); - let mut filter = Mutex::new(Filter::new(user_requests_rx, filtered_events_tx, logger)?); + let mut filter = Mutex::new(Filter::new( + user_requests_rx, + filtered_events_tx, + drop_first_event_within, + logger, + )?); let watch_thread = Async::run_with_stop_signal(logger, move |stop_signal_rx| { filter .get_mut() @@ -112,6 +124,8 @@ struct Filter { filtered_events_tx: Sender>, /// Set of currently watched paths current_watched: HashSet, + // Whether to drop the first event if it arrives faster than the given duration (hack for macos tests) + drop_first_event_within: Option, logger: slog::Logger, } @@ -119,6 +133,7 @@ impl Filter { fn new( user_requests_rx: Receiver>, filtered_events_tx: Sender>, + drop_first_event_within: Option, logger: &slog::Logger, ) -> notify::Result { let (filesystem_events_tx, filesystem_events_rx) = chan::unbounded(); @@ -134,11 +149,22 @@ impl Filter { filtered_events_tx, current_watched: HashSet::new(), logger: logger.clone(), + drop_first_event_within, }) } fn loop_on_events(&mut self, stop_signal_rx: chan::Receiver) { loop { + let mut drop_event = false; + let drop_first_event_within_rx = if let Some(dur) = self.drop_first_event_within { + drop_event = true; + chan::after(dur) + } else { + chan::never() + }; + // make sure this only happens during the first loop + self.drop_first_event_within = None; + select! { // stop this watcher @@ -147,9 +173,18 @@ impl Filter { break; }, + // potentially drop the first message + recv(drop_first_event_within_rx) -> _ => { + debug!(self.logger, "No event arrived within the initial drop timeout."; "duration" => ?self.drop_first_event_within); + } + // Handle file events recv(self.filesystem_events_rx) -> msg => match msg { Ok( DebounceEventResult::Ok(event)) => { + if drop_event { + debug!(self.logger, "dropping event because drop_event was true"; "event" => ?event); + continue + } let paths = self.process_watch_events(event); if !paths.is_empty() { if let Err(e) = self.filtered_events_tx.send(paths) { @@ -527,8 +562,7 @@ mod tests { drop(temp); } - #[cfg(target_os = "macos")] - fn macos_eat_late_notifications(watcher: &mut Watch) { + fn mk_test_watch() -> Watch { // Sometimes a brand new watch will send a CREATE notification // for a file which was just created, even if the watch was // created after the file was made. @@ -539,23 +573,17 @@ mod tests { // // Note, this is racey in the kernel. Otherwise I'd assert // this is empty. - sleep(WATCHER_TIMEOUT); - watcher.event_rx.try_iter(); - } - - #[cfg(not(target_os = "macos"))] - fn macos_eat_late_notifications(watcher: &mut Watch) { - // If we're supposedly dealing with a late notification on - // macOS, we'd better not receive any messages on other - // platforms. - // - // If we do receive any notifications, our test is broken. - assert_none_within(watcher, WATCHER_TIMEOUT); + (if cfg!(target_os = "macos") { + Watch::new_impl(&crate::logging::test_logger(), Some(WATCHER_TIMEOUT)) + } else { + Watch::new_impl(&crate::logging::test_logger(), None) + }) + .expect("failed creating watch") } #[test] fn trivial_watch_whole_directory() { - let watcher = Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = mk_test_watch(); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -574,7 +602,7 @@ mod tests { #[test] fn trivial_watch_directory_not_recursively() { - let watcher = Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = mk_test_watch(); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -590,11 +618,9 @@ mod tests { assert_none_within(&watcher, WATCHER_TIMEOUT); }) } - #[test] fn trivial_watch_specific_file() { - let mut watcher = - Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = mk_test_watch(); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -603,7 +629,6 @@ mod tests { .add_to_watch_tx .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) .unwrap(); - macos_eat_late_notifications(&mut watcher); expect_bash(r#"echo 1 > "$1/foo""#, [t]); sleep(WATCHER_TIMEOUT); @@ -616,8 +641,7 @@ mod tests { #[test] fn rename_over_vim() { // Vim renames files in to place for atomic writes - let mut watcher = - Watch::new(&crate::logging::test_logger()).expect("failed creating Watch"); + let watcher = mk_test_watch(); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -626,7 +650,6 @@ mod tests { .add_to_watch_tx .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) .unwrap(); - macos_eat_late_notifications(&mut watcher); // bar is not watched, expect error expect_bash(r#"echo 1 > "$1/bar""#, [t]); From 45d83d9d0b436c806fb2b59fe9956b09b588718d Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 16:26:19 +0200 Subject: [PATCH 6/9] feat(tests): add test name to logger messages We put every test in a sublogger and add its test name, to aid in debugging. --- src/builder.rs | 6 +++--- src/logging.rs | 4 ++-- src/nix.rs | 6 +++--- src/run_async.rs | 17 ++++++++++++----- src/watch.rs | 17 ++++++++++------- tests/integration/direnvtestcase.rs | 2 +- tests/shell/main.rs | 2 +- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 95eb00e7..6ca51151 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -589,7 +589,7 @@ in {} &crate::NixFile::from(cas.file_from_string(&nix_drv)?), &cas, &NixOptions::empty(), - &crate::logging::test_logger(), + &crate::logging::test_logger("non_utf8_nix_output"), ) .expect("should not crash!"); Ok(()) @@ -610,7 +610,7 @@ in {} &d, &cas, &NixOptions::empty(), - &crate::logging::test_logger(), + &crate::logging::test_logger("gracefully_handle_failing_build"), ) { } else { assert!( @@ -673,7 +673,7 @@ dir-as-source = ./dir; &NixFile::from(AbsPathBuf::new(shell).unwrap()), &cas, &NixOptions::empty(), - &crate::logging::test_logger(), + &crate::logging::test_logger("no_unnecessary_files_or_directories_watched"), ) .unwrap(); let ends_with = |end| { diff --git a/src/logging.rs b/src/logging.rs index 06cb6d40..d1d1f228 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -17,8 +17,8 @@ pub fn root(verbosity: Verbosity) -> slog::Logger { } /// Logger that can be used in tests -pub fn test_logger() -> slog::Logger { - lorri_logger(slog::Level::Trace) +pub fn test_logger(name: &str) -> slog::Logger { + lorri_logger(slog::Level::Trace).new(slog::o!("lorri_test" => name.to_string())) } fn lorri_logger(level: slog::Level) -> slog::Logger { diff --git a/src/nix.rs b/src/nix.rs index 68e2204a..e8a289bc 100644 --- a/src/nix.rs +++ b/src/nix.rs @@ -240,7 +240,7 @@ impl<'a> CallOpts<'a> { /// import {} /// "#) /// .attribute("hello") - /// .path(&lorri::logging::test_logger()) + /// .path(&lorri::logging::test_logger("doctest_path_1")) /// .unwrap() /// ; /// @@ -270,7 +270,7 @@ impl<'a> CallOpts<'a> { /// let paths = nix::CallOpts::expression(r#" /// { inherit (import {}) hello git; } /// "#) - /// .path(&lorri::logging::test_logger()); + /// .path(&lorri::logging::test_logger("doctest_path_2")); /// /// match paths { /// Err(BuildError::Output { .. }) => {}, @@ -310,7 +310,7 @@ impl<'a> CallOpts<'a> { /// let (paths, gc_root) = nix::CallOpts::expression(r#" /// { inherit (import {}) hello git; } /// "#) - /// .paths(&lorri::logging::test_logger()) + /// .paths(&lorri::logging::test_logger("doctest_paths")) /// .unwrap(); /// let mut paths = paths /// .into_iter() diff --git a/src/run_async.rs b/src/run_async.rs index dc77aaac..f9e18107 100644 --- a/src/run_async.rs +++ b/src/run_async.rs @@ -162,7 +162,9 @@ mod tests { fn test_chan_drop_order() { // we make the async just block on a channel which we can control from outside let (tx, rx) = chan::bounded(1); - let a = Async::run(&crate::logging::test_logger(), move || rx.recv()); + let a = Async::run(&crate::logging::test_logger("chan_drop_order"), move || { + rx.recv() + }); let c = a.chan(); // nothing has been sent to the thread yet, so timeout assert_eq!( @@ -182,7 +184,10 @@ mod tests { #[test] fn test_chan_block_still_works() { // check that even after getting a channel the blocking still works - let a = Async::run(&crate::logging::test_logger(), move || 42); + let a = Async::run( + &crate::logging::test_logger("chan_block_still_works"), + move || 42, + ); let c = a.chan(); assert_eq!(a.block(), 42); // would be disconnected, because the result was already retrieved by the block @@ -202,12 +207,14 @@ mod tests { let was_stopped = Arc::new(AtomicBool::new(false)); let was_stopped2 = was_stopped.clone(); - let a = - Async::run_with_stop_signal(&crate::logging::test_logger(), move |stop_signal_rx| { + let a = Async::run_with_stop_signal( + &crate::logging::test_logger("stop_signal"), + move |stop_signal_rx| { chan::select! { recv(stop_signal_rx) -> _ => { was_stopped2.store(true, Ordering::Relaxed) } } - }); + }, + ); drop(a); assert_eq!(was_stopped.load(Ordering::Relaxed), true) diff --git a/src/watch.rs b/src/watch.rs index 04e24704..95ce086d 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -562,7 +562,7 @@ mod tests { drop(temp); } - fn mk_test_watch() -> Watch { + fn mk_test_watch(test_name: &str) -> Watch { // Sometimes a brand new watch will send a CREATE notification // for a file which was just created, even if the watch was // created after the file was made. @@ -574,16 +574,19 @@ mod tests { // Note, this is racey in the kernel. Otherwise I'd assert // this is empty. (if cfg!(target_os = "macos") { - Watch::new_impl(&crate::logging::test_logger(), Some(WATCHER_TIMEOUT)) + Watch::new_impl( + &crate::logging::test_logger(test_name), + Some(WATCHER_TIMEOUT), + ) } else { - Watch::new_impl(&crate::logging::test_logger(), None) + Watch::new_impl(&crate::logging::test_logger(test_name), None) }) .expect("failed creating watch") } #[test] fn trivial_watch_whole_directory() { - let watcher = mk_test_watch(); + let watcher = mk_test_watch("trivial_watch_whole_directory"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -602,7 +605,7 @@ mod tests { #[test] fn trivial_watch_directory_not_recursively() { - let watcher = mk_test_watch(); + let watcher = mk_test_watch("trivial_watch_directory_not_recursively"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -620,7 +623,7 @@ mod tests { } #[test] fn trivial_watch_specific_file() { - let watcher = mk_test_watch(); + let watcher = mk_test_watch("trivial_watch_specific_file"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -641,7 +644,7 @@ mod tests { #[test] fn rename_over_vim() { // Vim renames files in to place for atomic writes - let watcher = mk_test_watch(); + let watcher = mk_test_watch("rename_over_vim"); with_test_tempdir(|t| { expect_bash(r#"mkdir -p "$1""#, [t]); diff --git a/tests/integration/direnvtestcase.rs b/tests/integration/direnvtestcase.rs index 57ad9553..e2d4604d 100644 --- a/tests/integration/direnvtestcase.rs +++ b/tests/integration/direnvtestcase.rs @@ -46,7 +46,7 @@ impl DirenvTestCase { projectdir, cachedir: cachedir_tmp, project, - logger: lorri::logging::test_logger(), + logger: lorri::logging::test_logger("direnv_test_case"), } } diff --git a/tests/shell/main.rs b/tests/shell/main.rs index 7f686737..b7694ba3 100644 --- a/tests/shell/main.rs +++ b/tests/shell/main.rs @@ -47,7 +47,7 @@ fn loads_env() { .expect("fail to run lorri shell"); assert!(res.status.success(), "lorri shell command failed"); - let logger = lorri::logging::test_logger(); + let logger = lorri::logging::test_logger("loads_env"); let output = ops::bash_cmd(build(&project, &logger), &project.cas, &logger) .unwrap() From e3f0e4b167dc2353dc5b7002af82a10b33441a8a Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 16:45:06 +0200 Subject: [PATCH 7/9] feat(watcher): add test name to test dirs --- src/watch.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/watch.rs b/src/watch.rs index 95ce086d..bd6f0850 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -551,14 +551,14 @@ mod tests { } /// Create a tempdir for our test and drop it after the function runs. - fn with_test_tempdir(f: F) + fn with_test_tempdir(test_name: &str, f: F) where F: FnOnce(&std::path::Path), { let temp: TempDir = tempdir().unwrap(); // TODO: We use a subdirectory for our tests, because the watcher (for whatever reason) also watches the parent directory, which means we start watching `/tmp` in our tests … - f(&temp.path().join("testdir")); + f(&temp.path().join("testdir_of_".to_string() + test_name)); drop(temp); } @@ -587,7 +587,7 @@ mod tests { #[test] fn trivial_watch_whole_directory() { let watcher = mk_test_watch("trivial_watch_whole_directory"); - with_test_tempdir(|t| { + with_test_tempdir("trivial_watch_whole_directory", |t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); watcher @@ -606,7 +606,7 @@ mod tests { #[test] fn trivial_watch_directory_not_recursively() { let watcher = mk_test_watch("trivial_watch_directory_not_recursively"); - with_test_tempdir(|t| { + with_test_tempdir("trivial_watch_directory_not_recursively", |t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); watcher @@ -625,7 +625,7 @@ mod tests { fn trivial_watch_specific_file() { let watcher = mk_test_watch("trivial_watch_specific_file"); - with_test_tempdir(|t| { + with_test_tempdir("trivial_watch_specific_file", |t| { expect_bash(r#"mkdir -p "$1""#, [t]); expect_bash(r#"touch "$1/foo""#, [t]); watcher @@ -646,7 +646,7 @@ mod tests { // Vim renames files in to place for atomic writes let watcher = mk_test_watch("rename_over_vim"); - with_test_tempdir(|t| { + with_test_tempdir("rename_over_vim", |t| { expect_bash(r#"mkdir -p "$1""#, [t]); expect_bash(r#"touch "$1/foo""#, [t]); watcher @@ -674,7 +674,7 @@ mod tests { #[test] fn walk_path_topo_filetree() { - with_test_tempdir(|t| { + with_test_tempdir("walk_path_topo_filetree", |t| { let files = vec![("a", "b"), ("a", "c"), ("a/d", "e"), ("x/y", "z")]; for (dir, file) in files { std::fs::create_dir_all(t.join(dir)).unwrap(); From 6d5a1549ecb7c7d679e2d662664815c667c08a00 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 16:50:13 +0200 Subject: [PATCH 8/9] feat(watcher): log subparts of rename_over_vim --- src/watch.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/watch.rs b/src/watch.rs index bd6f0850..b693a6f3 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -417,6 +417,7 @@ fn walk_path_topo(path: PathBuf) -> Result, std::io::Error> { #[cfg(test)] mod tests { use super::{Watch, WatchPathBuf}; + use slog::info; use std::ffi::OsStr; use std::path::PathBuf; use std::thread::sleep; @@ -645,6 +646,7 @@ mod tests { fn rename_over_vim() { // Vim renames files in to place for atomic writes let watcher = mk_test_watch("rename_over_vim"); + let logger = &crate::logging::test_logger("rename_over_vim"); with_test_tempdir("rename_over_vim", |t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -654,19 +656,19 @@ mod tests { .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) .unwrap(); - // bar is not watched, expect error + info!(logger, "bar is not watched, expect error"); expect_bash(r#"echo 1 > "$1/bar""#, [t]); assert_none_within(&watcher, WATCHER_TIMEOUT); - // Rename bar to foo, expect a notification + info!(logger, "Rename bar to foo, expect a notification"); expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); - // Do it a second time + info!(logger, "Do it a second time"); expect_bash(r#"echo 1 > "$1/bar""#, [t]); assert_none_within(&watcher, WATCHER_TIMEOUT); - // Rename bar to foo, expect a notification + info!(logger, "Rename bar to foo, expect a notification"); expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); }) From 05ce2c9f2196114193f912fa5864a804edd5db02 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 Apr 2024 17:26:10 +0200 Subject: [PATCH 9/9] fix(watcher): only watch /bar to work around macos notify race MacOS has some delay between any change and when the watcher actually notices it. So it would always show the creation of foo when we want to make sure `bar` does not get watched, leading to the test failing. Instead, filter out every file that is not `/bar` here, which should be fine. --- src/watch.rs | 58 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/src/watch.rs b/src/watch.rs index b693a6f3..83ee38a0 100644 --- a/src/watch.rs +++ b/src/watch.rs @@ -417,7 +417,7 @@ fn walk_path_topo(path: PathBuf) -> Result, std::io::Error> { #[cfg(test)] mod tests { use super::{Watch, WatchPathBuf}; - use slog::info; + use slog::{debug, info}; use std::ffi::OsStr; use std::path::PathBuf; use std::thread::sleep; @@ -517,13 +517,29 @@ mod tests { } /// Assert no watcher event happens until the timeout - fn assert_none_within(watch: &Watch, timeout: Duration) { + /// + /// If file_suffixes_opt is given, only these files will be checked for. + fn assert_none_within( + watch: &Watch, + timeout: Duration, + file_suffixes_opt: Option<&[&str]>, + logger: &slog::Logger, + ) { let res = watch.watch_events_rx.recv_timeout(timeout); match res { Err(_) => (), Ok(watch_result) => { + if let Some(file_suffixes) = file_suffixes_opt { + if !watch_result + .iter() + .any(|res| file_suffixes.into_iter().any(|suff| res.ends_with(suff))) + { + debug!(logger, "ignoring event not part of ignore filter"; "watch_result" => ?watch_result, "file_suffixes" => ?file_suffixes); + } + } panic!( - "expected no file change notification for; but these files changed: {:?}", + "expected no file change notification for suffixes {:?}; but these files changed: {:?}", + file_suffixes_opt, watch_result ); } @@ -563,7 +579,7 @@ mod tests { drop(temp); } - fn mk_test_watch(test_name: &str) -> Watch { + fn mk_test_watch(logger: &slog::Logger) -> Watch { // Sometimes a brand new watch will send a CREATE notification // for a file which was just created, even if the watch was // created after the file was made. @@ -575,19 +591,17 @@ mod tests { // Note, this is racey in the kernel. Otherwise I'd assert // this is empty. (if cfg!(target_os = "macos") { - Watch::new_impl( - &crate::logging::test_logger(test_name), - Some(WATCHER_TIMEOUT), - ) + Watch::new_impl(logger, Some(WATCHER_TIMEOUT)) } else { - Watch::new_impl(&crate::logging::test_logger(test_name), None) + Watch::new_impl(logger, None) }) .expect("failed creating watch") } #[test] fn trivial_watch_whole_directory() { - let watcher = mk_test_watch("trivial_watch_whole_directory"); + let logger = crate::logging::test_logger("trivial_watch_whole_directory"); + let watcher = mk_test_watch(&logger); with_test_tempdir("trivial_watch_whole_directory", |t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -606,7 +620,8 @@ mod tests { #[test] fn trivial_watch_directory_not_recursively() { - let watcher = mk_test_watch("trivial_watch_directory_not_recursively"); + let logger = crate::logging::test_logger("trivial_watch_directory_not_recursively"); + let watcher = mk_test_watch(&logger); with_test_tempdir("trivial_watch_directory_not_recursively", |t| { expect_bash(r#"mkdir -p "$1"/foo"#, [t]); expect_bash(r#"touch "$1"/foo/bar"#, [t]); @@ -619,12 +634,13 @@ mod tests { assert_file_changed_within(&watcher, "baz", WATCHER_TIMEOUT); expect_bash(r#"echo 1 > "$1/foo/bar""#, [t]); - assert_none_within(&watcher, WATCHER_TIMEOUT); + assert_none_within(&watcher, WATCHER_TIMEOUT, None, &logger); }) } #[test] fn trivial_watch_specific_file() { - let watcher = mk_test_watch("trivial_watch_specific_file"); + let logger = crate::logging::test_logger("trivial_watch_specific_file"); + let watcher = mk_test_watch(&logger); with_test_tempdir("trivial_watch_specific_file", |t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -645,8 +661,8 @@ mod tests { #[test] fn rename_over_vim() { // Vim renames files in to place for atomic writes - let watcher = mk_test_watch("rename_over_vim"); - let logger = &crate::logging::test_logger("rename_over_vim"); + let logger = crate::logging::test_logger("rename_over_vim"); + let watcher = mk_test_watch(&logger); with_test_tempdir("rename_over_vim", |t| { expect_bash(r#"mkdir -p "$1""#, [t]); @@ -656,19 +672,19 @@ mod tests { .send(vec![WatchPathBuf::Recursive(t.join("foo"))]) .unwrap(); - info!(logger, "bar is not watched, expect error"); + info!(&logger, "bar is not watched, expect error"); expect_bash(r#"echo 1 > "$1/bar""#, [t]); - assert_none_within(&watcher, WATCHER_TIMEOUT); + assert_none_within(&watcher, WATCHER_TIMEOUT, Some(&vec!["/bar"]), &logger); - info!(logger, "Rename bar to foo, expect a notification"); + info!(&logger, "Rename bar to foo, expect a notification"); expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); - info!(logger, "Do it a second time"); + info!(&logger, "Do it a second time"); expect_bash(r#"echo 1 > "$1/bar""#, [t]); - assert_none_within(&watcher, WATCHER_TIMEOUT); + assert_none_within(&watcher, WATCHER_TIMEOUT, None, &logger); - info!(logger, "Rename bar to foo, expect a notification"); + info!(&logger, "Rename bar to foo, expect a notification"); expect_bash(r#"mv "$1/bar" "$1/foo""#, [t]); assert_file_changed_within(&watcher, "foo", WATCHER_TIMEOUT); })