[libvirt-ci PATCH v2] guests: introduce libvirt+dist and libvirt+minimal projects

Daniel P. Berrangé berrange at redhat.com
Thu Apr 30 11:44:31 UTC 2020

The language bindings have traditionally built against a full libvirt,
however, this is serious overkill because all they should really need
most of the time is access to the main API, and the test driver if they
want to run functional tests. The full libvirt build with virt drivers
is only needed for integration testing which most bindings won't do.

Thus this introduces a new project "libvirt+minimal" which lists the
bare minimum dependencies required to build libvirt.

Taking libvirt-perl as an example, if creating a container using the
current "libvirt,libvirt-perl" project set, the result with 1.4 GB
in size for Fedora 31. With the "libvirt+minimal,libvirt-perl" set,
the size is just 777 MB.

Some projects also wish to have the ability to build against the distro
provided libvirt instead of the latest git master, and for this purpose
a "libvirt+dist" project is defined which pulls in the package needed
for building against the distro libvirt.

Thus when building any downstream project there is now a choice of
building it against "libvirt" (full git) or "libvirt+minimal" (minimal
git) or "libvirt+dist" (prebuilt distro). The same can be added later
for example "libvirt-perl+dist" to refer to the distro provided perl

In the lcitool dockerfile command, there is a check that the requested
project is configured against the requested host. These new projects are
not listed against any host, because we don't want them installed by
default in the VMs. Thus the dockerfile check is no longer valid and is
removed. Whomever is invoking lcitool knows what combination they want
and whether it will work.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>

In v2:

 - Use "+suffix" syntax for new projects
 - Rename new package to "libvirt"

 guests/lcitool                           |  7 -------
 guests/vars/mappings.yml                 |  5 +++++
 guests/vars/projects/libvirt+dist.yml    |  3 +++
 guests/vars/projects/libvirt+minimal.yml | 12 ++++++++++++
 4 files changed, 20 insertions(+), 7 deletions(-)
 create mode 100644 guests/vars/projects/libvirt+dist.yml
 create mode 100644 guests/vars/projects/libvirt+minimal.yml

diff --git a/guests/lcitool b/guests/lcitool
index 0c89e13..abc87d2 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -1007,13 +1007,6 @@ class Application:
         for project in projects:
             if project.rfind("+mingw") >= 0:
                 raise Exception("Obsolete syntax, please use --cross-arch")
-            if project not in facts["projects"]:
-                raise Exception(
-                    "Host {} doesn't support project {}".format(
-                        host,
-                        project,
-                    )
-                )
         varmap = self._dockerfile_build_varmap(facts, mappings, pip_mappings, projects, cross_arch)
         self._dockerfile_format(facts, cross_arch, varmap)
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index 4a19fb4..9dcad46 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -450,6 +450,11 @@ mappings:
     rpm: libuuid-devel
     cross-policy-deb: foreign
+  libvirt:
+    rpm: libvirt-devel
+    deb: libvirt-dev
+    pkg: libvirt
     deb: libxml2-dev
     pkg: libxml2
diff --git a/guests/vars/projects/libvirt+dist.yml b/guests/vars/projects/libvirt+dist.yml
new file mode 100644
index 0000000..1fc1b2c
--- /dev/null
+++ b/guests/vars/projects/libvirt+dist.yml
@@ -0,0 +1,3 @@
+  - libvirt
diff --git a/guests/vars/projects/libvirt+minimal.yml b/guests/vars/projects/libvirt+minimal.yml
new file mode 100644
index 0000000..96335f2
--- /dev/null
+++ b/guests/vars/projects/libvirt+minimal.yml
@@ -0,0 +1,12 @@
+  - glib2
+  - gnutls
+  - libnl3
+  - libnlroute3
+  - libtirpc
+  - libxml2
+  - python3-docutils
+  - rpcgen
+  - xmllint
+  - xsltproc

More information about the libvir-list mailing list