Bug 1812083 - python-rpm-generators provide python3dist() for all Python 3 versions
Summary: python-rpm-generators provide python3dist() for all Python 3 versions
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-rpm-generators
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Orsava
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1821489
TreeView+ depends on / blocked
 
Reported: 2020-03-10 13:53 UTC by Miro Hrončok
Modified: 2020-05-12 10:44 UTC (History)
8 users (show)

Fixed In Version: python-rpm-generators-11-5.fc33
Clone Of:
Environment:
Last Closed: 2020-05-12 10:44:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-03-10 13:53:13 UTC
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.

Comment 1 Neal Gompa 2020-03-11 03:17:01 UTC
(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!)

Comment 2 Miro Hrončok 2020-03-11 09:21:27 UTC
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.)

Comment 3 Miro Hrončok 2020-03-18 10:53:22 UTC
> 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?

Comment 4 Miro Hrončok 2020-03-23 11:27:47 UTC
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}

Comment 5 Neal Gompa 2020-03-23 18:07:07 UTC
(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.

Comment 6 Tomas Orsava 2020-03-24 16:56:57 UTC
(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!

Comment 7 Tomas Orsava 2020-04-15 11:59:26 UTC
PR upstream ready and tested, waiting for some other changes before merging.


Note You need to log in before you can comment on or make changes to this bug.