[libvirt] [PATCH python 0/7] Misc improvements to RPM spec

Various improvements to the RPM spec to help future Fedora/RHEL maint Daniel P. Berrange (7): Allow disabling of python2 RPM build Allow override of which sub-RPMs to build Add checks for min supported distros Add emacs mode marker to activate rpm-spec highlighting Adapt to rename of py2 RPMs from python- to python2- prefix Turn on python3 sub-RPMs for RHEL > 7 Require libvirt native version matching py version by default libvirt-python.spec.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++---- setup.py | 3 +-- 2 files changed, 51 insertions(+), 6 deletions(-) -- 2.14.3

With Fedora modularity, it is possible to have add-on repos for multiple versions of python3. It is thus desirable to be able to build libvirt-python in these repos, with only the python3 sub-RPMs enabled. Thus also helps if future RHEL/Fedora drop python2 entirely from their default repos. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index 4d0262d..5bbebeb 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -1,4 +1,5 @@ +%define with_python2 1 %define with_python3 0 %if 0%{?fedora} %define with_python3 1 @@ -13,9 +14,11 @@ Url: http://libvirt.org License: LGPLv2+ Group: Development/Libraries BuildRequires: libvirt-devel >= @C_VERSION@ +%if %{with_python2} BuildRequires: python-devel BuildRequires: python-nose BuildRequires: python-lxml +%endif %if %{with_python3} BuildRequires: python3-devel BuildRequires: python3-nose @@ -32,6 +35,7 @@ written in the Python programming language to use the interface supplied by the libvirt library to use the virtualization capabilities of recent versions of Linux (and other OSes). +%if %{with_python2} %package -n python2-libvirt Summary: The libvirt virtualization API python2 binding Url: http://libvirt.org @@ -46,6 +50,7 @@ The python2-libvirt package contains a module that permits applications written in the Python programming language to use the interface supplied by the libvirt library to use the virtualization capabilities of recent versions of Linux (and other OSes). +%endif %if %{with_python3} %package -n python3-libvirt @@ -73,23 +78,30 @@ of recent versions of Linux (and other OSes). find examples -type f -exec chmod 0644 \{\} \; %build +%if %{with_python2} CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +%endif %if %{with_python3} CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build %endif %install +%if %{with_python2} %{__python} setup.py install --skip-build --root=%{buildroot} +%endif %if %{with_python3} %{__python3} setup.py install --skip-build --root=%{buildroot} %endif %check +%if %{with_python2} %{__python} setup.py test +%endif %if %{with_python3} %{__python3} setup.py test %endif +%if %{with_python2} %files -n python2-libvirt %defattr(-,root,root) %doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/ @@ -98,6 +110,7 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build %{_libdir}/python2*/site-packages/libvirt_lxc.py* %{_libdir}/python2*/site-packages/libvirtmod* %{_libdir}/python2*/site-packages/*egg-info +%endif %if %{with_python3} %files -n python3-libvirt -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:33PM +0000, Daniel P. Berrange wrote:
With Fedora modularity, it is possible to have add-on repos for multiple versions of python3. It is thus desirable to be able to build libvirt-python in these repos, with only the python3 sub-RPMs enabled.
Thus also helps if future RHEL/Fedora drop python2 entirely from their default repos.
Prior to this patch we should also fix the "wrong" usage of "python_sitearch" on line 26: # Don't want provides for python shared objects %{?filter_provides_in: %filter_provides_in %{python_sitearch}/.*\.so} %{?filter_setup} We should use python{2,3}_sitearch instead since the old python_sitearch points only to the default version. Currently we will not filter the *.so files for python3. Otherwise, the patch itself looks good. Pavel

