From d09789704a23f9ac403530b33d80363e13bd92b3 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 29 Nov 2024 19:29:49 -0500 Subject: [PATCH 1/5] fix(task): kill children when killing task process on Windows --- Cargo.lock | 85 ++++++++++++++++++++++++++++------------------- Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/io/bi_pipe.rs | 2 +- 4 files changed, 54 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e72dac0df4607..f4d9634d3ae156 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1652,7 +1652,7 @@ dependencies = [ "serde", "thiserror", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1742,7 +1742,7 @@ dependencies = [ "tokio", "uuid", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1830,7 +1830,7 @@ dependencies = [ "log", "napi_sym", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1949,7 +1949,7 @@ dependencies = [ "url", "webpki-root-certs", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "x25519-dalek", "x509-parser", "yoke", @@ -2118,7 +2118,7 @@ dependencies = [ "uuid", "which 4.4.2", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2136,9 +2136,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e09966ce29f8d26b652a43355397e1df43b85759e7824196bf0ceaeaa9a2f4" +checksum = "fa3763bc068e17b6d488fb73ecda463c13ef792b0a5288b6018bc2119becd635" dependencies = [ "anyhow", "futures", @@ -2149,6 +2149,7 @@ dependencies = [ "path-dedot", "thiserror", "tokio", + "windows-sys 0.59.0", ] [[package]] @@ -4500,7 +4501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8545,7 +8546,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8554,7 +8555,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8572,7 +8573,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -8592,17 +8602,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -8613,9 +8624,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -8625,9 +8636,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -8637,9 +8648,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -8649,9 +8666,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -8661,9 +8678,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -8673,9 +8690,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -8685,9 +8702,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" diff --git a/Cargo.toml b/Cargo.toml index 1ca9fcb66b7172..369e5015a52a90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -236,7 +236,7 @@ nix = "=0.27.1" # windows deps junction = "=0.2.0" winapi = "=0.3.9" -windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_Media", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_WindowsProgramming", "Wdk", "Wdk_System", "Wdk_System_SystemInformation", "Win32_Security", "Win32_System_Pipes", "Wdk_Storage_FileSystem", "Win32_System_Registry", "Win32_System_Kernel"] } +windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Media", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_WindowsProgramming", "Wdk", "Wdk_System", "Wdk_System_SystemInformation", "Win32_Security", "Win32_System_Pipes", "Wdk_Storage_FileSystem", "Win32_System_Registry", "Win32_System_Kernel", "Win32_System_Threading", "Win32_UI", "Win32_UI_Shell"] } winres = "=0.1.12" [profile.release] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a21e5d5c6873f0..bdc095188e8868 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -82,7 +82,7 @@ deno_path_util.workspace = true deno_resolver.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver.workspace = true -deno_task_shell = "=0.20.1" +deno_task_shell = "=0.20.2" deno_telemetry.workspace = true deno_terminal.workspace = true libsui = "0.5.0" diff --git a/ext/io/bi_pipe.rs b/ext/io/bi_pipe.rs index 3492e2f441e823..bf65d3037f6516 100644 --- a/ext/io/bi_pipe.rs +++ b/ext/io/bi_pipe.rs @@ -407,7 +407,7 @@ pub fn bi_pipe_pair_raw( &s, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, - 0, + std::ptr::null_mut(), ); if hd2 == INVALID_HANDLE_VALUE { return Err(io::Error::last_os_error()); From 1fd9eee87b9a28cc9de601655a7b5fd377618173 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 29 Nov 2024 19:33:26 -0500 Subject: [PATCH 2/5] Add test. --- .../__test__.jsonc | 5 ++ .../deno.jsonc | 5 ++ .../kill_task_windows_kills_children/main.ts | 75 +++++++++++++++++++ .../script.js | 3 + 4 files changed, 88 insertions(+) create mode 100644 tests/specs/task/kill_task_windows_kills_children/__test__.jsonc create mode 100644 tests/specs/task/kill_task_windows_kills_children/deno.jsonc create mode 100644 tests/specs/task/kill_task_windows_kills_children/main.ts create mode 100644 tests/specs/task/kill_task_windows_kills_children/script.js diff --git a/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc b/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc new file mode 100644 index 00000000000000..f83d24e9aa6555 --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "if": "windows", + "args": "run --check -A main.ts", + "output": "[WILDCARD]" // just ensure no failure +} diff --git a/tests/specs/task/kill_task_windows_kills_children/deno.jsonc b/tests/specs/task/kill_task_windows_kills_children/deno.jsonc new file mode 100644 index 00000000000000..ee8102bed5b0b3 --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/deno.jsonc @@ -0,0 +1,5 @@ +{ + "tasks": { + "start": "deno run -A script.js" + } +} diff --git a/tests/specs/task/kill_task_windows_kills_children/main.ts b/tests/specs/task/kill_task_windows_kills_children/main.ts new file mode 100644 index 00000000000000..351a7db6a36cba --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/main.ts @@ -0,0 +1,75 @@ +class StdoutReader { + readonly #reader: ReadableStreamDefaultReader; + text = ""; + + constructor(stream: ReadableStream) { + const textStream = stream.pipeThrough(new TextDecoderStream()); + this.#reader = textStream.getReader(); + } + + [Symbol.dispose]() { + this.#reader.releaseLock(); + } + + async waitForText(waitingText: string) { + if (this.text.includes(waitingText)) { + return; + } + + while (true) { + const { value, done } = await this.#reader.read(); + if (value) { + this.text += value; + if (this.text.includes(waitingText)) { + break; + } + } + if (done) { + throw new Error("Did not find text: " + waitingText); + } + } + } +} + +const command = new Deno.Command("deno", { + args: ["task", "start"], + stdout: "piped", +}); + +const child = command.spawn(); + +const reader = new StdoutReader(child.stdout!); +console.log("Waiting..."); +await reader.waitForText("Ready"); +console.log("Received."); +const pid = parseInt(reader.text.split("\n")[0], 10); +console.log("PID", pid); +// ensure this function works +if (!isPidAlive(child.pid)) { + throw new Error("Unexpected."); +} +if (!isPidAlive(pid)) { + throw new Error("Unexpected."); +} +child.kill(); +// now the grandchild shouldn't be alive +if (isPidAlive(pid)) { + throw new Error("Unexpected."); +} + +function isPidAlive(pid: number) { + const command = new Deno.Command("cmd", { + args: ["/c", `wmic process where processid=${pid} get processid`], + }); + + try { + const { stdout } = command.outputSync(); // Execute the command + const output = new TextDecoder().decode(stdout); + + console.log("wmic output:", output.trim()); + return output.includes(pid.toString()); + } catch (error) { + console.error("Error checking PID:", error); + return false; + } +} diff --git a/tests/specs/task/kill_task_windows_kills_children/script.js b/tests/specs/task/kill_task_windows_kills_children/script.js new file mode 100644 index 00000000000000..1a98d7280e23eb --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/script.js @@ -0,0 +1,3 @@ +console.log(Deno.pid); +console.log("Ready"); +setInterval(() => {}, 10_000); // stay alive From db110aff1246d7d3675c4e5fa11fde37133572c4 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 29 Nov 2024 19:46:00 -0500 Subject: [PATCH 3/5] update deps --- Cargo.lock | 85 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77dc2cb4c4a0ee..5a77b0a912d148 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1676,7 +1676,7 @@ dependencies = [ "serde", "thiserror 1.0.64", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1766,7 +1766,7 @@ dependencies = [ "tokio", "uuid", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1854,7 +1854,7 @@ dependencies = [ "log", "napi_sym", "thiserror 1.0.64", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1973,7 +1973,7 @@ dependencies = [ "url", "webpki-root-certs", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "x25519-dalek", "x509-parser", "yoke", @@ -2144,7 +2144,7 @@ dependencies = [ "uuid", "which 4.4.2", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2163,9 +2163,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e09966ce29f8d26b652a43355397e1df43b85759e7824196bf0ceaeaa9a2f4" +checksum = "fa3763bc068e17b6d488fb73ecda463c13ef792b0a5288b6018bc2119becd635" dependencies = [ "anyhow", "futures", @@ -2176,6 +2176,7 @@ dependencies = [ "path-dedot", "thiserror 1.0.64", "tokio", + "windows-sys 0.59.0", ] [[package]] @@ -4527,7 +4528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.48.5", ] [[package]] @@ -8592,7 +8593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8601,7 +8602,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8619,7 +8620,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -8639,17 +8649,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -8660,9 +8671,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -8672,9 +8683,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -8684,9 +8695,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -8696,9 +8713,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -8708,9 +8725,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -8720,9 +8737,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -8732,9 +8749,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" From c0e9b2975ec5db3f3861b3f2635e632141da33d9 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sun, 1 Dec 2024 12:45:54 -0500 Subject: [PATCH 4/5] simplify name --- cli/npm/managed/resolution.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/npm/managed/resolution.rs b/cli/npm/managed/resolution.rs index ecfe5cb25cdcf5..a27df1f1762b02 100644 --- a/cli/npm/managed/resolution.rs +++ b/cli/npm/managed/resolution.rs @@ -91,7 +91,7 @@ impl NpmResolution { ) -> AddPkgReqsResult { // only allow one thread in here at a time let snapshot_lock = self.snapshot.acquire().await; - let result = add_package_reqs_to_snapshot( + let result = add_package_reqs( &self.api, package_reqs, self.maybe_lockfile.clone(), @@ -119,7 +119,7 @@ impl NpmResolution { let snapshot_lock = self.snapshot.acquire().await; let reqs_set = package_reqs.iter().collect::>(); - let snapshot = add_package_reqs_to_snapshot( + let snapshot = add_package_reqs( &self.api, package_reqs, self.maybe_lockfile.clone(), @@ -259,7 +259,7 @@ impl NpmResolution { } } -async fn add_package_reqs_to_snapshot( +async fn add_package_reqs( api: &CliNpmRegistryApi, package_reqs: &[PackageReq], maybe_lockfile: Option>, From ee9f6c071edfa660df5703db5a0d22ce56967054 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sun, 1 Dec 2024 13:07:16 -0500 Subject: [PATCH 5/5] committed to the wrong pr lol --- cli/npm/managed/resolution.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/npm/managed/resolution.rs b/cli/npm/managed/resolution.rs index a27df1f1762b02..ecfe5cb25cdcf5 100644 --- a/cli/npm/managed/resolution.rs +++ b/cli/npm/managed/resolution.rs @@ -91,7 +91,7 @@ impl NpmResolution { ) -> AddPkgReqsResult { // only allow one thread in here at a time let snapshot_lock = self.snapshot.acquire().await; - let result = add_package_reqs( + let result = add_package_reqs_to_snapshot( &self.api, package_reqs, self.maybe_lockfile.clone(), @@ -119,7 +119,7 @@ impl NpmResolution { let snapshot_lock = self.snapshot.acquire().await; let reqs_set = package_reqs.iter().collect::>(); - let snapshot = add_package_reqs( + let snapshot = add_package_reqs_to_snapshot( &self.api, package_reqs, self.maybe_lockfile.clone(), @@ -259,7 +259,7 @@ impl NpmResolution { } } -async fn add_package_reqs( +async fn add_package_reqs_to_snapshot( api: &CliNpmRegistryApi, package_reqs: &[PackageReq], maybe_lockfile: Option>,