Bug 1347019 - Need __python2 macro -> /usr/bin/python2.6
Summary: Need __python2 macro -> /usr/bin/python2.6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: epel-rpm-macros
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jason Tibbitts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-15 19:54 UTC by Matt Domsch
Modified: 2016-08-10 17:18 UTC (History)
3 users (show)

Fixed In Version: epel-rpm-macros-6-11
Clone Of:
Environment:
Last Closed: 2016-08-10 17:18:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
%{__python} packages (13.43 KB, text/plain)
2016-06-17 12:34 UTC, Matt Domsch
no flags Details

Description Matt Domsch 2016-06-15 19:54:07 UTC
Description of problem:
No %{__python2} macro exists for EL6.  As python 2.6 is the default python for RHEL6 and most related products, there should be a %{__python2} macro pointing to /usr/bin/python2.

Use of %{__python} (instead of %{__python2}) by EPEL packages built for EL6 cause runtime failures on Amazon Linux 2015.xx because that makes the poor choice to set /usr/bin/python -> /usr/bin/python2.7 instead of /usr/bin/python2.6 as the EPEL EL6 build system expects.  By using %{__python2}, pointing to /usr/bin/python2 (which on Amazon Linux points to /usr/bin/python2.6), resulting packages explicitly point to #!/usr/bin/python2 and succeed.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1346950


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jason Tibbitts 2016-06-15 20:38:42 UTC
But.... %__python2 is currently defined in epel-rpm-macros-6.  In /etc/rpm/macros.zzz-epel-python:

%__python2 %__python

Now, currently it appears that %__python just maps to /usr/bin/python.  I can map it to something else if that's necessary, but I have a hard time believing that /usr/bin/python in EL6 will ever point to anything else than python 2.6.

Comment 2 Jason Tibbitts 2016-06-15 20:41:30 UTC
Oh, now I get it.  Though... I'm not understanding how whatever we do in epel-rpm-macros has anything to do with what's a completely different operating system (which it must be if it has a different system python).

Comment 3 Matt Domsch 2016-06-15 21:14:38 UTC
Amazon Linux is based on EL6, and includes the epel-release package in its base repo, so yum --enablerepo=epel install  works for almost everything in EPEL, except for python programs where the program expects /usr/bin/python == python 2.6, but it's not.  /usr/bin/python2 is python 2.6.


%__python2 should map to /usr/bin/python2 or /usr/bin/python2.6 (in case someone stupidly changes /usr/bin/python2 to point to python 2.7, just as /usr/bin/python does).

Comment 4 Fedora Update System 2016-06-15 21:32:56 UTC
epel-rpm-macros-6-11 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-bd74928a38

Comment 5 Kevin Fenzi 2016-06-15 21:39:23 UTC
So, after this change we still need to rebuild everything that is python using right? Or I guess we could just ask maintainers to, but a mass rebuild seems like it would have more chance of going well.

Comment 6 Jason Tibbitts 2016-06-15 21:51:58 UTC
Yes, it won't magically fix anything.  Plus a good many EL6 packages don't even use %__python2, so it requires more than just a rebuild.  (Not to mention the Fedora packages that still use %__python.  There's a load of work to do.)

Comment 7 Jason Tibbitts 2016-06-15 21:53:28 UTC
And don't forget that there's about 16 days of delay before you can even start rebuilding packages that currently use %__python2, unless someone can scare up three bits of karma.

Comment 8 Matt Domsch 2016-06-17 12:34:10 UTC
Created attachment 1169117 [details]
%{__python} packages

902 packages using %{__python} in their spec files.

Comment 9 Fedora Update System 2016-06-17 18:49:04 UTC
epel-rpm-macros-6-11 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-bd74928a38

Comment 10 Kevin Fenzi 2016-06-18 17:17:15 UTC
Thats quite a pile. ;( 

Question: does amazon have a rhel7 clone that they do this to as well? Or only epel6/amazon6 is affected?

And yeah, I guess we have to wait for this to get stable to be included in srpm generation. I don't think a buildroot override will work.

Comment 11 Matt Domsch 2016-06-19 04:26:11 UTC
To make it clearer:

                                /usr/bin/python	/usr/bin/python2
RHEL 6 / CentOS 6 / EPEL 6	Python-2.6	Python-2.6
RHEL 7 / CentOS 7 / EPEL 7	Python-2.7	Python-2.7
Amazon Linux 2015.09	        Python-2.7	Python-2.6
Amazon Linux 2016.03.2	        Python-2.7	Python-2.6

So neither using EPEL6 nor EPEL7 as-is is exactly the right thing for Amazon Linux, and hence the need to hard-code %{__python} and %{__python2} by OS version to the explicit version number desired.  The current patch hard-codes %{__python2} = python2.6 for EPEL6.  Should we do likewise for %{__python}?

The latest Amazon Linux appears to be 2016.03.2 as of June 9.  I don't see anything about an EL7-styled Amazon Linux today.

I did point Max Spevack at this thread, in case his team has better ideas for how to handle Amazon Linux + EPEL.  Perhaps there's a need for an Extra Packages for Amazon Linux that uses %{__python} == python 2.7 (as in RHEL7) but %{__python2} == Python 2.6 (as in RHEL 6) ?

Comment 12 Matt Domsch 2016-06-19 04:38:39 UTC
oh, Amazon Linux is using alternatives for 'python' too.  ugh!  So an end user admin may switch out the system python.  Explicit versioning for %{__python} may be the only complete solution.

Comment 13 Jason Tibbitts 2016-08-09 18:33:21 UTC
Well, I totally forgot about this; I wish bodhi did more nagging.

I went ahead and pushed what I had in testing, but after the more recent comments I don't know if there's something else I should try to do.

Comment 14 Fedora Update System 2016-08-10 17:18:12 UTC
epel-rpm-macros-6-11 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.


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