[libvirt] [PATCH] configure: enforce presence of python for build

Daniel P. Berrange posted 1 patch 146 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170508104421.25805-1-berrange@redhat.com
configure.ac          | 5 ++++-
mingw-libvirt.spec.in | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)

[libvirt] [PATCH] configure: enforce presence of python for build

Posted by Daniel P. Berrange 146 weeks ago
The API docs extractor, ESX code generator and keycodemapdb tools
rely on python. Historically every platform that this present, but
with switch to Python3 by default, we're increasingly seeing
installs without a /usr/bin/python.

This tightens up the check during configure, so it exits immediately
if python is missing, rather than leaving an empty $(PYTHON) make
variable which leads to more obscure errors later.

Also add it as a build dep for Mingw, since Fedora build roots no
longer get python2 by default. This was not previously a major
problem, since both ESX & API generated files were included in
EXTRA_DIST, but the keycodemapdb generated files are not, so we
require python all the time now.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 configure.ac          | 5 ++++-
 mingw-libvirt.spec.in | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 5f7a07a..0b564a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -624,9 +624,12 @@ fi
 
 dnl Allow perl/python overrides
 AC_PATH_PROGS([PYTHON], [python2 python])
+if test -z "$PYTHON"; then
+         AC_MSG_ERROR(['python' or 'python2' binary is required to build libvirt])
+fi
 AC_PATH_PROG([PERL], [perl])
 if test -z "$PERL"; then
-         AC_MSG_ERROR([Failed to find perl.])
+         AC_MSG_ERROR(['perl' binary is required to build libvirt])
 fi
 
 LIBVIRT_ARG_WITH([TEST_SUITE], [build test suite by default], [check])
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index dec799b..302f663 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -54,6 +54,7 @@ BuildRequires:  mingw64-portablexdr
 BuildRequires:  pkgconfig
 # Need native version for msgfmt
 BuildRequires:  gettext
+BuildRequires:  python
 BuildRequires:  perl
 BuildRequires:  perl(Getopt::Long)
 %if 0%{?enable_autotools}
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] configure: enforce presence of python for build

Posted by Roman Bogorodskiy 146 weeks ago
  Daniel P. Berrange wrote:

> The API docs extractor, ESX code generator and keycodemapdb tools
> rely on python. Historically every platform that this present, but
> with switch to Python3 by default, we're increasingly seeing
> installs without a /usr/bin/python.
> 
> This tightens up the check during configure, so it exits immediately
> if python is missing, rather than leaving an empty $(PYTHON) make
> variable which leads to more obscure errors later.
> 
> Also add it as a build dep for Mingw, since Fedora build roots no
> longer get python2 by default. This was not previously a major
> problem, since both ESX & API generated files were included in
> EXTRA_DIST, but the keycodemapdb generated files are not, so we
> require python all the time now.

I've just spotted the similar issue when building FreeBSD port, so this
changes makes perfect sense to me, ACK.

> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  configure.ac          | 5 ++++-
>  mingw-libvirt.spec.in | 1 +
>  2 files changed, 5 insertions(+), 1 deletion(-)

Roman Bogorodskiy
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list