Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1757834

Summary: %py_build uses --executable="%{__python2}
Product: Red Hat Enterprise Linux 7 Reporter: Miro Hrončok <mhroncok>
Component: python-rpm-macrosAssignee: Charalampos Stratakis <cstratak>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: low    
Version: 7.7CC: carlwgeorge, cstratak, hhorak, pviktori, torsava
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rpm-macros-3-33.el7 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:34:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miro Hrončok 2019-10-02 14:17:18 UTC
Apparently, the %py_build macro should respect the global definition of %__python, however it hardcodes --executable="%{__python2} and hence it makes it impossible to do the following:

%global __python %__python3
...
%py_build

python-rpm-macros 3-32

Comment 3 Tomas Orsava 2019-10-03 09:33:42 UTC
Hm, a significant number of packages are using that macro, which makes me weary of changing it's definition. However, as %__python and %__python2 should be defined the same, it at least *should* be functionally the same. With plenty of testing we should be fine.

Comment 4 Miro Hrončok 2019-10-03 09:41:00 UTC
This does not impact Python 2 packages. This only impacts Python 3 packages which define %__python to %__python3 AND use %py_build (not %py3_build). My educated guess that no RHEL 7 package does that.

Comment 5 Tomas Orsava 2019-10-03 11:47:19 UTC
I see, thanks! More info in https://bugzilla.redhat.com/show_bug.cgi?id=1757833#c5

Comment 6 Petr Viktorin (pviktori) 2019-10-08 13:50:57 UTC
Right, this shouldn't affect any RHEL7 packages. It might affect CentOS or EPEL packages, or customers' builds.

Comment 7 Petr Viktorin (pviktori) 2019-10-08 13:51:28 UTC
But there's an easy workaround. I'm not sure it's worth fixing in RHEL7.

Comment 8 Miro Hrončok 2019-10-08 14:01:53 UTC
What's the workaround?

We can override the macro in EPEL.

Comment 9 Petr Viktorin (pviktori) 2019-10-08 14:10:35 UTC
Use %py3_build.

Comment 10 Miro Hrončok 2019-10-08 14:19:03 UTC
Oh. The idea is to conditionally set %__python and have a simple specfile with no further %ifs.

Comment 11 Petr Viktorin (pviktori) 2019-10-22 13:40:32 UTC
Overriding in EPEL sounds like a good choice. It seems the timing is not on our side.

Comment 12 Miro Hrončok 2019-10-22 13:50:09 UTC
EPEL 7 workaround: https://src.fedoraproject.org/rpms/epel-rpm-macros/pull-request/9

Comment 13 Tomas Orsava 2019-10-22 14:42:09 UTC
This issue was discovered too late to be fixed in RHEL 7.8. We're leaving it open for later consideration.

Comment 19 errata-xmlrpc 2020-09-29 19:34:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (python-rpm-macros bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3881