Skip to contentSkip to conversation

ts-libvirt-build: Provide PKG_CONFIG_PATH

PATCH In review Ian Jackson 3 participants 7 messages Nov 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ts-libvirt-build: Provide PKG_CONFIG_PATH

In osstest we do not install the xen tree in /usr/local because the build environment is shared with many different build jobs which might be using different versions of Xen. We put it in a job-specific directory in ~osstest on the build host, and set environment variables to ensure that it all gets picked up.

Recent versions of libvirt insist on finding xenlight.pc; otherwise they disable libxl support. So we must add a PKG_CONFIG_PATH setting.

(In all cases, contrary to the usual protocol for path-like variables, we do not append but instead simply set the variable. This is OK because this is an osstest build script run via ssh to the build host, so the variables won't have been set already.)

---
 ts-libvirt-build | 1 +
 1 file changed, 1 insertion(+)
ts-libvirt-build +1 -0
index bc08190a..2a363f43 100755
@@ -60,6 +60,7 @@ sub config() {
         cd libvirt
         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 \\
                          --with-libxl --without-xen --without-xenapi --without-selinux \\
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 2/2 ts-libvirt-build: Do an out-of-tree build

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.

---
 ts-libvirt-build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
ts-libvirt-build +7 -5
index 2a363f43..e799f003 100755
@@ -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
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

Re: [Xen-devel] [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build

Quoted 1 line · Ian Jackson

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

Quoted 58 lines

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.

---
  ts-libvirt-build | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
ts-libvirt-build +6 -4
index 2a363f43..e799f003 100755
@@ -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
  }

ts-libvirt-build END · line 90

Quoted 8 lines
ts-libvirt-build +1 -1
@@ -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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Re: [Xen-devel] [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build

Hi. Thanks for the information.

Jim Fehlig writes ("Re: [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build"):

Quoted 8 lines

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

Re: [Xen-devel] [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build

Quoted 10 lines · Ian Jackson

Hi. Thanks for the information.

Jim Fehlig writes ("Re: [OSSTEST PATCH 2/2] ts-libvirt-build: Do an out-of-tree build"):

Quoted 7 lines

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

Quoted 7 lines
Quoted 1 line

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
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
In reply to Ian Jackson
Quoted 8 lines · Ian Jackson

In osstest we do not install the xen tree in /usr/local because the build environment is shared with many different build jobs which might be using different versions of Xen. We put it in a job-specific directory in ~osstest on the build host, and set environment variables to ensure that it all gets picked up.

Recent versions of libvirt insist on finding xenlight.pc; otherwise they disable libxl support. So we must add a PKG_CONFIG_PATH setting.

Sorry. There was a hack to workaround a fedora 28 bug, but now that it is EOL the hack was removed

https://libvirt.org/git/?p=libvirt.git;a=commit;h=18981877d2e20390a79d068861a24e716f8ee422

Quoted 16 lines

(In all cases, contrary to the usual protocol for path-like variables, we do not append but instead simply set the variable. This is OK because this is an osstest build script run via ssh to the build host, so the variables won't have been set already.)

---
  ts-libvirt-build | 1 +
  1 file changed, 1 insertion(+)
ts-libvirt-build +0 -0
index bc08190a..2a363f43 100755

ts-libvirt-build sub config() { · line 66

Quoted 7 lines
ts-libvirt-build +1 -0
@@ -60,6 +60,7 @@ sub config() {
          cd libvirt
          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 \\
                           --with-libxl --without-xen --without-xenapi --without-selinux \\

Unrelated, but the legacy xen and xenapi drivers have been removed so the --without-{xen,xenapi} options could be dropped.

Regards,
Jim
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

Jim Fehlig writes ("Re: [OSSTEST PATCH 1/2] ts-libvirt-build: Provide PKG_CONFIG_PATH"):

Quoted 8 lines · Ian Jackson
Quoted 4 lines
+        PKG_CONFIG_PATH="$xenprefix/lib/pkgconfig/" \\
          GNULIB_SRCDIR=$builddir/libvirt/$gnulib->{Path} \\
              ./autogen.sh --no-git \\
                           --with-libxl --without-xen --without-xenapi --without-selinux \\

Unrelated, but the legacy xen and xenapi drivers have been removed so the --without-{xen,xenapi} options could be dropped.

Thanks for the review. I think we should consider that for post Xen freeze. I did notice the warning messages but I thought leaving --without-unknown-thing would be OK, and it did indeed build.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel