On 4/21/20 1:16 PM, Laine Stump wrote:
On 4/20/20 6:54 AM, Andrea Bolognani wrote:
libvirt depends on a ton of packages, so trying to install them
all by using the classic approach of repeatedly running configure
and reacting to each failure by installing the corresponding
missing package will inevitably lead to frustration.
Luckily there's an easy solution to get most dependencies
installed in one fell swoop, and we just need to document it.
Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
Reviewed-by: Laine Stump <laine@xxxxxxxxxx>
---
CONTRIBUTING.rst | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 68c7b547c6..f476700fdd 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -17,3 +17,22 @@ your git clone run:
$ make
You'll find the freshly-built document in ``docs/contribute.html``.
+
+If ``configure`` fails because of missing dependencies, you can set
+up your system by calling
+
+::
+
+ $ sudo dnf builddep libvirt
+
+if you're on a RHEL-based distribution or
+
+::
+
+ $ sudo apt-get build-dep libvirt
+
+if you're on a Debian-based one.
+
+You might still be missing some dependencies if your distribution is
+shipping an old libvirt version, but that will get you much closer to
+where you need to be to build successfully from source.
BTW, I just went through this on a new Fedora 31 machine (AMD Ryzen
3950x! w00t!!) that I had installed with "Fedora Workstation", and
thought it might be useful to list exactly what was still missing for
certain "developer build" tasks after running "dnf builddep libvirt" on
a clean OS install. I found that I also had to install the following:
1) dnf install make
This was required (duh!) to build from source tar, but not a part of the
base OS install nor in Build-Requires (I guess it makes sense - what
self-respecting Linux distro doesn't have basic build tools like make in
the base install?)
2) dnf install autoconf automake libtool
These three were required (but not in base OS + "dnf builddep libvirt"
to do a successful "./autogen.sh --system && make check" (i.e. build
from a fresh git clone of the tree).
Again, I can see why autoconf, automake, and libtool wouldn't be in the
specfile Build-Requires:, since they *aren't* required when building
from a source tar, which already includes the configure script and
Makefile.in's that are generated using autotools.
3) dnf install rpm-build
This one was required (again - duh!) to run "make rpm". I guess it makes
sense that it's not in the Build-Requires in some ways, since it isn't
required to build the binaries, only to build the rpm file. (But on the
other hand, the entire purpose of libvirt.spec is to build rpms.
although, on the *other* other hand, you'd think that rpm-build would be
included in any minimal build environment anyway (and apparently it *is*
- e.g. the buildroot for Fedora koji).
4) dnf install cppi dwarves python3-flake8
These three were *not* required to successfully complete any build
operation, but parts of "make syntax-check" were skipped because they
weren't present (and so not having them might result in a developer
believing that their patches had passed "make syntax-check, when in fact
they had not).
At least cppi and python3-flake8 can't be Build-Required: in the
specfile for building because they aren't available on RHEL8/CentOS8 (at
least not without EPEL - haven't checked there yet, but of course EPEL
packages aren't available in the official build environment, so it's
kind of irrelevant)(oh, and also make syntax-check isn't run as part of
building the rpms, so those programs are never run during an official
build anyway, i.e. adding them to the Build-Requires: of the specfile
would be a lie :-)
===============
Anyway, does anyone think it's worth adding a short bit to this file
about these extra packages? Or should we keep this file simple and
rather let newcomers (and old timers who've forgotten and are setting up
a new machine) figure it out for themselves?