When I attempted to build python39-setuptools to test what would be needed in order to have multiple Python 3 stacks in future RHEL, I have noticed the following problem (that I assume was hotfixed for RHEL 8.2 somehow, but not in Fedora). python39-setuptools provides: python3.9dist(setuptools) = 45.2.0 python3dist(setuptools) = 45.2.0 I believe that we should only provide python3dist() for the "main" Python stack.
(In reply to Miro Hrončok from comment #0) > When I attempted to build python39-setuptools to test what would be needed > in order to have multiple Python 3 stacks in future RHEL, I have noticed the > following problem (that I assume was hotfixed for RHEL 8.2 somehow, but not > in Fedora). There is a hotfix to this in python-rpm-generators-5-6.el8: https://git.centos.org/rpms/python-rpm-generators/c/d809defd2ccab8945493103694fe96ffe6ea3a3c I'm not sure I like the way this was done, but it was never proposed upstream, presumably because it isn't a good way to configure this. This patch will probably be carried forward into RHEL 9. (P.S.: You can say RHEL 9, it was publicly documented at Red Hat Summit last year!)
I am aware of that hotfix. Unfortunately, hotfixes are not usually carried from one major version of RHEL to another, because RHEL branches from Fedora. Hence problems that are solved in RHEL only and never in Fedora are likely to be reintroduced in next RHEL unless somebody keeps track of them. I remember talking with Tomáš Orsava about this hotfix and a proper solution back then, and we agreed on a following solution (AFAIK): - python-srpm-macros define what Python version is "main" (but not via the macros that people regularly override) - python-rpm-generators use that macro value - python spec files also use that value for the %bcond main_python (P.S.: I've said future RHEL because I don't target a specific version when I think about this.)
> I'm not sure I like the way this was done, but it was never proposed upstream, presumably because it isn't a good way to configure this. How would you have done it?
Tomáš, this: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/48 Could allow us to do: --majorver-provides-versions %{__default_python3_version},2.7 Or we could even disable this for 2.7: --majorver-provides-versions %{__default_python3_version}
(In reply to Miro Hrončok from comment #3) > > I'm not sure I like the way this was done, but it was never proposed upstream, presumably because it isn't a good way to configure this. > > How would you have done it? The original way I envisioned this would be that the distro with multi-Python would override %__pythondist_provides and %__pythondist_path accordingly for each Python interpreter, but I didn't originally consider the singlespec case... With the singlespec case, this breaks down and we might in fact need the method used in RHEL. So your method isn't bad at all.
(In reply to Miro Hrončok from comment #4) > Tomáš, this: > https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/48 > > Could allow us to do: > > --majorver-provides-versions %{__default_python3_version},2.7 > > Or we could even disable this for 2.7: > > --majorver-provides-versions %{__default_python3_version} Sounds good, less hardcoding to do!
PR upstream ready and tested, waiting for some other changes before merging.