-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
env_clear
does not work on Windows
#31259
Comments
This is expected behavior because it appears that there are basically some required environment variables on Windows to get subprocesses to work. For example libuv has an explanation of this and a list of required variables which seems to match cygwin's list of required variables as well |
Should we ensure that on windows we pass these variables through regardless of |
Perhaps yeah. In the past our spawning tended to mirror libuv closely (where it all originated from), but we've since backpedaled a bit from that original design. From a systems-y perspective I would prefer that I'd probably personally be fine either way |
|
Sounds reasonable to me! |
I feel like this isn't a change we can make backwards compatibly. What are the considerations that are involved in making this change? Can we make it? We at least need documentation for this inconsistency, but I'm not sure what tag to use for those issues: |
I think we've got leeway to change the implementation on Windows to preserve some environment variables. If a process can just literally not be spawned without an environment variable then we're basically guaranteed to not break anyone if we start preserving it by default on |
See the discussion in PowerShell/PowerShell#4671. |
The issue is closed, but with the fix related to running process on windows with empty environment that seems not quite exactly as described previously Using |
Can you open a new issue? |
Running
Command
withenv_clear
will reproducibly result in Error with OS code 87.if
env_clear
is omitted, it works:The text was updated successfully, but these errors were encountered: