diff mbox series

[OSSTEST,2/2] ts-libvirt-build: Do an out-of-tree build

Message ID 20191112120913.25864-2-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/2] ts-libvirt-build: Provide PKG_CONFIG_PATH | expand

Commit Message

Ian Jackson Nov. 12, 2019, 12:09 p.m. UTC
Recent versions of libvirt do not support in-tree builds (!)

Cope with this by always building in a subdirectory `build' (a
subdirectory of the source tree); this is the arrangement which the
libvirt upstream messages and documentation now seem to recommend (at
least where things have been updated).

I compared the differences in build output between the results of this
branch and a previous passing xen-unstable flight.  The libvirt
library version increased and a file
  usr/local/share/libvirt/cpu_map/arm_features.xml
appeared.  I think this is just due to changes in the libvirt version,
2cff65e4c60e..70218e10bcde, in particular 0de541bfc575
  cpu_map: Ship arm_features.xml

I also tested that a test job, built with current libvirt and these
osstest changes, passes as expected.

CC: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-libvirt-build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Jim Fehlig Nov. 12, 2019, 4:02 p.m. UTC | #1
On 11/12/19 5:09 AM, Ian Jackson wrote:
> Recent versions of libvirt do not support in-tree builds (!)

I assumed libvirt's gradual move from autotools to meson would affect OSSTEST, 
but later rather than sooner. Sorry for not mentioning it earlier, but now you 
have been warned that libvirt is moving to meson :-). Meson has a strict 
separation between source and build directories and some preparatory patches 
were pushed that force srcdir != builddir

https://www.redhat.com/archives/libvir-list/2019-October/msg01681.html

Daniel posted a note about this change yesterday

https://www.redhat.com/archives/libvir-list/2019-November/msg00299.html

I didn't read libvirt mail yesterday otherwise I would have forwarded that to 
xen-devel. I need to be more proactive with libvirt changes that might affect 
OSSTEST...

Regards,
Jim

> 
> Cope with this by always building in a subdirectory `build' (a
> subdirectory of the source tree); this is the arrangement which the
> libvirt upstream messages and documentation now seem to recommend (at
> least where things have been updated).
> 
> I compared the differences in build output between the results of this
> branch and a previous passing xen-unstable flight.  The libvirt
> library version increased and a file
>    usr/local/share/libvirt/cpu_map/arm_features.xml
> appeared.  I think this is just due to changes in the libvirt version,
> 2cff65e4c60e..70218e10bcde, in particular 0de541bfc575
>    cpu_map: Ship arm_features.xml
> 
> I also tested that a test job, built with current libvirt and these
> osstest changes, passes as expected.
> 
> CC: Jim Fehlig <jfehlig@suse.com>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
>   ts-libvirt-build | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/ts-libvirt-build b/ts-libvirt-build
> index 2a363f43..e799f003 100755
> --- a/ts-libvirt-build
> +++ b/ts-libvirt-build
> @@ -58,11 +58,13 @@ sub config() {
>       my $gnulib = submodule_find($submodules, "gnulib");
>       target_cmd_build($ho, 3600, $builddir, <<END);
>           cd libvirt
> +	mkdir build
> +	cd build
>           CFLAGS="-g -I$xenprefix/include/" \\
>           LDFLAGS="-g -L$xenprefix/lib/ -Wl,-rpath-link=$xenprefix/lib/" \\
>           PKG_CONFIG_PATH="$xenprefix/lib/pkgconfig/" \\
>           GNULIB_SRCDIR=$builddir/libvirt/$gnulib->{Path} \\
> -            ./autogen.sh --no-git \\
> +            ../autogen.sh --no-git \\
>                            --with-libxl --without-xen --without-xenapi --without-selinux \\
>                            --without-lxc --without-vbox --without-uml \\
>                            --without-qemu --without-openvz --without-vmware \\
> @@ -72,9 +74,9 @@ END
>   
>   sub build() {
>       target_cmd_build($ho, 3600, $builddir, <<END);
> -        cd libvirt
> -        (make $makeflags 2>&1 && touch ../build-ok-stamp) |tee ../log
> -        test -f ../build-ok-stamp #/
> +        cd libvirt/build
> +        (make $makeflags 2>&1 && touch ../../build-ok-stamp) |tee ../log
> +        test -f ../../build-ok-stamp #/
>           echo ok.
>   END
>   }
> @@ -82,7 +84,7 @@ END
>   sub install() {
>       target_cmd_build($ho, 300, $builddir, <<END);
>           mkdir -p dist
> -        cd libvirt
> +        cd libvirt/build
>           make $makeflags install DESTDIR=$builddir/dist
>           mkdir -p $builddir/dist/etc/init.d
>   END
>
Ian Jackson Nov. 12, 2019, 4:10 p.m. UTC | #2
Hi.  Thanks for the information.

Jim Fehlig writes ("Re: [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build"):
> I assumed libvirt's gradual move from autotools to meson would
> affect OSSTEST, but later rather than sooner. Sorry for not
> mentioning it earlier, but now you have been warned that libvirt is
> moving to meson :-). Meson has a strict separation between source
> and build directories and some preparatory patches were pushed that
> force srcdir != builddir
> 
> https://www.redhat.com/archives/libvir-list/2019-October/msg01681.html

I read this and some of it is a bit concerning.  Does all of this
  src: [stuff] generate source files into build directory
mean that previously only in-tree builds were supported and that
therefore there is no one set of build runes that will work both
before and after these changes ?

Ian.
Jim Fehlig Nov. 12, 2019, 4:23 p.m. UTC | #3
On 11/12/19 9:10 AM, Ian Jackson wrote:
> Hi.  Thanks for the information.
> 
> Jim Fehlig writes ("Re: [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build"):
>> I assumed libvirt's gradual move from autotools to meson would
>> affect OSSTEST, but later rather than sooner. Sorry for not
>> mentioning it earlier, but now you have been warned that libvirt is
>> moving to meson :-). Meson has a strict separation between source
>> and build directories and some preparatory patches were pushed that
>> force srcdir != builddir
>>
>> https://www.redhat.com/archives/libvir-list/2019-October/msg01681.html
> 
> I read this and some of it is a bit concerning.  Does all of this
>    src: [stuff] generate source files into build directory
> mean that previously only in-tree builds were supported and that
> therefore there is no one set of build runes that will work both
> before and after these changes ?

VPATH builds were previously supported, as well as in-tree builds. But questions 
around this work are probably best answered by the author. Adding Pavel to cc.

Pavel, for context, see Ian's OSSTEST patches to accommodate recent changes to 
libvirt's build system

https://lists.xenproject.org/archives/html/xen-devel/2019-11/msg00514.html

Regards,
Jim
diff mbox series

Patch

diff --git a/ts-libvirt-build b/ts-libvirt-build
index 2a363f43..e799f003 100755
--- a/ts-libvirt-build
+++ b/ts-libvirt-build
@@ -58,11 +58,13 @@  sub config() {
     my $gnulib = submodule_find($submodules, "gnulib");
     target_cmd_build($ho, 3600, $builddir, <<END);
         cd libvirt
+	mkdir build
+	cd build
         CFLAGS="-g -I$xenprefix/include/" \\
         LDFLAGS="-g -L$xenprefix/lib/ -Wl,-rpath-link=$xenprefix/lib/" \\
         PKG_CONFIG_PATH="$xenprefix/lib/pkgconfig/" \\
         GNULIB_SRCDIR=$builddir/libvirt/$gnulib->{Path} \\
-            ./autogen.sh --no-git \\
+            ../autogen.sh --no-git \\
                          --with-libxl --without-xen --without-xenapi --without-selinux \\
                          --without-lxc --without-vbox --without-uml \\
                          --without-qemu --without-openvz --without-vmware \\
@@ -72,9 +74,9 @@  END
 
 sub build() {
     target_cmd_build($ho, 3600, $builddir, <<END);
-        cd libvirt
-        (make $makeflags 2>&1 && touch ../build-ok-stamp) |tee ../log
-        test -f ../build-ok-stamp #/
+        cd libvirt/build
+        (make $makeflags 2>&1 && touch ../../build-ok-stamp) |tee ../log
+        test -f ../../build-ok-stamp #/
         echo ok.
 END
 }
@@ -82,7 +84,7 @@  END
 sub install() {
     target_cmd_build($ho, 300, $builddir, <<END);
         mkdir -p dist
-        cd libvirt
+        cd libvirt/build
         make $makeflags install DESTDIR=$builddir/dist
         mkdir -p $builddir/dist/etc/init.d
 END