[libvirt] [PATCH] build: ensure 'make check' sees up-to-date config.h

Nehal J. Wani reported on IRC a rather interesting build failure: In file included from util/virnetdevbridge.c:53:0: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr' struct in6_addr { ^ I traced it to the fact that he ran 'git pull; make check' across commit e62e0094. What happened is that the configure changes result in a new variable that was set to be defined on his system, but config.h was not regenerated to contain the value of that variable. Running 'make' instead of 'make check' cleaned up the problem. A bit more investigation, and I see that in Makefile.am, automake sticks rules that rebuild config.h as part of 'make all', and that we also had a dependency 'check-local: all'; BUT the rule for check-local is run only at the point when the top-level directory is visited. Automake documents that SUBDIRS should contain an explicit '.' at the point the top-level should be visited (defaulting to last, if it doesn't appear). Sure enough, with this patch, 'make check' now does the top-level 'all' rules, which regenerates 'config.h' BEFORE compiling any code that might depend on changed content of that file. * Makefile.am (SUBDIRS): Put '.' first, not last. Signed-off-by: Eric Blake <eblake@redhat.com> --- Tough to argue the build-breaker rule on this one, since a fresh checkout doesn't hit it (only a 'make check' without a 'make', across an incremental build that happened to need new configure substitutions). So I'll wait for a review for my one-liner. Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4e24ecf..66cb677 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ LCOV = lcov GENHTML = genhtml -SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \ +SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \ python tests po examples/domain-events/events-c examples/hellolibvirt \ examples/dominfo examples/domsuspend examples/python examples/apparmor \ examples/xml/nwfilter examples/openauth examples/systemtap -- 1.7.1

On Thu, Sep 19, 2013 at 4:02 AM, Eric Blake <eblake@redhat.com> wrote:
Nehal J. Wani reported on IRC a rather interesting build failure:
In file included from util/virnetdevbridge.c:53:0: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr' struct in6_addr { ^
I traced it to the fact that he ran 'git pull; make check' across commit e62e0094. What happened is that the configure changes result in a new variable that was set to be defined on his system, but config.h was not regenerated to contain the value of that variable. Running 'make' instead of 'make check' cleaned up the problem. A bit more investigation, and I see that in Makefile.am, automake sticks rules that rebuild config.h as part of 'make all', and that we also had a dependency 'check-local: all'; BUT the rule for check-local is run only at the point when the top-level directory is visited. Automake documents that SUBDIRS should contain an explicit '.' at the point the top-level should be visited (defaulting to last, if it doesn't appear). Sure enough, with this patch, 'make check' now does the top-level 'all' rules, which regenerates 'config.h' BEFORE compiling any code that might depend on changed content of that file.
* Makefile.am (SUBDIRS): Put '.' first, not last.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
Tough to argue the build-breaker rule on this one, since a fresh checkout doesn't hit it (only a 'make check' without a 'make', across an incremental build that happened to need new configure substitutions). So I'll wait for a review for my one-liner.
Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 4e24ecf..66cb677 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ LCOV = lcov GENHTML = genhtml
-SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \ +SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \ python tests po examples/domain-events/events-c examples/hellolibvirt \ examples/dominfo examples/domsuspend examples/python examples/apparmor \ examples/xml/nwfilter examples/openauth examples/systemtap -- 1.7.1
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Ping. If there is a specific reason why this was not pushed, I would like to know. Nehal J Wani

On 09/23/2013 09:07 AM, Nehal J Wani wrote:
On Thu, Sep 19, 2013 at 4:02 AM, Eric Blake <eblake@redhat.com> wrote:
Nehal J. Wani reported on IRC a rather interesting build failure:
In file included from util/virnetdevbridge.c:53:0: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr' struct in6_addr { ^
* Makefile.am (SUBDIRS): Put '.' first, not last.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
Tough to argue the build-breaker rule on this one, since a fresh checkout doesn't hit it (only a 'make check' without a 'make', across an incremental build that happened to need new configure substitutions). So I'll wait for a review for my one-liner.
Ping. If there is a specific reason why this was not pushed, I would like to know.
Pong - no one has reviewed it. Did it work for you? If so, state that, and your review will serve as enough for me to push it :) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Sep 23, 2013 at 9:13 PM, Eric Blake <eblake@redhat.com> wrote:
On 09/23/2013 09:07 AM, Nehal J Wani wrote:
On Thu, Sep 19, 2013 at 4:02 AM, Eric Blake <eblake@redhat.com> wrote:
Nehal J. Wani reported on IRC a rather interesting build failure:
In file included from util/virnetdevbridge.c:53:0: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr' struct in6_addr { ^
* Makefile.am (SUBDIRS): Put '.' first, not last.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
Tough to argue the build-breaker rule on this one, since a fresh checkout doesn't hit it (only a 'make check' without a 'make', across an incremental build that happened to need new configure substitutions). So I'll wait for a review for my one-liner.
Ping. If there is a specific reason why this was not pushed, I would like to know.
Pong - no one has reviewed it. Did it work for you? If so, state that, and your review will serve as enough for me to push it :)
Running 'make' and then 'make check' worked for me. So, I guess there is no problem in pushing this patch. -- Nehal J Wani

On 09/23/2013 11:21 AM, Nehal J Wani wrote:
* Makefile.am (SUBDIRS): Put '.' first, not last.
Pong - no one has reviewed it. Did it work for you? If so, state that, and your review will serve as enough for me to push it :)
Running 'make' and then 'make check' worked for me. So, I guess there is no problem in pushing this patch.
Thanks; pushing shortly :) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Nehal J Wani