#3708 SPEC: Do not build python2 bindings on latest distros
Merged 5 years ago by jhrozek. Opened 6 years ago by lslebodn.
SSSD/ lslebodn/sssd python2_less  into  master

file modified
+33
@@ -107,6 +107,12 @@ 

      %global with_python3_option --without-python3-bindings

  %endif

  

+ %if (0%{?fedora} > 28 || 0%{?rhel} > 7)

+     %global with_python2_option --without-python2-bindings

+ %else

+     %global with_python2 1

+ %endif

+ 

  %global enable_systemtap 1

  %if (0%{?enable_systemtap} == 1)

      %global enable_systemtap_opt --enable-systemtap
@@ -203,7 +209,9 @@ 

  BuildRequires: docbook-style-xsl

  BuildRequires: krb5-devel

  BuildRequires: c-ares-devel

+ %if (0%{?with_python2} == 1)

  BuildRequires: python2-devel

+ %endif

  %if (0%{?with_python3} == 1)

  BuildRequires: python3-devel

  %endif
@@ -372,6 +380,7 @@ 

      * sss_obfuscate for generating an obfuscated LDAP password

      * sssctl -- an sssd status and control utility

  

+ %if (0%{?with_python2} == 1)

  %package -n python2-sssdconfig

  Summary: SSSD and IPA configuration file manipulation classes and functions

  Group: Applications/System
@@ -381,6 +390,7 @@ 

  

  %description -n python2-sssdconfig

  Provides python2 files for manipulation SSSD and IPA configuration files.

+ %endif

  

  %if (0%{?with_python3} == 1)

  %package -n python3-sssdconfig
@@ -394,6 +404,7 @@ 

  Provides python3 files for manipulation SSSD and IPA configuration files.

  %endif

  

+ %if (0%{?with_python2} == 1)

  %package -n python2-sss

  Summary: Python2 bindings for sssd

  Group: Development/Libraries
@@ -408,6 +419,7 @@ 

  Also provides several other useful python2 bindings:

      * function for retrieving list of groups user belongs to.

      * class for obfuscation of passwords

+ %endif

  

  %if (0%{?with_python3} == 1)

  %package -n python3-sss
@@ -426,6 +438,7 @@ 

      * class for obfuscation of passwords

  %endif

  

+ %if (0%{?with_python2} == 1)

  %package -n python2-sss-murmur

  Summary: Python2 bindings for murmur hash function

  Group: Development/Libraries
@@ -434,6 +447,7 @@ 

  

  %description -n python2-sss-murmur

  Provides python2 module for calculating the murmur hash version 3

+ %endif

  

  %if (0%{?with_python3} == 1)

  %package -n python3-sss-murmur
@@ -570,6 +584,7 @@ 

  %description -n libipa_hbac-devel

  Utility library to validate FreeIPA HBAC rules for authorization requests

  

+ %if (0%{?with_python2} == 1)

  %package -n python2-libipa_hbac

  Summary: Python2 bindings for the FreeIPA HBAC Evaluator library

  Group: Development/Libraries
@@ -582,6 +597,7 @@ 

  %description -n python2-libipa_hbac

  The python2-libipa_hbac contains the bindings so that libipa_hbac can be

  used by Python applications.

+ %endif

  

  %if (0%{?with_python3} == 1)

  %package -n python3-libipa_hbac
@@ -615,6 +631,7 @@ 

  %description -n libsss_nss_idmap-devel

  Utility library for SID and certificate based lookups

  

+ %if (0%{?with_python2} == 1)

  %package -n python2-libsss_nss_idmap

  Summary: Python2 bindings for libsss_nss_idmap

  Group: Development/Libraries
@@ -627,6 +644,7 @@ 

  %description -n python2-libsss_nss_idmap

  The python2-libsss_nss_idmap contains the bindings so that libsss_nss_idmap can

  be used by Python applications.

+ %endif

  

  %if (0%{?with_python3} == 1)

  %package -n python3-libsss_nss_idmap
@@ -782,6 +800,7 @@ 

      %{with_initscript} \

      %{?with_syslog} \

      %{?with_cifs_utils_plugin_option} \

+     %{?with_python2_option} \

      %{?with_python3_option} \

      %{?enable_polkit_rules_option} \

      %{?enable_systemtap_opt} \
@@ -832,10 +851,12 @@ 

  

  # Older versions of rpmbuild can only handle one -f option

  # So we need to append to the sssd*.lang file

+ %if (0%{?with_python2} == 1)

  for file in `ls $RPM_BUILD_ROOT/%{python2_sitelib}/*.egg-info 2> /dev/null`

  do

      echo %{python2_sitelib}/`basename $file` >> python2_sssdconfig.lang

  done

