fix exec env undefined removals#107248
Conversation
steipete
left a comment
There was a problem hiding this comment.
Current head does not fix the full regression. The new undefined-value behavior belongs in exec-spawn.ts, but #103918 also added duplicate assignChildEnvValue / mergeChildEnv helpers to exec.ts; they are unused because runExec delegates to exec-runner.ts.
That leaves check-prod-types and check-lint failing at src/process/exec.ts:41 (mergeChildEnv is declared but never read), while the process test shard still fails the two undefined-env assertions until this PR's exec-spawn.ts change is applied. Please also delete the duplicate helpers from exec.ts; then this remains one canonical env merge path.
|
Landed the complete fix in #107258 / 489690f. Your Closing this PR because the branch was not maintainer-writable. Thank you, @pgondhi987. For future PRs, enabling Allow edits by maintainers lets us apply small fixups directly. |
Summary
Fix
resolveCommandEnvso child env entries set toundefinedremove inherited/base values instead of being ignored.Root cause
The active env merge implementation in
src/process/exec-spawn.tsreturned early forundefinedvalues. That left inherited values in place, including case-insensitive Windows duplicates such asPathwhenPATHwas set toundefined.Validation
pnpm exec vitest run src/process/exec.test.ts