mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-18 02:42:25 +02:00
The repo's first patchedDependencies entry. playwright-core's bundled process launcher (lib/coreBundle.js in the 1.62.x layout) spawns browser children without windowsHide — Node defaults it to FALSE for child_process.spawn — so Chromium children could flash a console window on Windows, and its force-kill path shells `taskkill /pid <pid> /T /F` through cmd.exe with the same omission. Both sites now pass windowsHide: true via patches/playwright-core@1.62.1.patch (generated with `bun patch` / `bun patch --commit`). Coherence verified end-to-end: rm -rf node_modules && bun install applies the patch cleanly (both sites present in the reinstalled tree), and a real chromium.launch() through the patched bundle works. browse/test/playwright-core-patch.test.ts pins the three-legged invariant statically — package.json's patchedDependencies key is VERSION-KEYED against the installed playwright-core, the patch file exists and carries both sites, bun.lock records the patch, and the installed bundle actually has it applied — so a future playwright bump that forgets to re-target the patch fails CI with the exact key to regenerate (revert pairing: dropping the c25 bump requires dropping this patch too). Tests: playwright-core-patch 4 pass, 0 fail. Fixes #2160, #1989. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
994b5f5502
commit
436adb72d3
@@ -0,0 +1,24 @@
|
||||
diff --git a/lib/coreBundle.js b/lib/coreBundle.js
|
||||
index d9041dd0f009072511a7d808dec83121ff29e127..e5c72c452c98f1c64038c5f24ac5805fbc99151f 100644
|
||||
--- a/lib/coreBundle.js
|
||||
+++ b/lib/coreBundle.js
|
||||
@@ -8906,6 +8906,10 @@ async function launchProcess(options) {
|
||||
env: options.env,
|
||||
cwd: options.cwd,
|
||||
shell: options.shell,
|
||||
+ // gstack patch (#2160/#1989): Node defaults windowsHide to false for
|
||||
+ // child_process.spawn, so browser children could flash a console window
|
||||
+ // on Windows. Playwright never needs the child's window shown.
|
||||
+ windowsHide: true,
|
||||
stdio
|
||||
};
|
||||
const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions);
|
||||
@@ -8985,7 +8989,7 @@ async function launchProcess(options) {
|
||||
options.log(`[pid=${spawnedProcess.pid}] <will force kill>`);
|
||||
try {
|
||||
if (process.platform === "win32") {
|
||||
- const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true });
|
||||
+ const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true, windowsHide: true });
|
||||
const [stdout2, stderr2] = [taskkillProcess.stdout.toString(), taskkillProcess.stderr.toString()];
|
||||
if (stdout2)
|
||||
options.log(`[pid=${spawnedProcess.pid}] taskkill stdout: ${stdout2}`);
|
||||
Reference in New Issue
Block a user