[libvirt] [jenkins-ci PATCH 1/2] guests: Install ncurses for libvirt

Andrea Bolognani posted 2 patches 6 years, 10 months ago
[libvirt] [jenkins-ci PATCH 1/2] guests: Install ncurses for libvirt
Posted by Andrea Bolognani 6 years, 10 months ago
As of libvirt commit c98de2173e95, we use pkg-config to obtain
CFLAGS and LIBS for readline whenever possible. However, since
the readline.pc file contains a Requires.private for a module
that's shipped with ncurses (the actual module varies based on
the platform) we will end up falling back to the old library
detection if said library is not installed on the system.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 guests/vars/mappings.yml         | 8 ++++++++
 guests/vars/projects/libvirt.yml | 1 +
 2 files changed, 9 insertions(+)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index 05d312d..464c403 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -603,6 +603,14 @@ mappings:
   nano:
     default: nano
 
+  ncurses:
+    deb: libncurses-dev
+    pkg: ncurses
+    rpm: ncurses-devel
+    Debian9: libncurses5-dev
+    Ubuntu18: libncurses5-dev
+    cross-policy-deb: foreign
+
   netcf:
     deb: libnetcf-dev
     rpm: netcf-devel
diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index f813f21..688dfa3 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -38,6 +38,7 @@ packages:
   - libxml2
   - lvm2
   - modprobe
+  - ncurses
   - netcf
   - numad
   - openwsman
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 1/2] guests: Install ncurses for libvirt
Posted by Daniel P. Berrangé 6 years, 10 months ago
On Fri, Apr 12, 2019 at 04:31:35PM +0200, Andrea Bolognani wrote:
> As of libvirt commit c98de2173e95, we use pkg-config to obtain
> CFLAGS and LIBS for readline whenever possible. However, since
> the readline.pc file contains a Requires.private for a module
> that's shipped with ncurses (the actual module varies based on
> the platform) we will end up falling back to the old library
> detection if said library is not installed on the system.

Wow, this looks like a packaging dep bug on every platform :-(

> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  guests/vars/mappings.yml         | 8 ++++++++
>  guests/vars/projects/libvirt.yml | 1 +
>  2 files changed, 9 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

> 
> diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
> index 05d312d..464c403 100644
> --- a/guests/vars/mappings.yml
> +++ b/guests/vars/mappings.yml
> @@ -603,6 +603,14 @@ mappings:
>    nano:
>      default: nano
>  
> +  ncurses:
> +    deb: libncurses-dev
> +    pkg: ncurses
> +    rpm: ncurses-devel
> +    Debian9: libncurses5-dev
> +    Ubuntu18: libncurses5-dev
> +    cross-policy-deb: foreign
> +
>    netcf:
>      deb: libnetcf-dev
>      rpm: netcf-devel
> diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
> index f813f21..688dfa3 100644
> --- a/guests/vars/projects/libvirt.yml
> +++ b/guests/vars/projects/libvirt.yml
> @@ -38,6 +38,7 @@ packages:
>    - libxml2
>    - lvm2
>    - modprobe
> +  - ncurses
>    - netcf
>    - numad
>    - openwsman
> -- 
> 2.20.1
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 1/2] guests: Install ncurses for libvirt
Posted by Andrea Bolognani 6 years, 10 months ago
On Fri, 2019-04-12 at 15:36 +0100, Daniel P. Berrangé wrote:
> On Fri, Apr 12, 2019 at 04:31:35PM +0200, Andrea Bolognani wrote:
> > As of libvirt commit c98de2173e95, we use pkg-config to obtain
> > CFLAGS and LIBS for readline whenever possible. However, since
> > the readline.pc file contains a Requires.private for a module
> > that's shipped with ncurses (the actual module varies based on
> > the platform) we will end up falling back to the old library
> > detection if said library is not installed on the system.
> 
> Wow, this looks like a packaging dep bug on every platform :-(

Either that or the readline.pc file is not entirely accurate,
which would not surprise me seeing how wrong they got include path
handling so far O:-)

When you think about it, so far we have been able to link against
readline on all platforms using -lreadline only; plus FreeBSD folks
are commenting out the Requires.private line entirely anyway.

So it looks to me like readline.pc is being extremely conservative
and they could get away with not having a Requires.private in the
first place - but then again it might be needed on platforms that
are outside of our support list but not theirs...

Whatever it is, including ncurses among our requirements is safe
enough (in fact, our .spec file already does so) and doesn't
significantly impact the size of our guest / container images, so
I'm perfectly happy handling it this way.

-- 
Andrea Bolognani / Red Hat / Virtualization

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