On Fri, Jan 12, 2018 at 12:15:19PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:33PM +0000, Daniel P. Berrange wrote:
With Fedora modularity, it is possible to have add-on repos for multiple versions of python3. It is thus desirable to be able to build libvirt-python in these repos, with only the python3 sub-RPMs enabled.
Thus also helps if future RHEL/Fedora drop python2 entirely from their default repos.
Prior to this patch we should also fix the "wrong" usage of "python_sitearch" on line 26:
# Don't want provides for python shared objects %{?filter_provides_in: %filter_provides_in %{python_sitearch}/.*\.so} %{?filter_setup}
We should use python{2,3}_sitearch instead since the old python_sitearch points only to the default version. Currently we will not filter the *.so files for python3.
On Fedora 27, this filter stuff apparently has no effect. I see the same data in both py2 and py3 sub RPMs rpm -q --requires --provides python2-libvirt-debuginfo-3.10.0-1.fc27.x86_64.rpm libvirt-python-debuginfo(x86-64) = 3.10.0-1.fc27 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 debuginfo(build-id) = 5fb8c6a9dce927333cecf765adaf40c420a04f21 debuginfo(build-id) = d59579a7c85ce5b002cc6b3e0a0be7932c041fe4 debuginfo(build-id) = e791f98736c9006bbe3b324abf035b0b119506f9 python2-libvirt-debuginfo = 3.10.0-1.fc27 python2-libvirt-debuginfo(x86-64) = 3.10.0-1.fc27 [berrange@t460 libvirt-python] $ rpm -q --requires --provides python3-libvirt-debuginfo-3.10.0-1.fc27.x86_64.rpm libvirt-python-debuginfo(x86-64) = 3.10.0-1.fc27 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 debuginfo(build-id) = 28d17edad0f257efbc68790ecd8c970fc153fe74 debuginfo(build-id) = 4c4aceebea990736cdcf58d122a231a6260f5474 debuginfo(build-id) = 7ff2ac4cefcee10d44b6dc73ebe0f1ed3f68f6ec python3-libvirt-debuginfo = 3.10.0-1.fc27 python3-libvirt-debuginfo(x86-64) = 3.10.0-1.fc27 Perhaps this was working around a bug on older RHEL ? 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 :|

On Fri, Jan 12, 2018 at 03:42:57PM +0000, Daniel P. Berrange wrote:
On Fri, Jan 12, 2018 at 12:15:19PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:33PM +0000, Daniel P. Berrange wrote:
With Fedora modularity, it is possible to have add-on repos for multiple versions of python3. It is thus desirable to be able to build libvirt-python in these repos, with only the python3 sub-RPMs enabled.
Thus also helps if future RHEL/Fedora drop python2 entirely from their default repos.
Prior to this patch we should also fix the "wrong" usage of "python_sitearch" on line 26:
# Don't want provides for python shared objects %{?filter_provides_in: %filter_provides_in %{python_sitearch}/.*\.so} %{?filter_setup}
We should use python{2,3}_sitearch instead since the old python_sitearch points only to the default version. Currently we will not filter the *.so files for python3.
On Fedora 27, this filter stuff apparently has no effect. I see the same data in both py2 and py3 sub RPMs
rpm -q --requires --provides python2-libvirt-debuginfo-3.10.0-1.fc27.x86_64.rpm libvirt-python-debuginfo(x86-64) = 3.10.0-1.fc27 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 debuginfo(build-id) = 5fb8c6a9dce927333cecf765adaf40c420a04f21 debuginfo(build-id) = d59579a7c85ce5b002cc6b3e0a0be7932c041fe4 debuginfo(build-id) = e791f98736c9006bbe3b324abf035b0b119506f9 python2-libvirt-debuginfo = 3.10.0-1.fc27 python2-libvirt-debuginfo(x86-64) = 3.10.0-1.fc27
[berrange@t460 libvirt-python] $ rpm -q --requires --provides python3-libvirt-debuginfo-3.10.0-1.fc27.x86_64.rpm libvirt-python-debuginfo(x86-64) = 3.10.0-1.fc27 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 debuginfo(build-id) = 28d17edad0f257efbc68790ecd8c970fc153fe74 debuginfo(build-id) = 4c4aceebea990736cdcf58d122a231a6260f5474 debuginfo(build-id) = 7ff2ac4cefcee10d44b6dc73ebe0f1ed3f68f6ec python3-libvirt-debuginfo = 3.10.0-1.fc27 python3-libvirt-debuginfo(x86-64) = 3.10.0-1.fc27
Perhaps this was working around a bug on older RHEL ?
Sigh, ignore this. It helps if i use the actual RPms, not the debuginfo RPMs. 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 :|

