News for hackers. Stuff that matters.
Re:Go 1.21 will (likely) have a static toolchain on Linux by cpach on Saturday April 08, 2023 @03:42AM (#35491406)
Native DNS lookups is possible in Go on macOS. But it seems the road to get there was not exactly smooth.
Re:Go 1.21 will (likely) have a static toolchain on Linux by mseepgood on Saturday April 08, 2023 @04:05AM (#35491507)
It's not difficult, and it was done like that for some time, but the macOS system call interface is not guaranteed to be stable (more like guaranteed to be unstable), so the correct thing on macOS is to go through libc (libSystem), which Go now does since 1.12.
Re:Go 1.21 will (likely) have a static toolchain on Linux by cpach on Saturday April 08, 2023 @04:56AM (#35491695)
Not exactly rocket science perhaps, but AFAICT there was some long-running tickets related to DNS lookups on macOS.
Re:Go 1.21 will (likely) have a static toolchain on Linux by jen20 on Saturday April 08, 2023 @11:39AM (#35494347)
For DNS specifically, this landed in Go 1.20: here is the change set [1].

A different change [2] had a similar effect of using the system facilities for certificate validation in 1.18.

In general, using the custom stuff “works” (until it doesn’t!) but results in janky programs that don’t behave with respect to split tunnel DNS and so forth - very common with cross compiled programs until recently.

[1]: https://go-review.googlesource.com/c/go/+/446178

[2]: https://go-review.googlesource.com/c/go/+/353132