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:
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.
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).
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).
epel-rpm-macros-6-11 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-bd74928a38
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.
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.)
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.
Created attachment 1169117 [details] %{__python} packages 902 packages using %{__python} in their spec files.
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
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.
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) ?
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.
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.
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.