-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix environment on Windows #6
Conversation
Ping @dra27 - do you know what would cause a cygwin binary started from a non-cygwin binary (everyone's favorite combination) to start correctly, but having no network access? I found that passing |
It's nothing to do with Cygwin...
|
I just quickly checked - |
On Windows, an empty environment can cause curl to fail. In particular, running curl seems to require `PATH` and `SYSTEMROOT`: - if `PATH` is not set, the binary is not found - if `SYSTEMROOT` is not set, address resolution fails at runtime
Ah! I was too quick to blame poor cygwin. I updated the description. Thanks! |
It seems strange that we are running the process with an empty environment in the first place. Can we just inherit the environment? I think that's what users would expect. |
Depends on how thin a wrapper you're after - there are environment variables which can control curl which presently aren't exposed to it |
Yes, including |
Would these environment variables control |
Goodness, we're just scrubbing misbehaviour like that in opam's libs, but I really hope not! |
@emillon I gave you merge access to proceed as you see fit. |
Thanks! I think that the most conservative option is to merge + release that PR does (this unlocks dune-release on windows for example) and keep the status quo for now.
Some of them do: https://curl.se/libcurl/c/libcurl-env.html |
Can someone merge this PR? It works on Windows. Thx |
CHANGES: * Passthrough case-insensitive PATH and SYSTEMROOT on Windows (@emillon, @jonahbeckford, rgrinberg/curly#6, rgrinberg/curly#8) * Passthrough PATH to Unixes too. (@bikal, rgrinberg/curly#12) * Add `?follow_redirects` argument to `run` and related functions (@rawleyfowler, rgrinberg/curly#5).
On Windows, an empty environment can cause curl to fail.
In particular, running curl seems to require
PATH
andSYSTEMROOT
:PATH
is not set, the binary is not foundSYSTEMROOT
is not set, address resolution fails at runtime