[libvirt] [PATCHv2] build: let autobuild check more code

Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help. * autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. --- Wow, I've been sitting on this one for a while, and dusted it off from one of my side branches. This might not address all of Daniel's comments on v1, but it is better than nothing. v1: https://www.redhat.com/archives/libvir-list/2011-March/msg01072.html v2: in response to: https://www.redhat.com/archives/libvir-list/2011-December/msg00620.html autobuild.sh | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 9853287..eef67f4 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -15,8 +15,12 @@ rm -rf build mkdir build cd build +# Run with options not normally exercised by the rpm build, for +# more complete code coverage. ../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \ + --with-driver-modules \ --enable-test-coverage \ + --disable-nls \ --enable-compile-warnings=error # If the MAKEFLAGS envvar does not yet include a -j option, @@ -61,6 +65,7 @@ if [ -f /usr/bin/rpmbuild ]; then -ba --clean libvirt.spec fi +# Test mingw cross-compile if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then make distclean @@ -71,23 +76,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ --enable-compile-warnings=error \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-uml \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-python \ - --without-libvirtd \ - --without-phyp \ - --without-hyperv \ - --without-netcf \ - --without-audit \ - --without-dtrace \ + --without-libvirtd make make install -- 1.7.7.4

On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
* autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. ---
Wow, I've been sitting on this one for a while, and dusted it off from one of my side branches. This might not address all of Daniel's comments on v1, but it is better than nothing. v1: https://www.redhat.com/archives/libvir-list/2011-March/msg01072.html v2: in response to: https://www.redhat.com/archives/libvir-list/2011-December/msg00620.html
autobuild.sh | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-)
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 12/15/2011 01:49 AM, Daniel P. Berrange wrote:
On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
* autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. ---
Wow, I've been sitting on this one for a while, and dusted it off from one of my side branches. This might not address all of Daniel's comments on v1, but it is better than nothing. v1: https://www.redhat.com/archives/libvir-list/2011-March/msg01072.html v2: in response to: https://www.redhat.com/archives/libvir-list/2011-December/msg00620.html
autobuild.sh | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-)
ACK
Thanks for the review; however, I will defer pushing this patch until I also have time to fix a couple of fallout problems (my goal is to get this all squared away before 0.9.9). In particular, ./autobuild.sh now fails with: CCLD libvirt_driver_nwfilter.la ../gnulib/lib/.libs/libgnu.a(allocator.o):(.data.rel.ro+0x0): multiple definition of `stdlib_allocator' ../gnulib/lib/.libs/libgnu.a(allocator.o):(.data.rel.ro+0x0): first defined here that is, I think we're incorrectly linking gnulib in from multiple helper libraries somewhere along the way. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Dec 15, 2011 at 01:00:02PM -0700, Eric Blake wrote:
On 12/15/2011 01:49 AM, Daniel P. Berrange wrote:
On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
* autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. ---
Wow, I've been sitting on this one for a while, and dusted it off from one of my side branches. This might not address all of Daniel's comments on v1, but it is better than nothing. v1: https://www.redhat.com/archives/libvir-list/2011-March/msg01072.html v2: in response to: https://www.redhat.com/archives/libvir-list/2011-December/msg00620.html
autobuild.sh | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-)
ACK
Thanks for the review; however, I will defer pushing this patch until I also have time to fix a couple of fallout problems (my goal is to get this all squared away before 0.9.9). In particular, ./autobuild.sh now fails with:
Hmm, I presume this is due to the addition of '-with-driver-modules'. If so, please push the other bits of your patch, and leave the driver modules bit for later. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 12/15/2011 04:25 PM, Daniel P. Berrange wrote:
On Thu, Dec 15, 2011 at 01:00:02PM -0700, Eric Blake wrote:
On 12/15/2011 01:49 AM, Daniel P. Berrange wrote:
On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
ACK
Thanks for the review; however, I will defer pushing this patch until I also have time to fix a couple of fallout problems (my goal is to get this all squared away before 0.9.9). In particular, ./autobuild.sh now fails with:
Hmm, I presume this is due to the addition of '-with-driver-modules'. If so, please push the other bits of your patch, and leave the driver modules bit for later.
Done, and I'll see what I can do about --with-driver-modules later. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
* autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. ---
Wow, I've been sitting on this one for a while, and dusted it off from one of my side branches. This might not address all of Daniel's comments on v1, but it is better than nothing. v1: https://www.redhat.com/archives/libvir-list/2011-March/msg01072.html v2: in response to: https://www.redhat.com/archives/libvir-list/2011-December/msg00620.html
autobuild.sh | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/autobuild.sh b/autobuild.sh index 9853287..eef67f4 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -15,8 +15,12 @@ rm -rf build mkdir build cd build
+# Run with options not normally exercised by the rpm build, for +# more complete code coverage. ../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \ + --with-driver-modules \ --enable-test-coverage \ + --disable-nls \ --enable-compile-warnings=error
# If the MAKEFLAGS envvar does not yet include a -j option, @@ -61,6 +65,7 @@ if [ -f /usr/bin/rpmbuild ]; then -ba --clean libvirt.spec fi
+# Test mingw cross-compile if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then make distclean
@@ -71,23 +76,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ --enable-compile-warnings=error \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-uml \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-python \ - --without-libvirtd \ - --without-phyp \ - --without-hyperv \ - --without-netcf \ - --without-audit \ - --without-dtrace \ + --without-libvirtd
It turns out we don't disable dtrace correctly on mingw32, if the build host has it present for native. So we either need to fix configure.ac or add --without-dtrace back in. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 12/16/2011 02:08 AM, Daniel P. Berrange wrote:
On Wed, Dec 14, 2011 at 11:02:23AM -0700, Eric Blake wrote:
Many times, we don't notice a bug in src/libvirt_private.syms until someone attempts a build with modules enabled. Likewise, some gcc warnings about no % in a printf format string only appear under --disable-nls. And configure.ac should automatically be excluding modules on mingw without us having to be explicit. Improving autobuild.sh to stress more combinations can only help.
* autobuild.sh: Add --with-driver-modules and --disable-nls. Update mingw build to rely more on configure.ac detection. ---
@@ -71,23 +76,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ --enable-compile-warnings=error \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-uml \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-python \ - --without-libvirtd \ - --without-phyp \ - --without-hyperv \ - --without-netcf \ - --without-audit \ - --without-dtrace \ + --without-libvirtd
It turns out we don't disable dtrace correctly on mingw32, if the build host has it present for native. So we either need to fix configure.ac or add --without-dtrace back in.
I'm pushing this under the build-breaker rule, which gets me to the next build failure that I'll be patching soon: Creating library file: .libs/libvirt.dll.a Cannot export virDomainEventDispatch: symbol not defined Cannot export virDomainEventDispatchDefaultFunc: symbol not defined Cannot export virDomainEventStateFlush: symbol not defined From 0beb0ee16dce791651d8ca89deb8259ce004acb6 Mon Sep 17 00:00:00 2001 From: Eric Blake <eblake@redhat.com> Date: Fri, 16 Dec 2011 08:35:17 -0700 Subject: [PATCH] build: disable dtrace on non-Linux builds Using dtrace (and systemtap in general) is Linux-specific. Running ./autobuild.sh shows that attempting a cross-build to target mingw was mistakenly trying to build dtrace code, merely because it was present on the compilation host. * configure.ac (with_dtrace): Don't attempt to use dtrace when doing a cross-build hosted on Linux but targetting elsewhere. Reported by Daniel P. Berrange. --- configure.ac | 8 ++++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 01a2bae..ec3e470 100644 --- a/configure.ac +++ b/configure.ac @@ -269,9 +269,10 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then fi dnl Make some notes about which OS we're compiling for, as the lxc and qemu -dnl drivers require linux headers, while storage_mpath and nwfilter are also -dnl linux specific. The "network" and storage_fs drivers are known to not -dnl work on MacOS X presently, so we also make a note if compiling for that +dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter +dnl are also linux specific. The "network" and storage_fs drivers are known +dnl to not work on MacOS X presently, so we also make a note if compiling +dnl for that with_linux=no with_osx=no case $host in @@ -288,6 +289,7 @@ if test $with_linux = no; then then with_qemu=no fi + with_dtrace=no fi AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) -- 1.7.7.4 -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12/16/2011 08:42 AM, Eric Blake wrote:
I'm pushing this under the build-breaker rule, which gets me to the next build failure that I'll be patching soon:
Creating library file: .libs/libvirt.dll.a Cannot export virDomainEventDispatch: symbol not defined Cannot export virDomainEventDispatchDefaultFunc: symbol not defined Cannot export virDomainEventStateFlush: symbol not defined
Actually, that error only occurs when using Dan's 8-patch series to avoid the hangs when an event fires after the connection is down (but we need to get that series polished and in soon, as I can't complete autobuild.sh without it). -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12/16/2011 02:08 AM, Daniel P. Berrange wrote:
@@ -71,23 +76,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ --enable-compile-warnings=error \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-uml \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-python \
It turns out we don't disable dtrace correctly on mingw32, if the build host has it present for native. So we either need to fix configure.ac or add --without-dtrace back in.
It looks like --without-python is also essential, as I'm now getting: libtool: compile: i686-pc-mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../python -I.. -I/usr/include/python2.7 -I/usr/include/python2.7 -I../../include -I../include -I../python -Wno-redundant-decls -g -O2 -MT libvirtmod_la-libvirt-override.lo -MD -MP -MF .deps/libvirtmod_la-libvirt-override.Tpo -c ../../python/libvirt-override.c -DDLL_EXPORT -DPIC -o .libs/libvirtmod_la-libvirt-override.o In file included from /usr/include/python2.7/Python.h:8:0, from ../../python/libvirt-override.c:19: /usr/include/python2.7/pyconfig.h:1:27: fatal error: bits/wordsize.h: No such file or directory Why is a mingw build trying to include /usr/include/python2.7/Python.h instead of the appropriate mingw-specific buildroot? It seems like our python detection in configure.ac is misbehaving during cross-builds. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Dec 16, 2011 at 11:39:26AM -0700, Eric Blake wrote:
On 12/16/2011 02:08 AM, Daniel P. Berrange wrote:
@@ -71,23 +76,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ --enable-compile-warnings=error \ - --without-xen \ - --without-qemu \ - --without-openvz \ - --without-lxc \ - --without-vbox \ - --without-xenapi \ - --without-uml \ - --without-sasl \ - --without-avahi \ - --without-polkit \ - --without-python \
It turns out we don't disable dtrace correctly on mingw32, if the build host has it present for native. So we either need to fix configure.ac or add --without-dtrace back in.
It looks like --without-python is also essential, as I'm now getting:
libtool: compile: i686-pc-mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../python -I.. -I/usr/include/python2.7 -I/usr/include/python2.7 -I../../include -I../include -I../python -Wno-redundant-decls -g -O2 -MT libvirtmod_la-libvirt-override.lo -MD -MP -MF .deps/libvirtmod_la-libvirt-override.Tpo -c ../../python/libvirt-override.c -DDLL_EXPORT -DPIC -o .libs/libvirtmod_la-libvirt-override.o In file included from /usr/include/python2.7/Python.h:8:0, from ../../python/libvirt-override.c:19: /usr/include/python2.7/pyconfig.h:1:27: fatal error: bits/wordsize.h: No such file or directory
Why is a mingw build trying to include /usr/include/python2.7/Python.h instead of the appropriate mingw-specific buildroot? It seems like our python detection in configure.ac is misbehaving during cross-builds.
I took at look at the python code detection & ran away screaming. Until someone decides to rewrite it to not suck, I've re-added --without-python to autobuild.sh so we can get working automated builds again. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Eric Blake