Skip to content

[v24.x] child_process: inherit a reassigned process.env - #67974

Closed
Appdev14 wants to merge 1 commit into
nodejs:v24.xfrom
Appdev14:fix/child-process-reassigned-env-v24-67954
Closed

Appdev14 wants to merge 1 commit into
nodejs:v24.xfrom
Appdev14:fix/child-process-reassigned-env-v24-67954

Conversation

@Appdev14

@Appdev14 Appdev14 commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

  • Backport the already-merged main-branch fix from child_process: inherit a reassigned process.env #66883 to v24.x.
  • Pass process.env to the native getEnvPairs() fast path so it can identify whether the original env proxy is still in use.
  • Fall back to copying the current process.env object when it has been reassigned.
  • Add the same regression test used by the merged main-branch fix, covering spawn, exec, execFile, fork, PATH lookup, and parity with an explicit env option.

Fixes #67954.

Upstream fix: #66883 (merged to main on November 10, 2026). The issue reporter specifically notes that this fix needs to be backported to v24.x.

Validation

  • Verified that the v24.x JS and native code did not contain the main-branch fix.
  • Verified that env_proxy_ctor_template()->HasInstance(...) is already used by the v24.x codebase, so the native check uses an existing API.
  • The Node.js build and test suite were not run in this environment.
  • This PR remains closed because a Node.js maintainer identified it as a duplicate of [v24.x backport] child_process: inherit a reassigned process.env #67921 and stated that a new PR was not necessary.
Was generative AI tooling used to co-author this PR?

Yes. ChatGPT (GPT-6) assisted with issue analysis, implementation, regression-test drafting, and this PR description.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch. labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

@Renegade334

Copy link
Copy Markdown
Member

Duplicate of #67921, and that clearly states that a new PR isn't necessary.

@Renegade334 Renegade334 closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentscan:automated-account c++ Issues and PRs that require attention from people who are familiar with C++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants