fix(coding-agent): disable .env autoload in standalone binary

Bun compiled executables load cwd .env files into process.env by default.
closes #10473
This commit is contained in:
Armin Ronacher 2026-10-06 09:57:14 +02:00
parent 9ad083102a
commit 1ffb6bd621
3 changed files with 6 additions and 4 deletions

View file

@ -127,11 +127,12 @@ for platform in "${PLATFORMS[@]}"; do
# for the worker specifiers in the runtime to resolve.
#
# Disable cwd bunfig.toml autoload so project preload scripts cannot crash the
# standalone binary before pi starts (see #7684).
# standalone binary before pi starts (see #7684). Disable cwd .env autoload so
# project env files do not leak into pi's environment (see #10473).
if [[ "$platform" == windows-* ]]; then
bun build --compile --no-compile-autoload-bunfig --target="$bun_target" ./dist/bun/cli.js ./src/utils/image-resize-worker.ts ./src/extensions/codemode/worker.ts --outfile "$OUTPUT_DIR/$platform/pi.exe"
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target="$bun_target" ./dist/bun/cli.js ./src/utils/image-resize-worker.ts ./src/extensions/codemode/worker.ts --outfile "$OUTPUT_DIR/$platform/pi.exe"
else
bun build --compile --no-compile-autoload-bunfig --target="$bun_target" ./dist/bun/cli.js ./src/utils/image-resize-worker.ts ./src/extensions/codemode/worker.ts --outfile "$OUTPUT_DIR/$platform/pi"
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target="$bun_target" ./dist/bun/cli.js ./src/utils/image-resize-worker.ts ./src/extensions/codemode/worker.ts --outfile "$OUTPUT_DIR/$platform/pi"
fi
done