Skip to contentSkip to conversation

vmbuild tweaks for BSD targets

RFC PATCH In review Alex Bennée 2 participants 9 messages Jan 21, 2019 – Jan 24, 2019

lore
Share & tools
lore
#0 lore raw

cover vmbuild tweaks for BSD targets

Hi,

While I was digging through the BSD failures on my failed fpu/next PR I realised the build wasn't quite as flexible as it could be. These patches expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS to the vmbuild machinery so you can "quickly" run a subset of your build via the VMs.

Currently OpenBSD hasn't been tweaked because make check fails on that. If any of the OpenBSD folk wish to chime in on why that would be nice.

Alex Bennée (3):
tests/vm: call make check directly for netbsd/freebsd tests/vm: add --build-target option
tests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS

 tests/vm/Makefile.include | 10 +++++++++-
 tests/vm/basevm.py        |  3 +++
 tests/vm/freebsd          |  3 +--
 tests/vm/netbsd           |  3 +--
 4 files changed, 14 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

RFC PATCH 1/3 tests/vm: call make check directly for netbsd/freebsd

The "make check" target calls check-qtest which has the appropriate system binaries as dependencies so we shouldn't need to do two steps of make invocation.

---
 tests/vm/freebsd | 1 -
 1 file changed, 1 deletion(-)
tests/vm/freebsd +0 -1
index 19a3729172..a85c866c30 100755
@@ -25,7 +25,6 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};
         gmake --output-sync -j{jobs} check {verbose};
     """
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [Qemu-devel] [RFC PATCH 1/3] tests/vm: call make check directly for netbsd/freebsd

Quoted 14 lines · Alex Bennée

The "make check" target calls check-qtest which has the appropriate system binaries as dependencies so we shouldn't need to do two steps of make invocation.

---
 tests/vm/freebsd | 1 -
 1 file changed, 1 deletion(-)
tests/vm/freebsd +0 -0
index 19a3729172..a85c866c30 100755

tests/vm/freebsd class FreeBSDVM(basevm.BaseVM): · line 30

Quoted 7 lines
tests/vm/freebsd +0 -1
@@ -25,7 +25,6 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};
         gmake --output-sync -j{jobs} check {verbose};
     """
 
#3 lore raw

Re: [Qemu-devel] [RFC PATCH 1/3] tests/vm: call make check directly for netbsd/freebsd

Quoted 5 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Alex Bennée

The "make check" target calls check-qtest which has the appropriate system binaries as dependencies so we shouldn't need to do two steps of make invocation.

Now I remember, this was necessary to do this in 2 steps before ebb61f804d6, build threaded and test not threaded. Maybe worth adding a comment referencing this commit?

Quoted 21 lines
Quoted 11 lines
---
 tests/vm/freebsd | 1 -
 1 file changed, 1 deletion(-)
tests/vm/freebsd +0 -0
index 19a3729172..a85c866c30 100755

tests/vm/freebsd class FreeBSDVM(basevm.BaseVM): · line 30

