[Piglit] [PATCH] Revert "python: change she-bang to python2"

Ilia Mirkin imirkin at alum.mit.edu
Tue Jun 24 08:27:13 PDT 2014


On Tue, Jun 24, 2014 at 11:20 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Friday, June 20, 2014 12:04:01 AM Dylan Baker wrote:
>> This reverts commit 40b5d5288991fec2cc76ea4af7050555be467126.
>>
>> The patch to be reverted breaks users of *BSD, solaris, and OSX which
>> don't provide a python2 symlink, making it a regression.
>>
>> The patch however, fixes python for arch users whos python executable
>> incorrectly is python3. This is a bug that Arch is not willing to fix.
>>
>> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80261
>
> I for one was happy to see the change to /usr/bin/python2, as it makes things
> easier for Arch Linux users.  There are a lot of Piglit users running Arch
> Linux, and AFAICT only a couple using BSD/Solaris/OSX.
>
> Recently, a bunch of my coworkers who are Debian/Fedora/Gentoo users have
> tried to use my Arch Linux box, and didn't realize they needed to work around
> this issue.  They were horribly confused until I explained how to fix it.
>
> Let's look at the two failure modes:
>
> 1. Arch Linux with #! /usr/bin/env python
>
> $ ./piglit-run.py tests/gpu results
> Traceback (most recent call last):
>   File "./piglit-run.py", line 30, in <module>
>     from framework.programs.run import run
>   File "/home/kwg/Projects/piglit/framework/programs/run.py", line 30, in
> <module>
>     import framework.core as core
>   File "/home/kwg/Projects/piglit/framework/core.py", line 32, in <module>
>     import ConfigParser
> ImportError: No module named 'ConfigParser'
>
> This failure mode is incredibly cryptic.  The workaround is easy:
> run "python2 piglit-run.py tests/gpu results".  But it's not obvious.

Easy enough to throw in a test into __init__.py checking the python
version... if it's != 2, abort, telling them that their system is
broken.

>
> 2. BSD/OSX/Solaris with #! /usr/bin/env python2
>
> $ ./piglit-run.py tests/gpu results
> /usr/bin/env: python2: No such file or directory
>
> This is incredibly clear, at least.  The workaround is both easy and obvious:
> put a python2 -> python symlink anywhere in your path.  It doesn't even have
> to be installed system-wide - you can put it in ~/bin if you like.
>
> For the record, I dislike that Arch has installed Python 3 as /usr/bin/python.
> It's incompatible and has caused no end of headaches for upstreams.  But,
> there's not a lot we can do about that.

Isn't there? Refuse to go along with the idiocy until Arch fixes it or
people stop using it...

  -ilia

>  Most systems have started installing
> python 2.x as both /usr/bin/python and /usr/bin/python2, which seems
> reasonable enough.

>
> This is obviously a frustrating issue, but I hope the patch can stay.  Not
> particularly for my benefit (I know the workaround), but for other Arch users
> or for non-Arch people haplessly stuck using someone else's machine.
>
> --Ken
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>


More information about the Piglit mailing list