[libvirt] [PATCH python 7/7] Require libvirt native version matching py version by default

Daniel P. Berrange posted 7 patches 7 years, 4 months ago
[libvirt] [PATCH python 7/7] Require libvirt native version matching py version by default
Posted by Daniel P. Berrange 7 years, 4 months ago
Although we're capable of building against any libvirt >= 0.9.11, 99% of the
time we want RPM builds to be done against matching libvirt version, otherwise
we might silently build against an unexpected/wrong version.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 libvirt-python.spec.in | 2 +-
 setup.py               | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 0087c78..6afa6f8 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -35,7 +35,7 @@ Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
 Url: http://libvirt.org
 License: LGPLv2+
 Group: Development/Libraries
-BuildRequires: libvirt-devel >= @C_VERSION@
+BuildRequires: libvirt-devel >= %{version}
 %if %{with_python2}
 %if %{py2_versioned_deps}
 BuildRequires: python2-devel
diff --git a/setup.py b/setup.py
index 85af965..5e29c8a 100755
--- a/setup.py
+++ b/setup.py
@@ -175,8 +175,7 @@ class my_sdist(sdist):
         f2 = open('libvirt-python.spec', 'w')
         for line in f1:
             f2.write(line
-                     .replace('@PY_VERSION@', self.distribution.get_version())
-                     .replace('@C_VERSION@', MIN_LIBVIRT))
+                     .replace('@PY_VERSION@', self.distribution.get_version()))
         f1.close()
         f2.close()
 
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH python 7/7] Require libvirt native version matching py version by default
Posted by Jiri Denemark 7 years, 4 months ago
On Thu, Jan 11, 2018 at 16:43:39 +0000, Daniel P. Berrange wrote:
> Although we're capable of building against any libvirt >= 0.9.11, 99% of the
> time we want RPM builds to be done against matching libvirt version, otherwise
> we might silently build against an unexpected/wrong version.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  libvirt-python.spec.in | 2 +-
>  setup.py               | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
> index 0087c78..6afa6f8 100644
> --- a/libvirt-python.spec.in
> +++ b/libvirt-python.spec.in
> @@ -35,7 +35,7 @@ Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
>  Url: http://libvirt.org
>  License: LGPLv2+
>  Group: Development/Libraries
> -BuildRequires: libvirt-devel >= @C_VERSION@
> +BuildRequires: libvirt-devel >= %{version}

Shouldn't we even restrict this to ==? If libvirt-python is built
against newer version of libvirt, its generator may provide incorrect
implementation for new APIs which need to be implemented manually. And
only new enough libvirt-python will have these new APIs in the override
list.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH python 7/7] Require libvirt native version matching py version by default
Posted by Daniel P. Berrange 7 years, 4 months ago
On Thu, Jan 11, 2018 at 06:00:34PM +0100, Jiri Denemark wrote:
> On Thu, Jan 11, 2018 at 16:43:39 +0000, Daniel P. Berrange wrote:
> > Although we're capable of building against any libvirt >= 0.9.11, 99% of the
> > time we want RPM builds to be done against matching libvirt version, otherwise
> > we might silently build against an unexpected/wrong version.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >  libvirt-python.spec.in | 2 +-
> >  setup.py               | 3 +--
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
> > index 0087c78..6afa6f8 100644
> > --- a/libvirt-python.spec.in
> > +++ b/libvirt-python.spec.in
> > @@ -35,7 +35,7 @@ Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
> >  Url: http://libvirt.org
> >  License: LGPLv2+
> >  Group: Development/Libraries
> > -BuildRequires: libvirt-devel >= @C_VERSION@
> > +BuildRequires: libvirt-devel >= %{version}
> 
> Shouldn't we even restrict this to ==? If libvirt-python is built
> against newer version of libvirt, its generator may provide incorrect
> implementation for new APIs which need to be implemented manually. And
> only new enough libvirt-python will have these new APIs in the override
> list.

Hmm, yes, that's a good point. We don't officially support building old
python against newer libvirt.  We probably ought to validate that in the
generator too rather than leave the user to get bizarre error messages
or badly generated code.

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