# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # Date 1346951410 -7200 # Node ID cc71fe7029b27cb95d268b99e136c445903af927 # Parent 8a2eef481d3ab3ca5692dd0083c95cf314fe1da3 libxl: add missing dependencies of libxl.h libxl.h includes generated files, but the Makefile lists no dependency on these files. As a result compilation may fail like this: [ 379s] make -C libxl install [ 379s] make[3]: Entering directory `/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl'' [ 379s] /usr/bin/perl /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue-h-seddery /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue.h --prefix=libxl >_libxl_list.h.new ... [ 380s] gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF ._libxl.api-for-check.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Werror -Wno-format-zero-length -Wmissing-declarations -Wno-declaration-after-statement -Wformat-nonliteral -I. -fPIC -pthread -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxl -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../. ./tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -include /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/config.h -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -c -E libxl.h \ [ 380s] -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ [ 380s] >_libxl.api-for-check.new ... [ 380s] libxl.h:260:25: fatal error: _libxl_list.h: No such file or directory [ 380s] compilation terminated. [ 380s] make[3]: *** [_libxl.api-for-check] Error 1 [ 381s] if ! cmp -s _libxl_list.h.new _libxl_list.h; then mv -f _libxl_list.h.new _libxl_list.h; else rm -f _libxl_list.h.new; fi Fix this be extending the existing libxl.h dependency with the generated file _libxl_list.h, and also with the existing libxl_event.h. Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r 8a2eef481d3a -r cc71fe7029b2 tools/libxl/Makefile --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -140,7 +140,7 @@ _libxl_save_msgs_helper.h _libxl_save_ms $(PERL) -w $< $@ >$@.new $(call move-if-changed,$@.new,$@) -libxl.h: _libxl_types.h +libxl.h: _libxl_types.h _libxl_list.h libxl_event.h libxl_json.h: _libxl_types_json.h libxl_internal.h: _libxl_types_internal.h _paths.h libxl_internal_json.h: _libxl_types_internal_json.h
On Thu, 2012-09-06 at 18:14 +0100, Olaf Hering wrote:> # HG changeset patch > # User Olaf Hering <olaf@aepfle.de> > # Date 1346951410 -7200 > # Node ID cc71fe7029b27cb95d268b99e136c445903af927 > # Parent 8a2eef481d3ab3ca5692dd0083c95cf314fe1da3 > libxl: add missing dependencies of libxl.h > > libxl.h includes generated files, but the Makefile lists no dependency on > these files. As a result compilation may fail like this: > > [ 379s] make -C libxl install > [ 379s] make[3]: Entering directory `/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl'' > [ 379s] /usr/bin/perl /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue-h-seddery /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue.h --prefix=libxl >_libxl_list.h.new > ... > [ 380s] gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF ._libxl.api-for-check.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Werror -Wno-format-zero-length -Wmissing-declarations -Wno-declaration-after-statement -Wformat-nonliteral -I. -fPIC -pthread -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxl -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -include /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/config.h -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -c -E libxl.h \> [ 380s] -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ > [ 380s] >_libxl.api-for-check.new > ... > [ 380s] libxl.h:260:25: fatal error: _libxl_list.h: No such file or directory > [ 380s] compilation terminated. > [ 380s] make[3]: *** [_libxl.api-for-check] Error 1 > [ 381s] if ! cmp -s _libxl_list.h.new _libxl_list.h; then mv -f _libxl_list.h.new _libxl_list.h; else rm -f _libxl_list.h.new; fi > > > Fix this be extending the existing libxl.h dependency with the generated file > _libxl_list.h, and also with the existing libxl_event.h. > > Signed-off-by: Olaf Hering <olaf@aepfle.de> > > diff -r 8a2eef481d3a -r cc71fe7029b2 tools/libxl/Makefile > --- a/tools/libxl/Makefile > +++ b/tools/libxl/Makefile > @@ -140,7 +140,7 @@ _libxl_save_msgs_helper.h _libxl_save_ms > $(PERL) -w $< $@ >$@.new > $(call move-if-changed,$@.new,$@) > > -libxl.h: _libxl_types.h > +libxl.h: _libxl_types.h _libxl_list.h libxl_event.hYou don''t need libxl_event.h here (it''s not autogenerated). I''m not sure if $(AUTOINCS) should be used here. Ian J probably has an opinion.> libxl_json.h: _libxl_types_json.h > libxl_internal.h: _libxl_types_internal.h _paths.h > libxl_internal_json.h: _libxl_types_internal_json.h > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # Date 1347009935 -7200 # Node ID da03cd98d2fbc6c3a176f34b17cb6184a518525e # Parent ec23c2a11f6fa55bd0472377a7324d67cdf86248 libxl: add missing dependencies of libxl.h libxl.h includes generated files, but the Makefile lists no dependency on these files. As a result compilation may fail like this: [ 379s] make -C libxl install [ 379s] make[3]: Entering directory `/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl'' [ 379s] /usr/bin/perl /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue-h-seddery /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include/xen-external/bsd-sys-queue.h --prefix=libxl >_libxl_list.h.new ... [ 380s] gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF ._libxl.api-for-check.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Werror -Wno-format-zero-length -Wmissing-declarations -Wno-declaration-after-statement -Wformat-nonliteral -I. -fPIC -pthread -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxl -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -include /usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/config.h -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/libxc -I/usr/src/packages/BUILD/xen-4.2.25821/non-dbg/tools/libxl/../../tools/include -c -E libxl.h \ [ 380s] -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ [ 380s] >_libxl.api-for-check.new ... [ 380s] libxl.h:260:25: fatal error: _libxl_list.h: No such file or directory [ 380s] compilation terminated. [ 380s] make[3]: *** [_libxl.api-for-check] Error 1 [ 381s] if ! cmp -s _libxl_list.h.new _libxl_list.h; then mv -f _libxl_list.h.new _libxl_list.h; else rm -f _libxl_list.h.new; fi Fix this be extending the existing libxl.h dependency with the generated file _libxl_list.h. Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r ec23c2a11f6f -r da03cd98d2fb tools/libxl/Makefile --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -140,7 +140,7 @@ _libxl_save_msgs_helper.h _libxl_save_ms $(PERL) -w $< $@ >$@.new $(call move-if-changed,$@.new,$@) -libxl.h: _libxl_types.h +libxl.h: _libxl_types.h _libxl_list.h libxl_json.h: _libxl_types_json.h libxl_internal.h: _libxl_types_internal.h _paths.h libxl_internal_json.h: _libxl_types_internal_json.h
Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: add missing dependencies of libxl.h"):> On Thu, 2012-09-06 at 18:14 +0100, Olaf Hering wrote: > > libxl: add missing dependencies of libxl.hThis is not correct. A dependency in the sense of make is a thing which is used to construct the target file, not a thing which the target file''s contents refers to. The correct fix is, I think, this: diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index a9d9ec6..f48e304 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -119,7 +119,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check $(PERL) $^ touch $@ -_%.api-for-check: %.h +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ >$@.new Can you confirm that this fixes it for you ? Ian.
On Fri, Sep 07, Ian Jackson wrote:> -_%.api-for-check: %.h > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) > $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ > -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ > >$@.new > > Can you confirm that this fixes it for you ?The package builds fine with this change. The failure if fixes happend only once. Olaf
Olaf Hering writes ("Re: [Xen-devel] [PATCH] libxl: add missing dependencies of libxl.h"):> On Fri, Sep 07, Ian Jackson wrote: > > -_%.api-for-check: %.h > > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) > > $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ > > -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ > > >$@.new > > > > Can you confirm that this fixes it for you ? > > The package builds fine with this change. > The failure if fixes happend only once.Hmm. Adding this: (WARNING DO NOT APPLY THIS BIT) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index a9d9ec6..5f2332c 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -132,6 +132,7 @@ _paths.h: genpath _libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h $(PERL) $^ --prefix=libxl >$@.new + sleep 10 $(call move-if-changed,$@.new,$@) _libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ allowed me to repro the failure and confirm that my proposed change fixes it. So (for -unstable and 4.2), the fix is below. Ian. Subject: [PATCH] libxl: Fix missing dependency in api check rule Without this, the api check cpp run might happen before the various autogenerated files which are #include by libxl.h are ready. We need to filter out the api-ok file from AUTOINCS to avoid a circular dependency. The result is that the api check is the last thing to be done before make considers the AUTOINCS all done and can start work on compiling .c files into .o''s. Reported-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 5f2332c..c298e97 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -119,7 +119,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check $(PERL) $^ touch $@ -_%.api-for-check: %.h +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ >$@.new
Ian Campbell
2012-Sep-11 14:40 UTC
Re: [PATCH] libxl: Fix missing dependency in api check rule
On Tue, 2012-09-11 at 15:35 +0100, Ian Jackson wrote:> Olaf Hering writes ("Re: [Xen-devel] [PATCH] libxl: add missing dependencies of libxl.h"): > > On Fri, Sep 07, Ian Jackson wrote: > > > -_%.api-for-check: %.h > > > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) > > > $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ > > > -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ > > > >$@.new > > > > > > Can you confirm that this fixes it for you ? > > > > The package builds fine with this change. > > The failure if fixes happend only once. > > Hmm. > > Adding this: (WARNING DO NOT APPLY THIS BIT) > > diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile > index a9d9ec6..5f2332c 100644 > --- a/tools/libxl/Makefile > +++ b/tools/libxl/Makefile > @@ -132,6 +132,7 @@ _paths.h: genpath > > _libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h > $(PERL) $^ --prefix=libxl >$@.new > + sleep 10 > $(call move-if-changed,$@.new,$@) > > _libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ > > allowed me to repro the failure and confirm that my proposed change > fixes it. > > So (for -unstable and 4.2), the fix is below. > > Ian. > > > Subject: [PATCH] libxl: Fix missing dependency in api check rule > > Without this, the api check cpp run might happen before the various > autogenerated files which are #include by libxl.h are ready. > > We need to filter out the api-ok file from AUTOINCS to avoid a > circular dependency. The result is that the api check is the last > thing to be done before make considers the AUTOINCS all done and can > start work on compiling .c files into .o''s. > > Reported-by: Olaf Hering <olaf@aepfle.de> > Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com> I''m ok with this for 4.2.0. Although I do wonder if this:> -_%.api-for-check: %.h > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS))Indicates that libxl.api-ok doesn''t strictly speaking belong in AUTOINCS.
Ian Jackson
2012-Sep-11 15:37 UTC
Re: [PATCH] libxl: Fix missing dependency in api check rule
Ian Campbell writes ("Re: [PATCH] libxl: Fix missing dependency in api check rule"):> Although I do wonder if this: > > > -_%.api-for-check: %.h > > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) > > Indicates that libxl.api-ok doesn''t strictly speaking belong in > AUTOINCS.It would be possible to instead write: -$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS) +$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS) libxl.api-ok If you''d prefer that I''d be happy to test that it actually works. Ian.
Ian Campbell
2012-Sep-11 16:08 UTC
Re: [PATCH] libxl: Fix missing dependency in api check rule
On Tue, 2012-09-11 at 16:37 +0100, Ian Jackson wrote:> Ian Campbell writes ("Re: [PATCH] libxl: Fix missing dependency in api check rule"): > > Although I do wonder if this: > > > > > -_%.api-for-check: %.h > > > +_%.api-for-check: %.h $(filter-out %.api-ok, $(AUTOINCS)) > > > > Indicates that libxl.api-ok doesn''t strictly speaking belong in > > AUTOINCS. > > It would be possible to instead write: > > -$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS) > +$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS): $(AUTOINCS) libxl.api-ok > > If you''d prefer that I''d be happy to test that it actually works.Please do. Perhaps $(APICHECKS) ? Up to you.> > Ian.
Ian Jackson
2012-Sep-11 16:10 UTC
Re: [PATCH] libxl: Fix missing dependency in api check rule
Ian Campbell writes ("Re: [PATCH] libxl: Fix missing dependency in api check rule"):> On Tue, 2012-09-11 at 16:37 +0100, Ian Jackson wrote: > > If you''d prefer that I''d be happy to test that it actually works. > > Please do. > > Perhaps $(APICHECKS) ? Up to you.I think given it''s just the one right now it will do to just have the filename :-). Ian.