Makefiles: Provide way to ship livepatch tests
cover Makefiles: Provide way to ship livepatch tests
I am trying to get the livepatches tested in osstest. As discussed, I would like the xen.git Makefiles to be able to ship the livepatch test files, so that osstest does not need to have too much special knowledge of the xen.git build system.
There are three preliminary patches which tidy up the xen/test Makefiles etc. a bit, and a final patch which provides the top-level targets. These targets are not invoked by default.
I have tested these with a private osstest branch; I got a pass with an amd64 toolstack. I'm still getting my osstest branch to DTRT with a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series needs some work. But given that I have had one pass, and verified that things work with a 32-bit x86 build, I think the xen.git changes can go in now.
I would ideally like this in 4.9 because I would like to establish the interface; also eventually I expect we will want to backport these Makefile changes to 4.8 so that we can test the 4.8 livepatching too.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/4 xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch
Dumping these patch files in /usr/lib/debug/xen-*.livepatch is a bit ugly.
Also, refactor the Makefile to have a LIVEPATCHES variable, to reduce repetition.
--- xen/test/livepatch/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
xen/test/livepatch/Makefile +11 -8
@@ -20,18 +20,21 @@ LIVEPATCH_BYE := xen_bye_world.livepatch LIVEPATCH_REPLACE := xen_replace_world.livepatch LIVEPATCH_NOP := xen_nop.livepatch +LIVEPATCHES += $(LIVEPATCH) +LIVEPATCHES += $(LIVEPATCH_BYE) +LIVEPATCHES += $(LIVEPATCH_REPLACE) +LIVEPATCHES += $(LIVEPATCH_NOP) + +LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch + default: livepatch install: livepatch - $(INSTALL_DATA) $(LIVEPATCH) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH) - $(INSTALL_DATA) $(LIVEPATCH_BYE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE) - $(INSTALL_DATA) $(LIVEPATCH_REPLACE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE) - $(INSTALL_DATA) $(LIVEPATCH_NOP) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP) + $(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) + $(INSTALL_DATA) $(LIVEPATCHES) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) + uninstall: - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP) + cd $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) && rm -f $(LIVEPATCHES) .PHONY: clean clean::
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch
Quoted 2 lines · Ian Jackson
Dumping these patch files in
/usr/lib/debug/xen-*.livepatchis a bit ugly.
<shrugs> Not really tied in where they go.
Quoted 5 lines
Also, refactor the
Makefileto have a LIVEPATCHES variable, to reduce repetition.CC Konrad Rzeszutek Wilk <[email protected]>
Quoted 42 lines
Signed-off-by Ian Jackson <[email protected]>--- xen/test/livepatch/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)xen/test/livepatch/Makefile +11
-8@@ -20,18 +20,21 @@ LIVEPATCH_BYE := xen_bye_world.livepatch LIVEPATCH_REPLACE := xen_replace_world.livepatch LIVEPATCH_NOP := xen_nop.livepatch +LIVEPATCHES += $(LIVEPATCH) +LIVEPATCHES += $(LIVEPATCH_BYE) +LIVEPATCHES += $(LIVEPATCH_REPLACE) +LIVEPATCHES += $(LIVEPATCH_NOP) + +LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch + default: livepatch install: livepatch - $(INSTALL_DATA) $(LIVEPATCH) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH) - $(INSTALL_DATA) $(LIVEPATCH_BYE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE) - $(INSTALL_DATA) $(LIVEPATCH_REPLACE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE) - $(INSTALL_DATA) $(LIVEPATCH_NOP) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP) + $(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) + $(INSTALL_DATA) $(LIVEPATCHES) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) + uninstall: - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE) - rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP) + cd $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) && rm -f $(LIVEPATCHES) .PHONY: clean clean::Signature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 2/4 xen/test/livepatch: Regularise Makefiles
In reply to Ian JacksonIn xen/test/livepatch/Makefile:
Provide a `build' target, as most of the
subdir-invoking Makefiles elsewhere expect.
In xen/test/Makefile:
Replace the two open-coded targets with a generalised pattern rule which descends into each of SUBDIRS. This allows `install' to work too (it is already supported by xen/test/livepatch/Makefile).
Provide an explicit default target of tests', and an all' target (which is conventional).
Suppress entry into the xen/test/livepatch subdir when we are building for i386, since the 32-bit hypervisor is not supported any more and we can't build livepatches for it either.
After this, the xen/test subdirectory is somewhere were make can be invoked in the way which is conventional for xen.git/xen/ subdirs.
None of this is yet invoked from the top-level Makefile.
--- xen/test/Makefile | 18 ++++++++++++------ xen/test/livepatch/Makefile | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-)
xen/test/Makefile +12 -6
@@ -1,7 +1,13 @@ -.PHONY: tests -tests: - $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch livepatch -.PHONY: clean -clean:: - $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean +tests all: build + + +ifneq ($(XEN_TARGET_ARCH),x86_32) +# Xen 32-bit x86 hypervisor no longer supported, so has no test livepatches +SUBDIRS += livepatch +endif + +%: + set -e; for s in $(SUBDIRS); do \ + $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \ + done
xen/test/livepatch/Makefile +1 -1
@@ -27,7 +27,7 @@ LIVEPATCHES += $(LIVEPATCH_NOP) LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch -default: livepatch +build default: livepatch install: livepatch $(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 2/4] xen/test/livepatch: Regularise Makefiles
Quoted 18 lines · Ian Jackson
In xen/test/livepatch/Makefile:
Provide a `build' target, as most of the
subdir-invoking Makefiles elsewhere expect.In xen/test/Makefile:
Replace the two open-coded targets with a generalised pattern rule which descends into each of SUBDIRS. This allows `install' to work too (it is already supported by xen/test/livepatch/Makefile).
Provide an explicit default target of
tests', and anall' target (which is conventional).Suppress entry into the xen/test/livepatch subdir when we are building for i386, since the 32-bit hypervisor is not supported any more and we can't build livepatches for it either.
Quoted 6 lines
After this, the xen/test subdirectory is somewhere were make can be invoked in the way which is conventional for xen.git/xen/ subdirs.
None of this is yet invoked from the top-level
Makefile.CC Konrad Rzeszutek Wilk <[email protected]>
I am not a Makefile expert but I can give you an
Quoted 46 lines
Signed-off-by Ian Jackson <[email protected]>--- xen/test/Makefile | 18 ++++++++++++------ xen/test/livepatch/Makefile | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-)xen/test/Makefile +12
-6@@ -1,7 +1,13 @@ -.PHONY: tests -tests: - $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch livepatch -.PHONY: clean -clean:: - $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean +tests all: build + + +ifneq ($(XEN_TARGET_ARCH),x86_32) +# Xen 32-bit x86 hypervisor no longer supported, so has no test livepatches +SUBDIRS += livepatch +endif + +%: + set -e; for s in $(SUBDIRS); do \ + $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \ + donexen/test/livepatch/Makefile +1
-1@@ -27,7 +27,7 @@ LIVEPATCHES += $(LIVEPATCH_NOP) LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch -default: livepatch +build default: livepatch install: livepatch $(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)Signature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 3/4 xen/test/livepatch: Add xen_nop.livepatch to .gitignore
In reply to Ian Jackson--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -300,6 +300,7 @@ xen/test/livepatch/config.h xen/test/livepatch/xen_bye_world.livepatch xen/test/livepatch/xen_hello_world.livepatch xen/test/livepatch/xen_replace_world.livepatch +xen/test/livepatch/xen_nop.livepatch xen/tools/kconfig/.tmp_gtkcheck xen/tools/kconfig/.tmp_qtcheck xen/tools/symbols
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore
Quoted 2 lines · Ian Jackson
CC Konrad Rzeszutek Wilk <[email protected]>Signed-off-by Ian Jackson <[email protected]>
Oh yes!
Quoted 19 lines
--- .gitignore | 1 + 1 file changed, 1 insertion(+).gitignore +1
-0@@ -300,6 +300,7 @@ xen/test/livepatch/config.h xen/test/livepatch/xen_bye_world.livepatch xen/test/livepatch/xen_hello_world.livepatch xen/test/livepatch/xen_replace_world.livepatch +xen/test/livepatch/xen_nop.livepatch xen/tools/kconfig/.tmp_gtkcheck xen/tools/kconfig/.tmp_qtcheck xen/tools/symbolsSignature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore
In reply to Ian Jackson.gitignore xen/test/livepatch/config.h · line 303
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 07.06.17 at 16:51, <[email protected]> wrote:
.gitignore +1
-0@@ -300,6 +300,7 @@ xen/test/livepatch/config.h xen/test/livepatch/xen_bye_world.livepatch xen/test/livepatch/xen_hello_world.livepatch xen/test/livepatch/xen_replace_world.livepatch +xen/test/livepatch/xen_nop.livepatch
Please move your addition one line up to respect alphabetical ordering.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 4/4 Makefile: Provide way to ship livepatch test files
In reply to Ian JacksonIn the toplevel Makefile, provide build-tests and install-tests targets which descend into xen/test. (dist-tests is provided automatically by the pattern rule, as is the convention here.)
We have to set BASEDIR ourselves, and use these curious runes, because the convention in Makefiles under xen/ is to "make -f Rules.mk" with BASEDIR set and to expect Rules.mk to reinvoke the per-directory Makefile. (This is really very strange.) Normally this invocation pattern is organised by the machinery in xen/Makefile (which sets BASEDIR) and Rules.mk, but we need to invoke it from outside that context.
In theory it would be nice to have a pattern rule %-tests. But this is not the style in the rest of the toplevel Makefile; and doing that might interfere with the dist-% pattern rule.
None of this is invoked by default. If install-tests or dist-tests is requested, the livepatches (the only current output from xen/tests) are shipped in DESTDIR/usr/lib/debug/xen-livepatch/.
This allows CI systems such as osstest which are trying to consume this to arrange for the files to be built, and output, without them having to have special knowledge of the details of Xen's build syste.
--- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+)
Makefile +11 -0
@@ -144,6 +144,17 @@ tools/firmware/ovmf-dir-force-update: install-docs: $(MAKE) -C docs install +# We only have build-tests install-tests, not uninstall-tests etc. +.PHONY: build-tests +build-tests: build-xen + export BASEDIR=$(XEN_ROOT)/xen; \ + $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test build + +.PHONY: install-tests +install-tests: install-xen + export BASEDIR=$(XEN_ROOT)/xen; \ + $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test install + # build xen and the tools and place them in the install # directory. 'make install' should then copy them to the normal system # directories
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 4/4] Makefile: Provide way to ship livepatch test files
Quoted 20 lines · Ian Jackson
In the toplevel
Makefile, provide build-tests and install-tests targets which descend into xen/test. (dist-tests is provided automatically by the pattern rule, as is the convention here.)We have to set BASEDIR ourselves, and use these curious runes, because the convention in Makefiles under xen/ is to "make -f Rules.mk" with BASEDIR set and to expect Rules.mk to reinvoke the per-directory
Makefile. (This is really very strange.) Normally this invocation pattern is organised by the machinery in xen/Makefile (which sets BASEDIR) and Rules.mk, but we need to invoke it from outside that context.In theory it would be nice to have a pattern rule %-tests. But this is not the style in the rest of the toplevel
Makefile; and doing that might interfere with the dist-% pattern rule.None of this is invoked by default. If install-tests or dist-tests is requested, the livepatches (the only current output from xen/tests) are shipped in DESTDIR/usr/lib/debug/xen-livepatch/.
Quoted 5 lines
This allows CI systems such as osstest which are trying to consume this to arrange for the files to be built, and output, without them having to have special knowledge of the details of Xen's build syste.
CC Konrad Rzeszutek Wilk <[email protected]>
Quoted 30 lines
Signed-off-by Ian Jackson <[email protected]>--- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+)Makefile +11
-0@@ -144,6 +144,17 @@ tools/firmware/ovmf-dir-force-update: install-docs: $(MAKE) -C docs install +# We only have build-tests install-tests, not uninstall-tests etc. +.PHONY: build-tests +build-tests: build-xen + export BASEDIR=$(XEN_ROOT)/xen; \ + $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test build + +.PHONY: install-tests +install-tests: install-xen + export BASEDIR=$(XEN_ROOT)/xen; \ + $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test install + # build xen and the tools and place them in the install # directory. 'make install' should then copy them to the normal system # directoriesSignature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 4/4] Makefile: Provide way to ship livepatch test files
In reply to Ian JacksonQuoted 3 lines · Ian Jackson
This allows CI systems such as osstest which are trying to consume this to arrange for the files to be built, and output, without them having to have special knowledge of the details of Xen's build syste.
system.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 lines · Ian Jackson
I am trying to get the livepatches tested in osstest. As discussed, I would like the xen.git Makefiles to be able to ship the livepatch test files, so that osstest does not need to have too much special knowledge of the xen.git build system.
There are three preliminary patches which tidy up the xen/test Makefiles etc. a bit, and a final patch which provides the top-level targets. These targets are not invoked by default.
Quoted 6 lines
I have tested these with a private osstest branch; I got a pass with an amd64 toolstack. I'm still getting my osstest branch to DTRT with a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series needs some work. But given that I have had one pass, and verified that things work with a 32-bit x86 build, I think the xen.git changes can go in now.
Thank you for taking these up!
Quoted 7 lines
I would ideally like this in 4.9 because I would like to establish the interface; also eventually I expect we will want to backport these
Makefilechanges to 4.8 so that we can test the 4.8 livepatching too.Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 17 lines
Quoted 1 line
Quoted 1 line · On 07.06.17 at 16:51, <[email protected]> wrote:
I am trying to get the livepatches tested in osstest. As discussed, I would like the xen.git Makefiles to be able to ship the livepatch test files, so that osstest does not need to have too much special knowledge of the xen.git build system.
There are three preliminary patches which tidy up the xen/test Makefiles etc. a bit, and a final patch which provides the top-level targets. These targets are not invoked by default.
I have tested these with a private osstest branch; I got a pass with an amd64 toolstack. I'm still getting my osstest branch to DTRT with a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series needs some work. But given that I have had one pass, and verified that things work with a 32-bit x86 build, I think the xen.git changes can go in now.
Quoted 3 lines
I would ideally like this in 4.9 because I would like to establish the interface; also eventually I expect we will want to backport these
Makefilechanges to 4.8 so that we can test the 4.8 livepatching too.
With the one minor remark on patch 3 addressed
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 16 lines · Ian Jackson
I am trying to get the livepatches tested in osstest. As discussed, I would like the xen.git Makefiles to be able to ship the livepatch test files, so that osstest does not need to have too much special knowledge of the xen.git build system.
There are three preliminary patches which tidy up the xen/test Makefiles etc. a bit, and a final patch which provides the top-level targets. These targets are not invoked by default.
I have tested these with a private osstest branch; I got a pass with an amd64 toolstack. I'm still getting my osstest branch to DTRT with a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series needs some work. But given that I have had one pass, and verified that things work with a 32-bit x86 build, I think the xen.git changes can go in now.
Quoted 4 lines
I would ideally like this in 4.9 because I would like to establish the interface; also eventually I expect we will want to backport these
Makefilechanges to 4.8 so that we can test the 4.8 livepatching too.
+1 for this to go into 4.9 and be backported to 4.8.
Quoted 2 lines
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages]
Wei Liu writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
Quoted 1 line
Acked-by Wei Liu <[email protected]>
Thanks to everyone for the review and acks.
Quoted 1 line
+1 for this to go into 4.9 and be backported to 4.8.
Thanks.
Jan Beulich writes ("Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore"):
Quoted 5 lines · On 07.06.17 at 16:51, <[email protected]> wrote:
Quoted 1 line
+xen/test/livepatch/xen_nop.livepatch
Please move your addition one line up to respect alphabetical ordering.
Of course. Done.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Hi,
Quoted 17 lines · Wei Liu
Quoted 16 lines · Ian Jackson
I am trying to get the livepatches tested in osstest. As discussed, I would like the xen.git Makefiles to be able to ship the livepatch test files, so that osstest does not need to have too much special knowledge of the xen.git build system.
There are three preliminary patches which tidy up the xen/test Makefiles etc. a bit, and a final patch which provides the top-level targets. These targets are not invoked by default.
I have tested these with a private osstest branch; I got a pass with an amd64 toolstack. I'm still getting my osstest branch to DTRT with a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series needs some work. But given that I have had one pass, and verified that things work with a 32-bit x86 build, I think the xen.git changes can go in now.
Quoted 8 lines
Quoted 4 lines
I would ideally like this in 4.9 because I would like to establish the interface; also eventually I expect we will want to backport these
Makefilechanges to 4.8 so that we can test the 4.8 livepatching too.Acked-by Wei Liu <[email protected]>+1 for this to go into 4.9 and be backported to 4.8.
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Julien Grall writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
Quoted 1 line
Release-acked-by Julien Grall <[email protected]>
Thanks. I have pushed this to staging and will wait for an osstest test report to check I didn't break the build, before applying the same commits to staging-4.9.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Hi Ian,
Quoted 6 lines · Ian Jackson
Julien Grall writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
Quoted 1 line
Release-acked-by Julien Grall <[email protected]>Thanks. I have pushed this to staging and will wait for an osstest test report to check I didn't break the build, before applying the same commits to staging-4.9.
I don't see the patches in staging. Do you still plan to have those patches in Xen 4.9?
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Julien Grall writes ("Re: [Xen-devel] [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
Quoted 2 lines
I don't see the patches in staging. Do you still plan to have those patches in Xen 4.9?
As you'll have seen, they went to staging last week and are now in xen.git#master. I have just applied them to staging-4.9 (and staging-4.8).
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines · Ian Jackson
Julien Grall writes ("Re: [Xen-devel] [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
Quoted 2 lines
I don't see the patches in staging. Do you still plan to have those patches in Xen 4.9?
As you'll have seen, they went to staging last week and are now in xen.git#master. I have just applied them to staging-4.9 (and staging-4.8).
Unfortunately, the make -C xen clean target is now broken.
make -f /local/xen.git/xen/Rules.mk -C test clean make[2]: Entering directory '/local/xen.git/xen/test' set -e; for s in livepatch; do \
make -f /local/xen.git/xen/Rules.mk -C $s .*.d; \
done
make[3]: Entering directory '/local/xen.git/xen/test/livepatch' make[3]: *** No rule to make target '.*.d'. Stop. make[3]: Leaving directory '/local/xen.git/xen/test/livepatch'
I think the %: rule is too general, and needs restricting to the primary commands.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/1 xen/test/Makefile: Fix clean target, broken by pattern rule
In "xen/test/livepatch: Regularise Makefiles" we reworked xen/test/Makefile to use a pattern rule. However, there are two problems with this. Both are related to the way that xen/Rules.mk is implicitly part of this Makefile because of the way that Makefiles under xen/ are invoked by their parent directory Makefiles.
Firstly, the Rules.mk clean' target overrides the pattern rule in xen/test/Makefile. The result is that make -C xen clean' does not actually run the livepatch clean target.
The Rules.mk clean target does have provision for recursing into subdirectories, but that feature is tangled up with complex object file iteration machinery which is not desirable here. However, we can extend the Rules.mk clean target since it is a double-colon rules.
Sadly this involves duplicating the SUBDIR iteration boilerplate. (A make function could be used but the cure would be worse than the disease.)
Secondly, Rules.mk has a number of -include directives. make likes to try to (re)build files mentioned in includes. With the % pattern rule, this applies to those files too.
As a result, make -C xen clean would try to build .*.d' (for example) in xen/test. This would fail with an error message. The error would be ignored because of the -', but it's annoying and ugly.
Solve this by limiting the % pattern rule to the targets we expect it to handle. These are those listed in the top-level Makefile, apart
from: those which are subdir- or component-qualified; clean targets (which are handled specially, even distclean); and dist, src-tarball-*, etc. (which are converted to install by an earlier Makefile).
--- xen/test/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
xen/test/Makefile +6 -1
@@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32) SUBDIRS += livepatch endif -%: +install build subtree-force-update uninstall: %: set -e; for s in $(SUBDIRS); do \ $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \ done + +clean:: + set -e; for s in $(SUBDIRS); do \ + $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \ + done
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
Quoted 19 lines · Ian Jackson
In "xen/test/livepatch: Regularise Makefiles" we reworked xen/test/Makefile to use a pattern rule. However, there are two problems with this. Both are related to the way that
xen/Rules.mkis implicitly part of thisMakefilebecause of the way that Makefiles under xen/ are invoked by their parent directory Makefiles.Firstly, the Rules.mk
clean' target overrides the pattern rule in xen/test/Makefile. The result is thatmake -C xen clean' does not actually run the livepatch clean target.The Rules.mk clean target does have provision for recursing into subdirectories, but that feature is tangled up with complex object file iteration machinery which is not desirable here. However, we can extend the Rules.mk clean target since it is a double-colon rules.
Sadly this involves duplicating the SUBDIR iteration boilerplate. (A make function could be used but the cure would be worse than the disease.)
Quoted 7 lines
Secondly, Rules.mk has a number of -include directives. make likes to try to (re)build files mentioned in includes. With the % pattern rule, this applies to those files too.
As a result, make -C xen clean would try to build
.*.d' (for example) in xen/test. This would fail with an error message. The error would be ignored because of the-', but it's annoying and ugly.
Aaah.
Quoted 10 lines
Solve this by limiting the % pattern rule to the targets we expect it to handle. These are those listed in the top-level
Makefile, apart
from: those which are subdir- or component-qualified; clean targets (which are handled specially, even distclean); and dist, src-tarball-*, etc. (which are converted to install by an earlierMakefile).Reported-by Andrew Cooper <[email protected]>Signed-off-by Ian Jackson <[email protected]>
Quoted 30 lines
--- xen/test/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)xen/test/Makefile +6
-1@@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32) SUBDIRS += livepatch endif -%: +install build subtree-force-update uninstall: %: set -e; for s in $(SUBDIRS); do \ $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \ done + +clean:: + set -e; for s in $(SUBDIRS); do \ + $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \ + doneSignature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
In reply to Ian JacksonQuoted 34 lines · Ian Jackson
In "xen/test/livepatch: Regularise Makefiles" we reworked xen/test/Makefile to use a pattern rule. However, there are two problems with this. Both are related to the way that
xen/Rules.mkis implicitly part of thisMakefilebecause of the way that Makefiles under xen/ are invoked by their parent directory Makefiles.Firstly, the Rules.mk
clean' target overrides the pattern rule in xen/test/Makefile. The result is thatmake -C xen clean' does not actually run the livepatch clean target.The Rules.mk clean target does have provision for recursing into subdirectories, but that feature is tangled up with complex object file iteration machinery which is not desirable here. However, we can extend the Rules.mk clean target since it is a double-colon rules.
Sadly this involves duplicating the SUBDIR iteration boilerplate. (A make function could be used but the cure would be worse than the disease.)
Secondly, Rules.mk has a number of -include directives. make likes to try to (re)build files mentioned in includes. With the % pattern rule, this applies to those files too.
As a result, make -C xen clean would try to build
.*.d' (for example) in xen/test. This would fail with an error message. The error would be ignored because of the-', but it's annoying and ugly.Solve this by limiting the % pattern rule to the targets we expect it to handle. These are those listed in the top-level
Makefile, apart
from: those which are subdir- or component-qualified; clean targets (which are handled specially, even distclean); and dist, src-tarball-*, etc. (which are converted to install by an earlierMakefile).
Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Ian Jackson <[email protected]>
And
Quoted 30 lines
--- xen/test/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)xen/test/Makefile +6
-1@@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32) SUBDIRS += livepatch endif -%: +install build subtree-force-update uninstall: %: set -e; for s in $(SUBDIRS); do \ $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \ done + +clean:: + set -e; for s in $(SUBDIRS); do \ + $(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \ + doneSignature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
Hi,
Quoted 35 lines · Konrad Rzeszutek Wilk
Quoted 34 lines · Ian Jackson
In "xen/test/livepatch: Regularise Makefiles" we reworked xen/test/Makefile to use a pattern rule. However, there are two problems with this. Both are related to the way that
xen/Rules.mkis implicitly part of thisMakefilebecause of the way that Makefiles under xen/ are invoked by their parent directory Makefiles.Firstly, the Rules.mk
clean' target overrides the pattern rule in xen/test/Makefile. The result is thatmake -C xen clean' does not actually run the livepatch clean target.The Rules.mk clean target does have provision for recursing into subdirectories, but that feature is tangled up with complex object file iteration machinery which is not desirable here. However, we can extend the Rules.mk clean target since it is a double-colon rules.
Sadly this involves duplicating the SUBDIR iteration boilerplate. (A make function could be used but the cure would be worse than the disease.)
Secondly, Rules.mk has a number of -include directives. make likes to try to (re)build files mentioned in includes. With the % pattern rule, this applies to those files too.
As a result, make -C xen clean would try to build
.*.d' (for example) in xen/test. This would fail with an error message. The error would be ignored because of the-', but it's annoying and ugly.Solve this by limiting the % pattern rule to the targets we expect it to handle. These are those listed in the top-level
Makefile, apart
from: those which are subdir- or component-qualified; clean targets (which are handled specially, even distclean); and dist, src-tarball-*, etc. (which are converted to install by an earlierMakefile).
Quoted 5 lines
Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Ian Jackson <[email protected]>And
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel