feat: always disable cgo support (static builds)#10426
feat: always disable cgo support (static builds)#10426powersj wants to merge 2 commits intoinfluxdata:masterfrom
Conversation
|
One thing to note is that with this, there is no support for split DNS on macOS since the Go DNS resolver only uses |
Per net/net.go it looks like the Go DNS resolve is the default. The only line of concern here was that Windows uses the C library functions by default. In that case, it makes me want to update this so Windows is excluded. Thoughts? |
|
I haven't had a chance to test telegraf in a split DNS scenario, but I imagine that it currently fails since it is using the Go DNS resolver by default. For macOS builds, it may be beneficial to use cgo to build with CGO_ENABLED=1 so that it uses libc and thus I just happened to drive by this pull request, as I was looking for another issue. Split DNS is fairly common with corporate VPN for example. This is an issue a lot of Go binaries have because they bypass libc on macOS, and therefor don't work in split DNS scenarios. |
I agree, thanks for bringing this up. I'll update this to change only builds for linux. |
78a1833 to
d0b9d18
Compare
This ensures that cgo is always disabled with builds using the Makefile. Telegraf does not support importing C libraries or depending on any of them in the first place. This is to ensure cross-platform and cross-OS support. Because Telegraf does not need to depend on dynamic libraries, we can ensure Telegraf builds statically. MacOS and Windows do not have official static build support and by default builds on those systems are already as static as they can be. This primarily affects the Linux/*BSD builds. Finally, this removes the no longer necessary static specific build.
d0b9d18 to
abec12f
Compare
|
📦 Looks like new artifacts were built from this PR. Expand this list to get them here ! 🐯Artifact URLs |
|
next steps: update this, added as a part of 2.0 breaking changes, verify size is not greatly changed |
|
I'm going to close this for now, and once we get our 2.0 branch up and started I'll re-post it. |
This ensures that cgo is always disabled with builds using
the Makefile. Telegraf does not support importing C libraries
or depending on any of them in the first place. This is to
ensure cross-platform and cross-OS support.
Because Telegraf does not need to depend on dynamic libraries,
we can ensure Telegraf builds statically.
MacOS and Windows do not have official static build support and
by default builds on those systems are already as static as they
can be. This primarily affects the Linux/*BSD builds.
Finally, this removes the no longer necessary static specific
build.