GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — child_process: inherit a reassigned process.env by everett1992 · Pull Request #66883 · nodejs/node Conversation
Contributor
Since #65325 (first released in v26.11.0), spawning a child without This keeps the fast path for the common case and only takes it while
Since this is a v26.11.0 regression, it would be good to land it before v26 goes LTS on 2026-10-28. I used Claude Code to write the patch, the test and this description. I reviewed the change and ran the new and existing child_process tests locally.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.
Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.
Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <[email protected]>
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #66883 +/- ## ========================================== + Coverage 90.50% 90.51% +0.01% ========================================== Files 797 797 Lines 278268 278369 +101 Branches 53468 53482 +14 ========================================== + Hits 251838 251963 +125 + Misses 16813 16765 -48 - Partials 9617 9641 +24
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/child_process @codebytere @@aduh95 @jasnell — this fixes #66882, a regression from #65325 where a reassigned process.env is no longer inherited by children. It keeps the fast path for the common case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI is green (node-test-pull-request/78765) and this has two approvals. Could someone add commit-queue? @addaleax |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 2aef805 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.
Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.
Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <[email protected]>
PR-URL: #66883
Fixes: #66882
Refs: #65325
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.
Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.
Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <[email protected]>
PR-URL: #66883
Fixes: #66882
Refs: #65325
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.
Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.
Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <[email protected]>
PR-URL: #66883
Fixes: #66882
Refs: #65325
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Extend Arch's prepare() instead of redefining it, preserving the OpenSSL 4.x test and child-process environment backports. The duplicate function silently discarded both, leaving test-x509-escaping expecting 'good.example.com' where OpenSSL 4.1 returns undefined. https://gitlab.archlinux.org/archlinux/packaging/packages/nodejs/-/blob/26.13.1-1/PKGBUILD nodejs/node#66775 nodejs/node#66883 https://archriscv.felixc.at/.status/logs/nodejs/nodejs-26.13.1-1.log
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.
Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.
Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <[email protected]>
PR-URL: nodejs#66883
Fixes: nodejs#66882
Refs: nodejs#65325
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
child_process: default env ignores a reassigned process.env since v26.11.0
There was an error while loading. Please reload this page.