Allow using rpmbuild --define "with_python2 0" to override the default logic about which python sub-RPMs to build Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index 5bbebeb..1619e26 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -1,10 +1,13 @@ -%define with_python2 1 -%define with_python3 0 +%define _with_python2 1 +%define _with_python3 0 %if 0%{?fedora} -%define with_python3 1 +%define _with_python3 1 %endif +%{!?with_python2: %define with_python2 %{_with_python2}} +%{!?with_python3: %define with_python3 %{_with_python3}} + Summary: The libvirt virtualization API python2 binding Name: libvirt-python Version: @PY_VERSION@ -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:34PM +0000, Daniel P. Berrange wrote:
Allow using
rpmbuild --define "with_python2 0"
to override the default logic about which python sub-RPMs to build
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index 1619e26..a98b902 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -1,3 +1,14 @@ +# This spec file assumes you are building on a Fedora or RHEL version +# that's still supported by the vendor. It may work on other distros +# or versions, but no effort will be made to ensure that going forward +%define min_rhel 6 +%define min_fedora 25 + +%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel}) + %define supported_platform 1 +%else + %define supported_platform 0 +%endif %define _with_python2 1 %define _with_python3 0 @@ -81,6 +92,11 @@ of recent versions of Linux (and other OSes). find examples -type f -exec chmod 0644 \{\} \; %build +%if ! %{supported_platform} +echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}" +exit 1 +%endif + %if %{with_python2} CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %endif -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:35PM +0000, Daniel P. Berrange wrote:
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later.
Do we really want to have this limitation? If so, maybe we can alter the "requires" message to only warn that it's not tested/supported. Pavel

On Fri, Jan 12, 2018 at 12:36:23PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:35PM +0000, Daniel P. Berrange wrote:
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later.
Do we really want to have this limitation?
Yes, please. Building upstream libvirt on such ancient distros will surely require more complicated patches than just deleting these checks from the specfile.
If so, maybe we can alter the "requires" message to only warn that it's not tested/supported.
Nobody reads warnings, that's why we build with -Werror ;) Jan
Pavel
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Fri, Jan 12, 2018 at 12:36:23PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:35PM +0000, Daniel P. Berrange wrote:
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later.
Do we really want to have this limitation? If so, maybe we can alter the "requires" message to only warn that it's not tested/supported.
This matches what we do for the native libvirt RPM build. 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 :|

On Fri, Jan 12, 2018 at 03:43:55PM +0000, Daniel P. Berrange wrote:
On Fri, Jan 12, 2018 at 12:36:23PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:35PM +0000, Daniel P. Berrange wrote:
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later.
Do we really want to have this limitation? If so, maybe we can alter the "requires" message to only warn that it's not tested/supported.
This matches what we do for the native libvirt RPM build.
I was mostly thinking about the possibility to take upstream libvirt or libvirt-python and be able to simply run "make rpm" on openSUSE. I'm not even sure if it would work. Pavel

