Fix running Bun.spawn on Vercel and GCP (#6724)

* Fix running `Bun.spawn` on Vercel and GCP

* Update subprocess.zig

* Deflake test

* Update spawn-streaming-stdout.test.ts

* Fix tests + cleanup

* Fix hang

* Handle edgecase

* Update subprocess.zig

* Update subprocess.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-10-27 00:03:03 -07:00
committed by GitHub
parent 58d9a0d770
commit 46a337cbc8
9 changed files with 445 additions and 156 deletions

View File

@@ -739,6 +739,13 @@ pub const VirtualMachine = struct {
}
if (map.get("BUN_GARBAGE_COLLECTOR_LEVEL")) |gc_level| {
// Reuse this flag for other things to avoid unnecessary hashtable
// lookups on start for obscure flags which we do not want others to
// depend on.
if (map.get("BUN_FEATURE_FLAG_FORCE_WAITER_THREAD") != null) {
JSC.Subprocess.WaiterThread.setShouldUseWaiterThread();
}
if (strings.eqlComptime(gc_level, "1")) {
this.aggressive_garbage_collection = .mild;
} else if (strings.eqlComptime(gc_level, "2")) {