1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Revert "chore: use kqueue backend of notify on macOS" (#21039)

Reverts denoland/deno#21028

Reason:
https://github.com/notify-rs/notify/blob/main/notify/src/kqueue.rs#L79-L81
Need to wait for the watcher thread to spawn otherwise we hit flakes

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit is contained in:
Divy Srivastava 2023-11-01 08:54:27 -07:00 committed by GitHub
parent 8ea2d926a9
commit 82643857cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 13 deletions

42
Cargo.lock generated
View file

@ -760,11 +760,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 0.1.10",
"crossbeam-channel", "crossbeam-channel 0.4.4",
"crossbeam-deque", "crossbeam-deque",
"crossbeam-epoch", "crossbeam-epoch",
"crossbeam-queue", "crossbeam-queue",
"crossbeam-utils", "crossbeam-utils 0.7.2",
] ]
[[package]] [[package]]
@ -773,10 +773,20 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
dependencies = [ dependencies = [
"crossbeam-utils", "crossbeam-utils 0.7.2",
"maybe-uninit", "maybe-uninit",
] ]
[[package]]
name = "crossbeam-channel"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils 0.8.16",
]
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.7.4" version = "0.7.4"
@ -784,7 +794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed"
dependencies = [ dependencies = [
"crossbeam-epoch", "crossbeam-epoch",
"crossbeam-utils", "crossbeam-utils 0.7.2",
"maybe-uninit", "maybe-uninit",
] ]
@ -796,7 +806,7 @@ checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if 0.1.10", "cfg-if 0.1.10",
"crossbeam-utils", "crossbeam-utils 0.7.2",
"lazy_static", "lazy_static",
"maybe-uninit", "maybe-uninit",
"memoffset 0.5.6", "memoffset 0.5.6",
@ -810,7 +820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 0.1.10",
"crossbeam-utils", "crossbeam-utils 0.7.2",
"maybe-uninit", "maybe-uninit",
] ]
@ -825,6 +835,15 @@ dependencies = [
"lazy_static", "lazy_static",
] ]
[[package]]
name = "crossbeam-utils"
version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [
"cfg-if 1.0.0",
]
[[package]] [[package]]
name = "crunchy" name = "crunchy"
version = "0.2.2" version = "0.2.2"
@ -2610,6 +2629,15 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "fsevent-sys"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "fslock" name = "fslock"
version = "0.1.8" version = "0.1.8"
@ -3669,7 +3697,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed2c66da08abae1c024c01d635253e402341b4060a12e99b31c7594063bf490a" checksum = "ed2c66da08abae1c024c01d635253e402341b4060a12e99b31c7594063bf490a"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"crossbeam-channel 0.5.8",
"filetime", "filetime",
"fsevent-sys",
"inotify", "inotify",
"kqueue", "kqueue",
"libc", "libc",

View file

@ -110,8 +110,7 @@ log = "=0.4.20"
lsp-types = "=0.94.1" # used by tower-lsp and "proposed" feature is unstable in patch releases lsp-types = "=0.94.1" # used by tower-lsp and "proposed" feature is unstable in patch releases
memmem = "0.1.1" memmem = "0.1.1"
monch = "=0.4.3" monch = "=0.4.3"
# Note: Do not use the "macos_fsevent" feature of notify, as it links us to CoreFoundation on macOS. notify = "=5.0.0"
notify = { version = "=5.0.0", default-features = false, features = ["macos_kqueue"] }
num-bigint = { version = "0.4", features = ["rand"] } num-bigint = { version = "0.4", features = ["rand"] }
once_cell = "1.17.1" once_cell = "1.17.1"
os_pipe = "=1.1.4" os_pipe = "=1.1.4"

View file

@ -43,9 +43,13 @@ fn macos_shared_libraries() {
use test_util as util; use test_util as util;
// target/release/deno: // target/release/deno:
// /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.1.0)
// /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1228.0.0)
// /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) // /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
// /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0) // /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
const EXPECTED: [&str; 3] = [ const EXPECTED: [&str; 5] = [
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices",
"/usr/lib/libiconv.2.dylib", "/usr/lib/libiconv.2.dylib",
"/usr/lib/libSystem.B.dylib", "/usr/lib/libSystem.B.dylib",
"/usr/lib/libobjc.A.dylib", "/usr/lib/libobjc.A.dylib",

View file

@ -70,7 +70,6 @@
"test-fs-open.js", "test-fs-open.js",
"test-fs-opendir.js", "test-fs-opendir.js",
"test-fs-rmdir-recursive.js", "test-fs-rmdir-recursive.js",
"test-fs-watchfile.js",
"test-fs-write-file.js", "test-fs-write-file.js",
"test-fs-write.js", "test-fs-write.js",
"test-http-url.parse-https.request.js", "test-http-url.parse-https.request.js",

View file

@ -107,6 +107,6 @@ if (common.isLinux || common.isOSX || common.isWindows) {
fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall((err) => { fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall((err) => {
if (err) assert.fail(err); if (err) assert.fail(err);
})); }));
}, 20); }, 1);
})); }));
} }

View file

@ -22,7 +22,7 @@ Deno.test({ permissions: { read: true } }, function watchFsInvalidPath() {
} else { } else {
assertThrows(() => { assertThrows(() => {
Deno.watchFs("non-existent.file"); Deno.watchFs("non-existent.file");
}, Error); }, Deno.errors.NotFound);
} }
}); });
@ -32,7 +32,7 @@ async function getTwoEvents(
const events = []; const events = [];
for await (const event of iter) { for await (const event of iter) {
events.push(event); events.push(event);
if (events.length == 2) break; if (events.length > 2) break;
} }
return events; return events;
} }