[libvirt] [PATCH] virkeymaps.h: Fix VPATH build with --disable-dependency-tracking

Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h does not depend on src/utils dirstamp. I don't know how to force automake to generate that rule, but this is the diff that makes things work for me again. Yes, as you can see it more or less reverts a9fe620372144db3e432bd7506cb909cc3179ef8. More than less. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- Steps to reproduce: 1) mkdir /tmp/test_libvirt && cd $_ 2) $OLDPWD/configure --disable-dependency-tracking 3) make src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..f98912f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,7 +181,7 @@ MAINTAINERCLEANFILES += util/virkeymaps.h util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ - <$(srcdir)/util/keymaps.csv >util/virkeymaps.h + <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h # Internal generic driver infrastructure NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h -- 2.4.10

On Tue, Nov 03, 2015 at 09:08:04 +0100, Michal Privoznik wrote:
Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h
Maybe that's the actual problem.
does not depend on src/utils dirstamp. I don't know how to force automake to generate that rule, but this is the diff that makes things work for me again. Yes, as you can see it more or less reverts a9fe620372144db3e432bd7506cb909cc3179ef8. More than less.
I don't think anything you wrote here really justifies the change below. It hints that the problem is probably elsewhere.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ---
Steps to reproduce:
1) mkdir /tmp/test_libvirt && cd $_ 2) $OLDPWD/configure --disable-dependency-tracking 3) make
The actual output for the lazy: make[2]: Entering directory '/tmp/build/src' GEN util/virkeymaps.h /bin/sh: util/virkeymaps.h: No such file or directory GEN locking/lock_protocol.h It looks like the reason for the failure is that this is run right away so the shell can't do the redirect. By the way, a simple "mkdir /tmp/test_libvirt/src/util" is sufficient to make the build pass.
src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..f98912f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,7 +181,7 @@ MAINTAINERCLEANFILES += util/virkeymaps.h util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ - <$(srcdir)/util/keymaps.csv >util/virkeymaps.h + <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h
It doesn't seem right to do stuff in the source dir when building. Remember it might be read-only. NACK to this approach. Should we perpahs create the directory if it doesn't exist in the process of generating it?

On Tue, Nov 03, 2015 at 10:40:50 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 09:08:04 +0100, Michal Privoznik wrote:
Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h
Maybe that's the actual problem.
[...]
src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..f98912f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,7 +181,7 @@ MAINTAINERCLEANFILES += util/virkeymaps.h util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ - <$(srcdir)/util/keymaps.csv >util/virkeymaps.h + <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h
A proper fix will be something along: diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..db0ca54 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1056,6 +1056,7 @@ libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \ $(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \ $(POLKIT_LIBS) +libvirt_util_DEPENDENCIES = util/keymaps.h noinst_LTLIBRARIES += libvirt_conf.la That fixes the symptom for me. Peter

On Tue, Nov 03, 2015 at 10:55:31AM +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 10:40:50 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 09:08:04 +0100, Michal Privoznik wrote:
Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h
Maybe that's the actual problem.
[...]
src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..f98912f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,7 +181,7 @@ MAINTAINERCLEANFILES += util/virkeymaps.h util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ - <$(srcdir)/util/keymaps.csv >util/virkeymaps.h + <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h
A proper fix will be something along:
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..db0ca54 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1056,6 +1056,7 @@ libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \ $(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \ $(POLKIT_LIBS) +libvirt_util_DEPENDENCIES = util/keymaps.h
Do you mean libvirt_util_la_DEPENDECIES? Why wouldn't it be in the dependencies when it is in the SOURCES? Although if that works for you, then I'm OK with that as well. Anyway, I don't see how that would create the directory in builddir. As I already said, I am OK with both reverting my patch that moves the generated file from srcdir to builddir (which is the right thing to do, but we generate *so* much stuff into srcdir already that it doesn't make much sense unless it's all fixed together), or just putting '$(MKDIR_P) util/' before the generation of virkeymaps.h. That fixes it as well.
noinst_LTLIBRARIES += libvirt_conf.la
That fixes the symptom for me.
Peter
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Tue, Nov 03, 2015 at 10:55:31 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 10:40:50 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 09:08:04 +0100, Michal Privoznik wrote:
Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h
Maybe that's the actual problem.
[...]
A proper fix will be something along:
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..db0ca54 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1056,6 +1056,7 @@ libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \ $(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \ $(POLKIT_LIBS) +libvirt_util_DEPENDENCIES = util/keymaps.h
Okay, this didn't work. I thought it did, but I've looked into a wrong terminal window ... This does work though: diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..8d7d3c6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -180,7 +180,8 @@ MAINTAINERCLEANFILES += util/virkeymaps.h util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ + $(AM_V_GEN) $(MKDIR_P) util;\ + $(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ <$(srcdir)/util/keymaps.csv >util/virkeymaps.h # Internal generic driver infrastructure

On 03.11.2015 11:09, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 10:55:31 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 10:40:50 +0100, Peter Krempa wrote:
On Tue, Nov 03, 2015 at 09:08:04 +0100, Michal Privoznik wrote:
Funny things happen when you try to do a VPATH build and pass --disable-dependency-tracking argument to the configure script. Not only the directory structure is not created at the end of configure phase, but also contradictory to others, virkeymaps.h
Maybe that's the actual problem.
[...]
A proper fix will be something along:
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..db0ca54 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1056,6 +1056,7 @@ libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \ $(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \ $(POLKIT_LIBS) +libvirt_util_DEPENDENCIES = util/keymaps.h
Okay, this didn't work. I thought it did, but I've looked into a wrong terminal window ...
This does work though:
diff --git a/src/Makefile.am b/src/Makefile.am index 99b4993..8d7d3c6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -180,7 +180,8 @@ MAINTAINERCLEANFILES += util/virkeymaps.h
util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ + $(AM_V_GEN) $(MKDIR_P) util;\ + $(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \ <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
# Internal generic driver infrastructure
Of course this will work as long as you are 'mkdir'-ing. My idea was that we should not do that directly (as that proves we have an error somewhere IMO), but let automake do that for us instead. Michal
participants (3)
-
Martin Kletzander
-
Michal Privoznik
-
Peter Krempa