Quoted 7 lines
tests/vm/freebsd +0 -1
@@ -25,7 +25,6 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};
         gmake --output-sync -j{jobs} check {verbose};
     """
 
#4 lore raw

RFC PATCH 2/3 tests/vm: add --build-target option

In reply to Alex Bennée

This allows us to invoke the build with a custom target (for the VMs that use the {target} format string specifier). Currently OpenBSD is still hardwired due to problems running check

---
 tests/vm/basevm.py | 3 +++
 tests/vm/freebsd   | 2 +-
 tests/vm/netbsd    | 3 +--
 3 files changed, 5 insertions(+), 3 deletions(-)
tests/vm/basevm.py +3 -0
index 5caf77d6b8..bdca6cb2fc 100755
@@ -228,6 +228,8 @@ def parse_args(vmcls):
                       help="build image")
     parser.add_option("--build-qemu",
                       help="build QEMU from source in guest")
+    parser.add_option("--build-target",
+                      help="QEMU build target", default="check")
     parser.add_option("--interactive", "-I", action="store_true",
                       help="Interactively run command")
     parser.add_option("--snapshot", "-s", action="store_true",
@@ -255,6 +257,7 @@ def main(vmcls):
             cmd = [vm.BUILD_SCRIPT.format(
                    configure_opts = " ".join(argv),
                    jobs=args.jobs,
+                   target=args.build_target,
                    verbose = "V=1" if args.verbose else "")]
         else:
             cmd = argv
tests/vm/freebsd +1 -1
index a85c866c30..1d64c31b7c 100755
@@ -25,7 +25,7 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
     def build_image(self, img):
tests/vm/netbsd +1 -2
index fac6a7ce51..a2c3d13af4 100755
@@ -25,8 +25,7 @@ class NetBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rld1a;
         ./configure --python=python2.7 {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
     def build_image(self, img):
Signature · 1 line
2.17.1
Reviewed-by on v1 2/3
#5 lore raw

Re: [Qemu-devel] [RFC PATCH 2/3] tests/vm: add --build-target option

Quoted 51 lines · Alex Bennée

This allows us to invoke the build with a custom target (for the VMs that use the {target} format string specifier). Currently OpenBSD is still hardwired due to problems running check

---
 tests/vm/basevm.py | 3 +++
 tests/vm/freebsd   | 2 +-
 tests/vm/netbsd    | 3 +--
 3 files changed, 5 insertions(+), 3 deletions(-)
tests/vm/basevm.py +3 -0
index 5caf77d6b8..bdca6cb2fc 100755
@@ -228,6 +228,8 @@ def parse_args(vmcls):
                       help="build image")
     parser.add_option("--build-qemu",
                       help="build QEMU from source in guest")
+    parser.add_option("--build-target",
+                      help="QEMU build target", default="check")
     parser.add_option("--interactive", "-I", action="store_true",
                       help="Interactively run command")
     parser.add_option("--snapshot", "-s", action="store_true",
@@ -255,6 +257,7 @@ def main(vmcls):
             cmd = [vm.BUILD_SCRIPT.format(
                    configure_opts = " ".join(argv),
                    jobs=args.jobs,
+                   target=args.build_target,
                    verbose = "V=1" if args.verbose else "")]
         else:
             cmd = argv
tests/vm/freebsd +1 -1
index a85c866c30..1d64c31b7c 100755
@@ -25,7 +25,7 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
     def build_image(self, img):
tests/vm/netbsd +0 -0
index fac6a7ce51..a2c3d13af4 100755

tests/vm/netbsd class NetBSDVM(basevm.BaseVM): · line 31

Quoted 9 lines
tests/vm/netbsd +1 -2
@@ -25,8 +25,7 @@ class NetBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rld1a;
         ./configure --python=python2.7 {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
     def build_image(self, img):
#6 lore raw

Re: [Qemu-devel] [RFC PATCH 2/3] tests/vm: add --build-target option

Hi Alex,

Quoted 46 lines · Philippe Mathieu-Daudé
Quoted 44 lines · Alex Bennée

This allows us to invoke the build with a custom target (for the VMs that use the {target} format string specifier). Currently OpenBSD is still hardwired due to problems running check

---
 tests/vm/basevm.py | 3 +++
 tests/vm/freebsd   | 2 +-
 tests/vm/netbsd    | 3 +--
 3 files changed, 5 insertions(+), 3 deletions(-)
tests/vm/basevm.py +3 -0
index 5caf77d6b8..bdca6cb2fc 100755
@@ -228,6 +228,8 @@ def parse_args(vmcls):
                       help="build image")
     parser.add_option("--build-qemu",
                       help="build QEMU from source in guest")
+    parser.add_option("--build-target",
+                      help="QEMU build target", default="check")
     parser.add_option("--interactive", "-I", action="store_true",
                       help="Interactively run command")
     parser.add_option("--snapshot", "-s", action="store_true",
@@ -255,6 +257,7 @@ def main(vmcls):
             cmd = [vm.BUILD_SCRIPT.format(
                    configure_opts = " ".join(argv),
                    jobs=args.jobs,
+                   target=args.build_target,
                    verbose = "V=1" if args.verbose else "")]
         else:
             cmd = argv
tests/vm/freebsd +1 -1
index a85c866c30..1d64c31b7c 100755
@@ -25,7 +25,7 @@ class FreeBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/vtbd1;
         ./configure {configure_opts};
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
Quoted 10 lines

tests/vm/netbsd class NetBSDVM(basevm.BaseVM): · line 28

Quoted 10 lines
tests/vm/freebsd +0 -0
     def build_image(self, img):
tests/vm/netbsd +0 -1
index fac6a7ce51..a2c3d13af4 100755
@@ -25,8 +25,7 @@ class NetBSDVM(basevm.BaseVM):
         cd $(mktemp -d /var/tmp/qemu-test.XXXXXX);
         tar -xf /dev/rld1a;
         ./configure --python=python2.7 {configure_opts};
-        gmake --output-sync -j{jobs} {verbose};

Actually this change ^ belong to the previous patch, "call make check directly".

Quoted 8 lines

tests/vm/netbsd class NetBSDVM(basevm.BaseVM): · line 31

Quoted 6 lines
tests/vm/netbsd +1 -1
-        gmake --output-sync -j{jobs} check {verbose};
+        gmake --output-sync -j{jobs} {target} {verbose};
     """
 
     def build_image(self, img):
