[libvirt] [PATCH] build: fix cygwin build

make[3]: *** No rule to make target `-lxml2', needed by `libvirt.la'. Stop. Due to treating the wrong string as a dependency. * src/Makefile.am (libvirt_la_DEPENDENCIES): Depend only on locally-built file, not on strings that might resolve as '-lxml2'. --- Pushing under the obvious rule, since this was breaking a build. src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 15bc8fc..72f23a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -974,13 +974,13 @@ libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \ $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) libvirt_la_LIBADD += $(LIBXML_LIBS) \ $(LIBPCAP_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT -libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(LIBVIRT_SYMBOL_FILE) +libvirt_la_DEPENDENCIES = ../gnulib/lib/libgnu.la $(LIBVIRT_SYMBOL_FILE) # Create an automake "convenience library" version of libvirt_la, # just for testing, since the test harness requires access to internal # bits and pieces that we don't want to make publicly accessible. noinst_LTLIBRARIES += libvirt_test.la -- 1.7.0.1

On 05/14/2010 04:05 PM, Eric Blake wrote:
make[3]: *** No rule to make target `-lxml2', needed by `libvirt.la'. Stop.
Due to treating the wrong string as a dependency.
* src/Makefile.am (libvirt_la_DEPENDENCIES): Depend only on locally-built file, not on strings that might resolve as '-lxml2'.
Aargh. This fixed incremental builds for cygwin, but broke fresh builds everywhere. Followup patch coming soon, to unbreak the build.
libvirt_la_LIBADD += $(LIBXML_LIBS) \ $(LIBPCAP_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT -libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(LIBVIRT_SYMBOL_FILE) +libvirt_la_DEPENDENCIES = ../gnulib/lib/libgnu.la $(LIBVIRT_SYMBOL_FILE)
$(DRIVER_MODULE_LIBS) is important, after all. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/14/2010 05:28 PM, Eric Blake wrote:
On 05/14/2010 04:05 PM, Eric Blake wrote:
make[3]: *** No rule to make target `-lxml2', needed by `libvirt.la'. Stop.
Due to treating the wrong string as a dependency.
* src/Makefile.am (libvirt_la_DEPENDENCIES): Depend only on locally-built file, not on strings that might resolve as '-lxml2'.
Aargh. This fixed incremental builds for cygwin, but broke fresh builds everywhere. Followup patch coming soon, to unbreak the build.
libvirt_la_LIBADD += $(LIBXML_LIBS) \ $(LIBPCAP_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT -libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(LIBVIRT_SYMBOL_FILE) +libvirt_la_DEPENDENCIES = ../gnulib/lib/libgnu.la $(LIBVIRT_SYMBOL_FILE)
$(DRIVER_MODULE_LIBS) is important, after all.
No, it's not that. Looking at the generated Makefile, it is that automake gives you two choices: specify no dependencies, and automake does everything for you: libvirt_la_DEPENDENCIES = libvirt_util.la libvirt_conf.la \ libvirt_cpu.la libvirt_driver.la $(am__append_4) \ $(am__append_7) $(am__append_11) $(am__append_15) \ $(am__append_18) $(am__append_21) $(am__append_24) \ $(am__append_45) $(am__append_51) $(am__append_76) \ libvirt_driver_security.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) ../gnulib/lib/libgnu.la Or specify dependencies, and lose all automatic tracking: libvirt_la_DEPENDENCIES = ../gnulib/lib/libgnu.la $(LIBVIRT_SYMBOL_FILE) I've asked on the automake list if there is a way to get what we want, of all the automatic dependencies, plus one more that we specify for $(LIBVIRT_SYMBOL_FILE): http://thread.gmane.org/gmane.comp.sysutils.automake.general/11773 But until that is answered, I'm out of time for today, so I've just reverted my cygwin-breaker patch until I come up with a complete solution that works in fresh builds. Sorry for the churn. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Fix the cygwin regression introduced in commit 48445ccff, but without repeating the fresh build regression of commit 2d550542e. * src/Makefile.am (libvirt_test_la_LIBADD): Split out subset of locally-built libraries... (libvirt_test_la_BUILT_LIBADD): ...into new variable. (libvirt_test_la_DEPENDENCIES): Depend only on the subset that automake would have given us for free if we didn't have to add our own extra file. --- Evidence that I'm a compulsive programmer, who can't bear the thought of waiting an entire weekend to fix a bug. But this time, I _won't_ commit without an ACK; even if it fixes a build regression on cygwin, it no longer falls under the trivial rule. I've tested a clean build on both Linux and cygwin. src/Makefile.am | 59 ++++++++++++++++++++++++++++++------------------------ 1 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 15bc8fc..8617feb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -389,7 +389,8 @@ EXTRA_DIST += $(pkgdata_DATA) # First deal with sources usable in non-daemon context noinst_LTLIBRARIES = libvirt_util.la -libvirt_la_LIBADD = libvirt_util.la +libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) +libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES) libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) @@ -397,20 +398,20 @@ libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIB_PTHREAD) noinst_LTLIBRARIES += libvirt_conf.la -libvirt_la_LIBADD += libvirt_conf.la +libvirt_la_BUILT_LIBADD += libvirt_conf.la libvirt_conf_la_SOURCES = $(CONF_SOURCES) libvirt_conf_la_CFLAGS = libvirt_conf_la_LDFLAGS = noinst_LTLIBRARIES += libvirt_cpu.la -libvirt_la_LIBADD += libvirt_cpu.la +libvirt_la_BUILT_LIBADD += libvirt_cpu.la libvirt_cpu_la_CFLAGS = \ -I@top_srcdir@/src/conf libvirt_cpu_la_SOURCES = $(CPU_SOURCES) noinst_LTLIBRARIES += libvirt_driver.la -libvirt_la_LIBADD += libvirt_driver.la +libvirt_la_BUILT_LIBADD += libvirt_driver.la libvirt_driver_la_SOURCES = $(DRIVER_SOURCES) libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) \ @@ -424,7 +425,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_test.la else noinst_LTLIBRARIES += libvirt_driver_test.la -libvirt_la_LIBADD += libvirt_driver_test.la +libvirt_la_BUILT_LIBADD += libvirt_driver_test.la endif libvirt_driver_test_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -439,7 +440,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_remote.la else noinst_LTLIBRARIES += libvirt_driver_remote.la -libvirt_la_LIBADD += libvirt_driver_remote.la +libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la endif libvirt_driver_remote_la_CFLAGS = \ $(GNUTLS_CFLAGS) \ @@ -490,7 +491,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_xen.la else noinst_LTLIBRARIES += libvirt_driver_xen.la -libvirt_la_LIBADD += libvirt_driver_xen.la +libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la endif libvirt_driver_xen_la_CFLAGS = \ $(XEN_CFLAGS) \ @@ -508,7 +509,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_phyp.la else noinst_LTLIBRARIES += libvirt_driver_phyp.la -libvirt_la_LIBADD += libvirt_driver_phyp.la +libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la endif libvirt_driver_phyp_la_LIBADD = $(LIBSSH2_LIBS) libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS) \ @@ -521,7 +522,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_openvz.la else noinst_LTLIBRARIES += libvirt_driver_openvz.la -libvirt_la_LIBADD += libvirt_driver_openvz.la +libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la endif libvirt_driver_openvz_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -536,7 +537,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_vbox.la else noinst_LTLIBRARIES += libvirt_driver_vbox.la -libvirt_la_LIBADD += libvirt_driver_vbox.la +libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la endif libvirt_driver_vbox_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -552,7 +553,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_xenapi.la else noinst_LTLIBRARIES += libvirt_driver_xenapi.la -libvirt_la_LIBADD += libvirt_driver_xenapi.la +libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la endif libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(LIBCURL_CFLAGS) \ -I@top_srcdir@/src/conf @@ -570,7 +571,7 @@ mod_LTLIBRARIES += libvirt_driver_qemu.la else noinst_LTLIBRARIES += libvirt_driver_qemu.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_qemu.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la endif libvirt_driver_qemu_la_CFLAGS = $(NUMACTL_CFLAGS) \ -I@top_srcdir@/src/conf @@ -596,7 +597,7 @@ mod_LTLIBRARIES += libvirt_driver_lxc.la else noinst_LTLIBRARIES += libvirt_driver_lxc.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_lxc.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la endif libvirt_driver_lxc_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -619,7 +620,7 @@ mod_LTLIBRARIES += libvirt_driver_uml.la else noinst_LTLIBRARIES += libvirt_driver_uml.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_uml.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la endif libvirt_driver_uml_la_CFLAGS = $(NUMACTL_CFLAGS) \ -I@top_srcdir@/src/conf @@ -637,7 +638,7 @@ mod_LTLIBRARIES += libvirt_driver_one.la else noinst_LTLIBRARIES += libvirt_driver_one.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_one.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_one.la endif libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS) \ -I@top_srcdir@/src/conf @@ -661,7 +662,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_esx.la else noinst_LTLIBRARIES += libvirt_driver_esx.la -libvirt_la_LIBADD += libvirt_driver_esx.la +libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la endif libvirt_driver_esx_la_CFLAGS = $(LIBCURL_CFLAGS) \ -I@top_srcdir@/src/conf @@ -680,7 +681,7 @@ mod_LTLIBRARIES += libvirt_driver_network.la else noinst_LTLIBRARIES += libvirt_driver_network.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_network.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la endif libvirt_driver_network_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -699,7 +700,7 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_interface.la else noinst_LTLIBRARIES += libvirt_driver_interface.la -libvirt_la_LIBADD += libvirt_driver_interface.la +libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la endif libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS) \ -I@top_srcdir@/src/conf @@ -717,7 +718,7 @@ mod_LTLIBRARIES += libvirt_driver_secret.la else noinst_LTLIBRARIES += libvirt_driver_secret.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_secret.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la endif libvirt_driver_secret_la_CFLAGS = \ -I@top_srcdir@/src/conf @@ -740,7 +741,7 @@ mod_LTLIBRARIES += libvirt_driver_storage.la else noinst_LTLIBRARIES += libvirt_driver_storage.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_storage.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la endif if WITH_DRIVER_MODULES libvirt_driver_storage_la_LDFLAGS += -module -avoid-version @@ -778,7 +779,7 @@ mod_LTLIBRARIES += libvirt_driver_nodedev.la else noinst_LTLIBRARIES += libvirt_driver_nodedev.la # Stateful, so linked to daemon instead -#libvirt_la_LIBADD += libvirt_driver_nodedev.la +#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la endif libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) @@ -807,7 +808,7 @@ if WITH_NWFILTER if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_nwfilter.la else -libvirt_la_LIBADD += libvirt_driver_nwfilter.la +libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la noinst_LTLIBRARIES += libvirt_driver_nwfilter.la endif libvirt_driver_nwfilter_la_CFLAGS = $(LIBPCAP_CFLAGS) \ @@ -824,7 +825,7 @@ endif libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES) noinst_LTLIBRARIES += libvirt_driver_security.la -libvirt_la_LIBADD += libvirt_driver_security.la +libvirt_la_BUILT_LIBADD += libvirt_driver_security.la libvirt_driver_security_la_CFLAGS = \ -I@top_srcdir@/src/conf libvirt_driver_security_la_LDFLAGS = @@ -972,12 +973,18 @@ libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \ -version-info $(LIBVIRT_VERSION_INFO) \ $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \ $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) +libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la libvirt_la_LIBADD += $(LIBXML_LIBS) \ - $(LIBPCAP_LIBS) \ + $(LIBPCAP_LIBS) \ $(DRIVER_MODULE_LIBS) \ - $(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la + $(CYGWIN_EXTRA_LIBADD) libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT -libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(LIBVIRT_SYMBOL_FILE) +# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we +# lose automake's automatic dependencies on an appropriate subset of +# $(libvirt_la_LIBADD). But we were careful to create +# $(libvirt_la_BUILT_LIBADD) as the subset that automake would have +# picked out for us. +libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE) # Create an automake "convenience library" version of libvirt_la, # just for testing, since the test harness requires access to internal -- 1.7.0.1

On Fri, 2010-05-14 at 18:32 -0600, Eric Blake wrote:
Fix the cygwin regression introduced in commit 48445ccff, but without repeating the fresh build regression of commit 2d550542e.
* src/Makefile.am (libvirt_test_la_LIBADD): Split out subset of locally-built libraries... (libvirt_test_la_BUILT_LIBADD): ...into new variable. (libvirt_test_la_DEPENDENCIES): Depend only on the subset that automake would have given us for free if we didn't have to add our own extra file. ---
Evidence that I'm a compulsive programmer, who can't bear the thought of waiting an entire weekend to fix a bug.
:-)
But this time, I _won't_ commit without an ACK; even if it fixes a build regression on cygwin, it no longer falls under the trivial rule.
I've tested a clean build on both Linux and cygwin.
src/Makefile.am | 59 ++++++++++++++++++++++++++++++------------------------ 1 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 15bc8fc..8617feb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -389,7 +389,8 @@ EXTRA_DIST += $(pkgdata_DATA) # First deal with sources usable in non-daemon context
noinst_LTLIBRARIES = libvirt_util.la -libvirt_la_LIBADD = libvirt_util.la +libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) +libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES)
I tried to apply it but the indentation of above line doesn't make it fit (on my machine the $ is under the 'S'). Hunks 1,2,22 fail for me and many others have fuzz 1. Stefan