+ %endif

  

  %if (0%{?with_python3} == 1)

  for file in `ls $RPM_BUILD_ROOT/%{python3_sitelib}/*.egg-info 2> /dev/null`
@@ -914,8 +935,10 @@ 

  echo "sssd.lang:"

  cat sssd.lang

  

+ %if (0%{?with_python2} == 1)

  echo "python2_sssdconfig.lang:"

  cat python2_sssdconfig.lang

+ %endif

  

  %if (0%{?with_python3} == 1)

  echo "python3_sssdconfig.lang:"
@@ -1192,10 +1215,12 @@ 

  %{_mandir}/man8/sss_seed.8*

  %{_mandir}/man8/sssctl.8*

  

+ %if (0%{?with_python2} == 1)

  %files -n python2-sssdconfig -f python2_sssdconfig.lang

  %defattr(-,root,root,-)

  %dir %{python2_sitelib}/SSSDConfig

  %{python2_sitelib}/SSSDConfig/*.py*

+ %endif

  

  %if (0%{?with_python3} == 1)

  %files -n python3-sssdconfig -f python3_sssdconfig.lang
@@ -1206,9 +1231,11 @@ 

  %{python3_sitelib}/SSSDConfig/__pycache__/*.py*

  %endif

  

+ %if (0%{?with_python2} == 1)

  %files -n python2-sss

  %defattr(-,root,root,-)

  %{python2_sitearch}/pysss.so

+ %endif

  

  %if (0%{?with_python3} == 1)

  %files -n python3-sss
@@ -1216,9 +1243,11 @@ 

  %{python3_sitearch}/pysss.so

  %endif

  

+ %if (0%{?with_python2} == 1)

  %files -n python2-sss-murmur

  %defattr(-,root,root,-)

  %{python2_sitearch}/pysss_murmur.so

+ %endif

  

  %if (0%{?with_python3} == 1)

  %files -n python3-sss-murmur
@@ -1262,9 +1291,11 @@ 

  %{_libdir}/libsss_nss_idmap.so

  %{_libdir}/pkgconfig/sss_nss_idmap.pc

  

+ %if (0%{?with_python2} == 1)

  %files -n python2-libsss_nss_idmap

  %defattr(-,root,root,-)

  %{python2_sitearch}/pysss_nss_idmap.so

+ %endif

  

  %if (0%{?with_python3} == 1)

  %files -n python3-libsss_nss_idmap
@@ -1272,9 +1303,11 @@ 

  %{python3_sitearch}/pysss_nss_idmap.so

  %endif

  

+ %if (0%{?with_python2} == 1)

  %files -n python2-libipa_hbac

  %defattr(-,root,root,-)

  %{python2_sitearch}/pyhbac.so

+ %endif

  

  %if (0%{?with_python3} == 1)

  %files -n python3-libipa_hbac

no initial comment

@pviktori, is there any policy about dropping python2 packages in fedora?

Because python2-libipa_hbac, python2-sssdconfig and python2-sss-murmur are used only by python2-ipa{lib,server} which will be probably dropped soon as well.

When nothing in Fedora uses them, and users don't depend on them, then please drop them from Rawhide.
We'll be orphaning python2 later, so any removed dependency helps.

rebased onto 8d0959ab009e39ee3eff385a448aa1c69e9f0d95

6 years ago

When nothing in Fedora uses them, and users don't depend on them, then please drop them from Rawhide.
We'll be orphaning python2 later, so any removed dependency helps.

The we will need to do it in fedora after freeIPA. But it can be already done in upstream. Thank you for info.

Often, IPA developers would use SSSD upstream builds to test something out. So I agree this patch is needed, but I don't think we should merge it yet, only after IPA drops their python2 packages.

Often, IPA developers would use SSSD upstream builds to test something out. So I agree this patch is needed, but I don't think we should merge it yet, only after IPA drops their python2 packages.

A) @jhrozek, have you files fedora BZ which I can follow?
B) Do you expect that IPA developers will be testing upstream sssd builds on fedora 29?

You could also use a bcond for conditionalizing -- see example here or here.
Then, rpmbuild --with python2 or fedpkg mockbuild --with python2 would give you a build with Python 2 even if the feature would be removed from Fedora.

On 18 Apr 2018, at 21:53, Lukas Slebodnik pagure@pagure.io wrote:
=20
=20
lslebodn commented on the pull-request: SPEC: Do not build python2 = bindings on latest distros that you are following:
``

Often, IPA developers would use SSSD upstream builds to test =
something out. So I agree this patch is needed, but I don't think we =
should merge it yet, only after IPA drops their python2 packages.
=20
A) @jhrozek, have you files fedora BZ which I can follow?

Not fedora (that I know of), there are private downstream bugs such as =

1565263

B) Do you expect that IPA developers will be testing upstream sssd =
builds on fedora 29?
``
=20

They might, I don=E2=80=99t know. I just don=E2=80=99t want to cut them =
off from development. But on the other hand, we can give this a try and =
if someone complains, revert the patch..

To reply, visit the link below or just reply to this email
https://pagure.io/SSSD/sssd/pull-request/3708

My experience is that freeIPA devs are get used to develop on stable version of fedora + using copr. And fedora 29 shall become stable[1] on 2018-Oct-30

If freeipa is not ready at that time we can change condition to 0%{?fedora} > 29. Meanwhile upstream version of sssd will be tested on rawhide without python2 to be prepared in advance for such change.

BTW, this is not a proposal to have the same change in fedora spec. It is not even possible to do that due to packaging guidelines.

[1] http://fedoraproject.org/wiki/Releases/29/Schedule

rebased onto 37c3d1b53490872e1ff380754f5daf894d567d4c

5 years ago

Often, IPA developers would use SSSD upstream builds to test something out. So I agree this patch is needed, but I don't think we should merge it yet, only after IPA drops their python2 packages.

@jhrozek, I checked state of freeIPA in rawhide after few months and freeIPA does not require sssd python2 bindings in rawhide.

Would it be possible to merge this PR?

sh# dnf repoquery --recursive --resolve --requires freeipa-server-dns | grep python2
Last metadata expiration check: 0:13:38 ago on Sat Jul 21 20:24:44 2018.
python2-0:2.7.15-6.fc29.i686
python2-0:2.7.15-6.fc29.x86_64
python2-libs-0:2.7.15-6.fc29.i686
python2-libs-0:2.7.15-6.fc29.x86_64
python2-pip-0:9.0.3-6.fc29.noarch
python2-setuptools-0:39.2.0-5.fc29.noarch
python2-talloc-0:2.1.14-2.fc29.i686
python2-talloc-0:2.1.14-2.fc29.x86_64
sh# dnf repoquery --recursive --resolve --requires freeipa-server-trust-ad | grep python2
Last metadata expiration check: 0:19:27 ago on Sat Jul 21 20:24:44 2018.
python2-0:2.7.15-6.fc29.i686
python2-0:2.7.15-6.fc29.x86_64
python2-libs-0:2.7.15-6.fc29.i686
python2-libs-0:2.7.15-6.fc29.x86_64
python2-pip-0:9.0.3-6.fc29.noarch
python2-setuptools-0:39.2.0-5.fc29.noarch
python2-talloc-0:2.1.14-2.fc29.i686
python2-talloc-0:2.1.14-2.fc29.x86_64

There are still packages which depends on sssd python2 bindings in rawhide but IPA developers will not be affected if they decide to test sssd git master.

rebased onto 3d4a1ca

5 years ago

As long as we don't modify the fedora specfile yet, but only upstream, then I'm fine.

btw do you remember which packages still depend on py2 bindings in fedora? I ran a couple of queries at random, but only found the ipa packages.

As long as we don't modify the fedora specfile yet, but only upstream, then I'm fine.

+1

btw do you remember which packages still depend on py2 bindings in fedora? I ran a couple of queries at random, but only found the ipa packages.

Directly just freeIPA packages.

sh# dnf repoquery --whatrequires python2-sss
Last metadata expiration check: 5:02:24 ago on Mon 23 Jul 2018 05:36:58 PM CEST.
sh# dnf repoquery --whatrequires python2-libsss_nss_idmap
Last metadata expiration check: 5:02:39 ago on Mon 23 Jul 2018 05:36:58 PM CEST.

sh# dnf repoquery --whatrequires python2-sss-murmur
Last metadata expiration check: 5:02:49 ago on Mon 23 Jul 2018 05:36:58 PM CEST.
python2-ipalib-0:4.6.90.pre2-11.fc29.noarch
sh# dnf repoquery --whatrequires python2-libipa_hbac
Last metadata expiration check: 5:03:04 ago on Mon 23 Jul 2018 05:36:58 PM CEST.
python2-ipalib-0:4.6.90.pre2-11.fc29.noarch
sh# dnf repoquery --whatrequires python2-sssdconfig
Last metadata expiration check: 5:02:15 ago on Mon 23 Jul 2018 05:36:58 PM CEST.
python2-ipaserver-0:4.6.90.pre2-11.fc29.noarch

But there are still packages which indirectly depends on sssd (via python2-ipalib in rawhide (fleet-commander* and ipsilon)

Commit 9505586 fixes this pull-request

Pull-Request has been merged by jhrozek

5 years ago
Metadata