On Tue, 2019-01-08 at 13:56 -0600, Eric Blake wrote:
My recent patch to make all of the examples work independently of
gnulib worked fine on Linux, but failed on mingw:
https://travis-ci.org/libvirt/libvirt/jobs/476898635
The whole point of gnulib is to work around portability pitfalls so
we don't have to bend over backwards thinking about it in our code;
and it would be possible to fix this bug by linking the problematic
example binaries against gnulib after all. But since the examples
are still small and self-contained enough that using manual
workarounds wasn't too daunting, that's the approach I took here.
It's kind of a done deal now, but I still wonder if it was the right
approach.
The way I see it, our examples are supposed to illustrate how to use
libvirt itself, not how to write C code that is portable to a
multitude of platforms: with that goal in mind, taking advantage of
gnulib makes perfect sense, as it allows us to put the focus on the
usage of libvirt rather than the surrounding compatibility gunk.
I would probably have a different opinion about this if the
workarounds were related to eg. using certain types as opposed to
others when passing data to libvirt functions, but as far as I can
tell that's not the case.
--
Andrea Bolognani / Red Hat / Virtualization