3 ms·
"the goal is to eliminate C from the source tree so that—except for programs that use cgo" What does the future hold for cgo? Yesterday I ran into erratic DNS
by disputin 12y ago
"the goal is to eliminate C from the source tree so that—except for programs that use cgo"
What does the future hold for cgo? Yesterday I ran into erratic DNS success with a cross compiled program, win to lin. Haven't had a chance to look further, but I'm wondering when I'll run into similar snags again.
- axaxs 12y agoCan you please raise bug report or let me know what you find here? I work on go native dns library for linux, which iirc is used when crosscompiling rather than libc.
- disputin 12y agoNot sure it's a bug, may be "a well-known limitation" (unknown to me) - https://inconshreveable.com/04-30-2014/cross-compiling-golang-programs-with-native-libraries/ https://inconshreveable.com/04-30-2014/cross-compiling-golan... Have a Go: package main import ( "fmt" "net" "os" ) func main() { hostname := "feeds.feedburner.com" if len(os.Args) > 1 { hostname = os.Args[1] } addr, err := net.LookupHost(hostname) if err != nil { fmt.Printf("err: %v", err.Error()) } else { fmt.Printf("addr: %v", addr) } } set GOOS=linux set GOARCH=amd64 set CGO_ENABLED=0
- axaxs 12y agoHi, I do not have windows box to crosscompile any longer. I did test go 1.4 rc2 with CGO_ENABLED=0, which builds a static binary, and it gives - addr: [74.125.192.118 2607:f8b0:4001:c00::76] Are you seeing different behavior? Please describe...I'll see if I can look into it.
- disputin 12y agoHi, $ ./dns-win-xc.bin err: lookup feeds.feedburner.com on [178.22.66.167]:53: no such host $ ./dns-lin.bin addr: [173.194.116.64 173.194.116.69 173.194.116.71 173.194.116.65 173.194.116.73 173.194.116.70 173.194.116.67 173.194.116.66 173.194.116.72 173.194.116.78 173.194.116.68 2a00:1450:400c:c0a::76] Win 8.1, go1.3.3., Centos 7. There's a downvoter for some reason, maybe they have something to add...? Don't let me lead you astray - I haven't yet read that article I linked to, but a quick glimpse suggested to me that this isn't a bug.
- axaxs 12y agoI didn't(actually, can't) downvote. Before I dig further, can you try 1.4 rc2? We heavily refactored DNS this release. Secondly, your dns-lin.bin, is that with go built with CGO_ENABLED=0? Ie...if you ldd both files, do they both claim to be statically linked? If you'd like to continue by email, please click my username. Thanks