[libvirt] [PATCH] [Build-breaker : 1.2.12] Suppress compilation without dbus headers

Hi, While testing 1.2.12 rc2 on Powerpc, Fedora 21, I hit a bunch of build failures in absence of dbus-devel : src/util/virsystemd.c:284:17: note: in expansion of macro 'STREQ_NULLABLE' if (STREQ_NULLABLE("org.freedesktop.DBus.Error.UnknownMethod", ^ .... src/util/virsystemd.c:288:17: error: implicit declaration of function 'dbus_error_free' [-Werror=implicit-function-declaration] dbus_error_free(&error); Found that this was because commit 318df5a05 needs Dbus libraries for compilation, and configure didnt mark "with_dbus" to be mandatory. In this case, the compilation itself failed in a much uglier fashion on my system where dbus-devel was absent. The following patch introduces a compile error when dbus-devel is absent, so that the build itself proceeds later without cryptic errors. This has also been reported on the list : https://www.redhat.com/archives/libvir-list/2015-January/msg00641.html
From 8c4f583b6bb47ca41866ff884af0cd55487f047d Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Sun, 25 Jan 2015 05:35:23 -0600 Subject: [PATCH] Build: Fix dbus m4 macro to correctly flag it as a required dependency.
Commit 318df5a needs dbus headers to compile. However, this package is listed as optional, and so this breaks libvirt compilation on systems that lack the relevant devel files. This patch does not allow ./configure to proceed if dbus-devel is absent. It also tweaks the libvirt spec file to reflect this relationship. --- libvirt.spec.in | 3 --- m4/virt-dbus.m4 | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ba1cf41..4dfda13 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -627,10 +627,7 @@ BuildRequires: util-linux BuildRequires: nfs-utils %endif -%if %{with_firewalld} -# Communication with the firewall daemon uses DBus BuildRequires: dbus-devel -%endif # Fedora build root suckage BuildRequires: gawk diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4 index 3f9b306..42359cf 100644 --- a/m4/virt-dbus.m4 +++ b/m4/virt-dbus.m4 @@ -19,6 +19,7 @@ dnl AC_DEFUN([LIBVIRT_CHECK_DBUS],[ LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0]) + m4_divert_text([DEFAULTS], [with_dbus=yes]) if test "$with_dbus" = "yes" ; then old_CFLAGS="$CFLAGS" -- 1.8.3.1 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

On Sun, Jan 25, 2015 at 05:56:25PM +0530, Prerna Saxena wrote:
Hi, While testing 1.2.12 rc2 on Powerpc, Fedora 21, I hit a bunch of build failures in absence of dbus-devel :
src/util/virsystemd.c:284:17: note: in expansion of macro 'STREQ_NULLABLE' if (STREQ_NULLABLE("org.freedesktop.DBus.Error.UnknownMethod", ^ .... src/util/virsystemd.c:288:17: error: implicit declaration of function 'dbus_error_free' [-Werror=implicit-function-declaration] dbus_error_free(&error);
Found that this was because commit 318df5a05 needs Dbus libraries for compilation, and configure didnt mark "with_dbus" to be mandatory. In this case, the compilation itself failed in a much uglier fashion on my system where dbus-devel was absent.
The following patch introduces a compile error when dbus-devel is absent, so that the build itself proceeds later without cryptic errors.
This has also been reported on the list : https://www.redhat.com/archives/libvir-list/2015-January/msg00641.html
I've already posted a fix for this problem https://www.redhat.com/archives/libvir-list/2015-January/msg00869.html Regards, 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 Monday 26 January 2015 02:47 PM, Daniel P. Berrange wrote:
On Sun, Jan 25, 2015 at 05:56:25PM +0530, Prerna Saxena wrote:
Hi, While testing 1.2.12 rc2 on Powerpc, Fedora 21, I hit a bunch of build failures in absence of dbus-devel :
src/util/virsystemd.c:284:17: note: in expansion of macro 'STREQ_NULLABLE' if (STREQ_NULLABLE("org.freedesktop.DBus.Error.UnknownMethod", ^ .... src/util/virsystemd.c:288:17: error: implicit declaration of function 'dbus_error_free' [-Werror=implicit-function-declaration] dbus_error_free(&error);
Found that this was because commit 318df5a05 needs Dbus libraries for compilation, and configure didnt mark "with_dbus" to be mandatory. In this case, the compilation itself failed in a much uglier fashion on my system where dbus-devel was absent.
The following patch introduces a compile error when dbus-devel is absent, so that the build itself proceeds later without cryptic errors.
This has also been reported on the list : https://www.redhat.com/archives/libvir-list/2015-January/msg00641.html I've already posted a fix for this problem
https://www.redhat.com/archives/libvir-list/2015-January/msg00869.html
Oh ! I had probably missed this fix on the list. Thanks, -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India
participants (2)
-
Daniel P. Berrange
-
Prerna Saxena