On 05/17/2010 07:20 AM, Stefan Berger wrote:
On Fri, 2010-05-14 at 18:32 -0600, Eric Blake wrote:
Fix the cygwin regression introduced in commit 48445ccff, but without repeating the fresh build regression of commit 2d550542e.
noinst_LTLIBRARIES = libvirt_util.la -libvirt_la_LIBADD = libvirt_util.la +libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) +libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES)
I tried to apply it but the indentation of above line doesn't make it fit (on my machine the $ is under the 'S'). Hunks 1,2,22 fail for me and many others have fuzz 1.
The same patch can be grabbed from here: git pull git://repo.or.cz/libvirt/ericb.git libadd-fix -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Mon, 2010-05-17 at 10:49 -0600, Eric Blake wrote:
On 05/17/2010 07:20 AM, Stefan Berger wrote:
On Fri, 2010-05-14 at 18:32 -0600, Eric Blake wrote:
Fix the cygwin regression introduced in commit 48445ccff, but without repeating the fresh build regression of commit 2d550542e.
noinst_LTLIBRARIES = libvirt_util.la -libvirt_la_LIBADD = libvirt_util.la +libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) +libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES)
I tried to apply it but the indentation of above line doesn't make it fit (on my machine the $ is under the 'S'). Hunks 1,2,22 fail for me and many others have fuzz 1.
The same patch can be grabbed from here:
git pull git://repo.or.cz/libvirt/ericb.git libadd-fix
It didn't build before, now that I pull from there it does -> ACK. Stefan

On 05/17/2010 11:59 AM, Stefan Berger wrote:
On Mon, 2010-05-17 at 10:49 -0600, Eric Blake wrote:
On 05/17/2010 07:20 AM, Stefan Berger wrote:
On Fri, 2010-05-14 at 18:32 -0600, Eric Blake wrote:
Fix the cygwin regression introduced in commit 48445ccff, but without repeating the fresh build regression of commit 2d550542e.
And since both of those regressions were mine, my apologies for the time this has been broken.
noinst_LTLIBRARIES = libvirt_util.la -libvirt_la_LIBADD = libvirt_util.la +libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) +libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES)
I tried to apply it but the indentation of above line doesn't make it fit (on my machine the $ is under the 'S'). Hunks 1,2,22 fail for me and many others have fuzz 1.
The same patch can be grabbed from here:
git pull git://repo.or.cz/libvirt/ericb.git libadd-fix
It didn't build before, now that I pull from there it does -> ACK.
Thanks for the review. Pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Stefan Berger