From d2dc61cddfcc6645f7ac8a64c0baeeba3d98e2f5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Jul 2026 10:36:58 -0400 Subject: [PATCH] chore(process): drop Bun spawn-encoding workaround (fixed upstream in oven-sh/bun#36050) (#114606) --- src/process/exec-spawn.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/process/exec-spawn.ts b/src/process/exec-spawn.ts index 8b347e684c6e..3a02025a586d 100644 --- a/src/process/exec-spawn.ts +++ b/src/process/exec-spawn.ts @@ -69,14 +69,6 @@ export function spawnCommandWithInvocation< invocation: ReturnType; } { const { baseEnv, env, windowsVerbatimArguments, ...execaOptions } = options; - // Bun workaround (oven-sh/bun#36049): execa forwards its whole options object to - // child_process.spawn. Node ignores the extra `encoding` key there, but Bun's - // spawn feeds it into its stream constructor and throws ERR_UNKNOWN_ENCODING for - // execa's "buffer". Clearing it under Bun means buffered results arrive as utf8 - // strings instead of Buffers; callers already normalize via Buffer.from. Binary- - // exact output paths are unverified under Bun. Remove once the Bun issue is fixed. - const dropBufferEncodingForBun = - Boolean(process.versions.bun) && execaOptions.encoding === "buffer"; const commandEnv = resolveCommandEnv({ argv, baseEnv, env }); const invocation = resolveSafeChildProcessInvocation({ argv, @@ -86,7 +78,6 @@ export function spawnCommandWithInvocation< }); const child = execa(invocation.command, invocation.args, { ...execaOptions, - ...(dropBufferEncodingForBun ? { encoding: undefined } : {}), env: commandEnv, extendEnv: false, shell: false,