On Fri, Jan 12, 2018 at 05:32:32PM +0100, Pavel Hrdina wrote:
On Fri, Jan 12, 2018 at 03:43:55PM +0000, Daniel P. Berrange wrote:
On Fri, Jan 12, 2018 at 12:36:23PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:35PM +0000, Daniel P. Berrange wrote:
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later.
Do we really want to have this limitation? If so, maybe we can alter the "requires" message to only warn that it's not tested/supported.
This matches what we do for the native libvirt RPM build.
I was mostly thinking about the possibility to take upstream libvirt or libvirt-python and be able to simply run "make rpm" on openSUSE.
That's explicitly not a goal for the RPM specs at this time, 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 :|

Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index a98b902..b667ebe 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -1,3 +1,5 @@ +# -*- rpm-spec -*- + # This spec file assumes you are building on a Fedora or RHEL version # that's still supported by the vendor. It may work on other distros # or versions, but no effort will be made to ensure that going forward -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:36PM +0000, Daniel P. Berrange wrote:
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> How about adding the same marker for vim? :) # vim: set filetype=spec : However, on Fedora and probably other distributions vim can recognize the filetype based on the file content.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index b667ebe..cc5a5a5 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -18,6 +18,12 @@ %define _with_python3 1 %endif +# Whether py2 packages are assumed to have python2- name prefix +%define py2_versioned_deps 0 +%if 0%{?fedora} || 0%{?rhel} > 7 +%define py2_versioned_deps 1 +%endif + %{!?with_python2: %define with_python2 %{_with_python2}} %{!?with_python3: %define with_python3 %{_with_python3}} @@ -31,10 +37,16 @@ License: LGPLv2+ Group: Development/Libraries BuildRequires: libvirt-devel >= @C_VERSION@ %if %{with_python2} +%if %{py2_versioned_deps} +BuildRequires: python2-devel +BuildRequires: pyth2on2-nose +BuildRequires: python2-lxml +%else BuildRequires: python-devel BuildRequires: python-nose BuildRequires: python-lxml %endif +%endif %if %{with_python3} BuildRequires: python3-devel BuildRequires: python3-nose -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:37PM +0000, Daniel P. Berrange wrote:
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index b667ebe..cc5a5a5 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -18,6 +18,12 @@ %define _with_python3 1 %endif
+# Whether py2 packages are assumed to have python2- name prefix +%define py2_versioned_deps 0 +%if 0%{?fedora} || 0%{?rhel} > 7 +%define py2_versioned_deps 1 +%endif + %{!?with_python2: %define with_python2 %{_with_python2}} %{!?with_python3: %define with_python3 %{_with_python3}}
@@ -31,10 +37,16 @@ License: LGPLv2+ Group: Development/Libraries BuildRequires: libvirt-devel >= @C_VERSION@ %if %{with_python2} +%if %{py2_versioned_deps} +BuildRequires: python2-devel +BuildRequires: pyth2on2-nose
Yes, I will remove this intentional typo i added during testing :-)
+BuildRequires: python2-lxml +%else BuildRequires: python-devel BuildRequires: python-nose BuildRequires: python-lxml %endif +%endif %if %{with_python3} BuildRequires: python3-devel BuildRequires: python3-nose -- 2.14.3
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 :|

On Thu, Jan 11, 2018 at 04:43:37PM +0000, Daniel P. Berrange wrote:
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> In addition we should rename __python RPM macro to __python2 for fedora and rhel > 7. This applies to python_sitearch as well.

On Fri, Jan 12, 2018 at 12:31:46PM +0100, Pavel Hrdina wrote:
On Thu, Jan 11, 2018 at 04:43:37PM +0000, Daniel P. Berrange wrote:
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
In addition we should rename __python RPM macro to __python2 for fedora and rhel > 7. This applies to python_sitearch as well.
I don't think we should do that (yet) as python_sitearch still works and AFAIK isn't going to be changed to point to the py3 binary. This avoids need for more conditionals. Once RHEL8 comes out and we drop RHEL6 as a target for libvirt, we can do the swtich, since IIUC RHEL-7 has the python2_* macros available. 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 :|

It is expected that future RHEL-8 will have python3 by default, so enable that. It is unclear whether python2 will still be available, so leave that enabled for now. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in index cc5a5a5..0087c78 100644 --- a/libvirt-python.spec.in +++ b/libvirt-python.spec.in @@ -14,7 +14,7 @@ %define _with_python2 1 %define _with_python3 0 -%if 0%{?fedora} +%if 0%{?fedora} || 0%{?rhel} > 7 %define _with_python3 1 %endif -- 2.14.3

On Thu, Jan 11, 2018 at 04:43:38PM +0000, Daniel P. Berrange wrote:
It is expected that future RHEL-8 will have python3 by default, so enable that. It is unclear whether python2 will still be available, so leave that enabled for now.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt-python.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>

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

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

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 :|
participants (4)
-
Daniel P. Berrange
-
Jiri Denemark
-
Ján Tomko
-
Pavel Hrdina