#7 lore raw

RFC PATCH 3/3 tests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS

In reply to Alex Bennée

Now the underlying basevm support passes these along we can expose some additional variables to our Makefile to allow more customised tweaking of the build. For example:

  make vm-build-freebsd TARGET_LIST=aarch64-softmmu \
    EXTRA_CONFIGURE_OPTS="--disable-tools --disable-docs" \
    BUILD_TARGET=check-softfloat
---
 tests/vm/Makefile.include | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/vm/Makefile.include +9 -1
index a98fb3027f..6be53aa297 100644
@@ -18,6 +18,11 @@ vm-test:
 	@echo ""
 	@echo "  vm-build-all                    - Build QEMU in all VMs"
 	@echo "  vm-clean-all                    - Clean up VM images"
+	@echo
+	@echo "Special variables:"
+	@echo "    BUILD_TARGET=foo		 - override the build target"
+	@echo "    TARGET_LIST=a,b,c    	 - Override target list in builds."
+	@echo '    EXTRA_CONFIGURE_OPTS="..."'
 
 vm-build-all: $(addprefix vm-build-, $(IMAGES))
 
@@ -45,6 +50,9 @@ vm-build-%: tests/vm/%.img
 		$(if $(J),--jobs $(J)) \
 		$(if $(V),--verbose) \
 		--image "$<" \
-		--build-qemu $(SRC_PATH), \
+		$(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \
+		--build-qemu $(SRC_PATH) -- \
+		$(if $(TARGET_LIST),--target-list=$(TARGET_LIST)) \
+		$(if $(EXTRA_CONFIGURE_OPTS),$(EXTRA_CONFIGURE_OPTS)), \
 		"  VM-BUILD $*")
 
Signature · 1 line
2.17.1
Reviewed-by on v1 3/3
#8 lore raw

Re: [Qemu-devel] [RFC PATCH 3/3] tests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS

Quoted 30 lines · Alex Bennée

Now the underlying basevm support passes these along we can expose some additional variables to our Makefile to allow more customised tweaking of the build. For example:

  make vm-build-freebsd TARGET_LIST=aarch64-softmmu \
    EXTRA_CONFIGURE_OPTS="--disable-tools --disable-docs" \
    BUILD_TARGET=check-softfloat
---
 tests/vm/Makefile.include | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/vm/Makefile.include +5 -0
index a98fb3027f..6be53aa297 100644
@@ -18,6 +18,11 @@ vm-test:
 	@echo ""
 	@echo "  vm-build-all                    - Build QEMU in all VMs"
 	@echo "  vm-clean-all                    - Clean up VM images"
+	@echo
+	@echo "Special variables:"
+	@echo "    BUILD_TARGET=foo		 - override the build target"
+	@echo "    TARGET_LIST=a,b,c    	 - Override target list in builds."
+	@echo '    EXTRA_CONFIGURE_OPTS="..."'
 
 vm-build-all: $(addprefix vm-build-, $(IMAGES))
 

tests/vm/Makefile.include vm-build-%: tests/vm/%.img · line 58

Quoted 10 lines
tests/vm/Makefile.include +4 -1
@@ -45,6 +50,9 @@ vm-build-%: tests/vm/%.img
 		$(if $(J),--jobs $(J)) \
 		$(if $(V),--verbose) \
 		--image "$<" \
-		--build-qemu $(SRC_PATH), \
+		$(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \
+		--build-qemu $(SRC_PATH) -- \
+		$(if $(TARGET_LIST),--target-list=$(TARGET_LIST)) \
+		$(if $(EXTRA_CONFIGURE_OPTS),$(EXTRA_CONFIGURE_OPTS)), \
 		"  VM-BUILD $*")