[libvirt] [PATCH] build: force configure failed when perl is missing

Michal Privoznik mprivozn at redhat.com
Thu Aug 14 09:33:24 UTC 2014


On 14.08.2014 05:37, Jincheng Miao wrote:
> Perl is necessary to our build processing, it will invoke a lot of
> generating script, like: gendispatch.pl. If perl is missing, it's
> ok for build from git checkout, because autogen.sh will tell you.
> But for compiling from a release tarball, configure will just record
> a missing message, and continue, then build failed, like:
> https://www.redhat.com/archives/libvirt-users/2014-August/msg00050.html
>
> So need to enhance configure script to handle this negative case.
>
> Reported-by: Hongbin Lu <hongbin at savinetwork.ca>
> Signed-off-by: Jincheng Miao <jmiao at redhat.com>
> ---
>   configure.ac |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 081f298..af3fe28 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2173,6 +2173,9 @@ AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"])
>   dnl Allow perl/python overrides
>   AC_PATH_PROGS([PYTHON], [python2 python])
>   AC_PATH_PROG([PERL], [perl])
> +if test -z "$PERL"; then
> +         AC_MSG_ERROR([Failed to find perl.])
> +fi
>
>   AC_ARG_WITH([test-suite],
>               [AS_HELP_STRING([--with-test-suite],
>

I'm inclined to ACK this. We currently have some files that can be built 
from git and are contained in the release so we cut off the set of 
required tools to build the libvirt. However, with so widely accessible 
tool as perl (which is almost everywhere) we don't need to do that. 
Moreover, there are some Makefile targets which have runtime dependency 
on perl, e.g. bracket-spacing-check syntax-check rule.

And with this change I think we need this one too:

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 29da071..f491de7 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -446,6 +446,7 @@ BuildRequires: gettext-devel
  BuildRequires: libtool
  BuildRequires: /usr/bin/pod2man
  %endif
+BuildRequires: perl
  BuildRequires: python
  %if %{with_systemd}
  BuildRequires: systemd-units

Again, I'm not expecting to see any RPM based distribution without perl 
(esp. if rpm-build package requires perl itself). But we should have it 
for completeness.

So I'm squashing it in and pushing.

ACK

Michal




More information about the libvir-list mailing list