-
Notifications
You must be signed in to change notification settings - Fork 18k
net: respect GODEBUG=netdns=go on macOS #27774
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
Comments
As long as we continue to default to using the cgo resolver on Darwin, I'm fine respecting the GODEBUG knob on Darwin to select the pure-Go resolver. (and perhaps the build tag, too?) |
After some investigation looks like Darwin will popup dialog box if developer mode in not enabled on Mac. However it not popup dialog box on some Macs without developer mode been enabled, and I can't found any version or setting correlating with such behaviour. In any case I don't think build tag is good idea, because some user will definitely see popups on Mac if you compile and distribute binary with pure-Go resolver enabled by default. However GODEBUG is useful for local debugging. |
Respecting $GODEBUG seems OK - if you ask for it, you get it. I wouldn't want to do hard-coding at build time, though, since we know that the non-cgo resolver is much worse than the cgo one (see #12524). |
TIL:
Not sure when I enabled that. |
I've been using the same work laptop for 2 years and never enabled developer mode:
and I've never seen this popup despite running plenty of go binaries built with cgo disabled. I tried enabling the firewall in system preferences, and still can't reproduce the popup. Nor have I received any reports of such a popup from my coworkers. Though I do get a lot of complaints about DNS failing to resolve private hostnames, an indication that the native go resolver is in use. Point being, whatever determines if this popup occurs, I don't think it's developer mode. Furthermore, on my system I can't reproduce the problem:
built with:
cgo resolution works:
Go's native resolver is used when requested, confirmed by the debug output as well as the resolution failure (native Go can't resolve RFC6762 names):
|
@bitglue, I also see that. @gregory-m, can you try again? Sure you're using the version of Go you think you are? |
It sounds like people think that this already works. @gregory-m do you disagree? |
Sorry my bad, tried it with wrong build. Works as expected in current version. |
What version of Go are you using (
go version
)?go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?Can be reproduced on any darwin.
What did you do?
Tried to debug some DNS issues on our production system.
In order to do this I tried to run code with
GODEBUG=netdns=go+2
andGODEBUG=netdns=cgo+2
on my local Mac.What did you expect to see?
Go runtime will use cgo or go resolver according to
GODEBUG
env variable.What did you see instead?
Runtime silently used
cgo
resolver every time.Also despite this comment I don't see any popups after I removed this check.
Can we put darwin check before
if confVal.dnsDebugLevel > 0
and use go resolver on darwin if user explicitly asked for it?If there are no objections I will create CL.
The text was updated successfully, but these errors were encountered: