-
-
Notifications
You must be signed in to change notification settings - Fork 55
Statically link to libxml2 when static_build
tag is defined
#95
Conversation
There's an unofficial convention in the Go ecosystem that the `static_build` tag indicates a desire to link statically to external libraries detected with pkg-config - examples include: * [LXC](https://github.com/lxc/go-lxc/blob/ccae595aa49e779f7ecc9250329967aa546acd31/linking_static.go) * [containers-storage](https://github.com/containers/storage/blob/6c835719e98e403dae4a437e3809e247c9561b29/pkg/devicemapper/devmapper_wrapper_static.go) Support this convention by invoking pkg-config with the `--static` option if the `static_build` tag is defined, or without if it isn't.
This is a proposed solution to the problems faced in #62. Hopefully it'll be resolved officially in the Go toolchain when golang/go#26492 is implemented, but until then, this seems to be the unofficial convention for getting external libraries linked statically. |
@chrisnovakovic can you please modify the CI tests that they additionally test building with static linking? |
I've started off with Ubuntu (tested locally in a Docker container similar to |
I think you had an overzealous copy/paste :D |
See if removing this key works
There's a dangling |
The latest failure is because the
ought to do it, given that you just want something with at least libxml2's 2.12 API. |
Ah, I just made it 2.12.6, but I guess I should have looked closer. Meh, I'll fix that when it breaks again in the future. Thanks for your PR! will merge now |
There's an unofficial convention in the Go ecosystem that the
static_build
tag indicates a desire to link statically to external libraries detected with pkg-config - examples include:Support this convention by invoking pkg-config with the
--static
option if thestatic_build
tag is defined, or without if it isn't.