Permalink
11 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add a configuration for python path
Test Plan: not a clue Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5717
- Loading branch information
This comment has been minimized.
I'm using Ubuntu 12.04, so I have Python 2.7 not 2.6 and now things aren't working for me. Why are you requiring 2.6?
This comment has been minimized.
fwiw, Fedora doesn't have a
python2.6alias either.This comment has been minimized.
@jaymzh ^
This comment has been minimized.
I'm not sure the best solution here. @epriestley you didn't like the idea of making the python path configurable, the original version of this patch, which is why we went down this road.
FYI, @bolinfest it's so you don't pick up the default 2.4 version of py on CentOS5 :)
I see two options:
This comment has been minimized.
I would like to think that Cent/RHEL 5 is a fairly rare case. Is it unreasonable to just fix your
$PATHso that/usr/bin/env pythonworks? The entire point of/usr/bin/envis to be universal, and by hardcoding a version, we're going against that.Even if we go down from
python2.7- what happens when 2.8 comes out, or when we inevitably one day target 3.0 and Cent 5 is still on 2.4 - this reeks of not being maintainable, in that we'd have to update it each time.I'd be more in favor of making it a config thing - but I really think this is a pretty rare case, and correcting your
$PATHyourself is the proper fix.IMO, the best solution is to go back to
/usr/bin/env pythonand possibly make the error hint to the user "If you have another Python that we should use, make sure you prioritize your $PATH accordingly." /cc @epriestleyThis comment has been minimized.
RHEL5 is actually quite common. Sadly.
The reason PATH doesn't work is because most system things want the system python, changing the path to shove /usr/local/bin in front breaks things. Python isn't terribly backwards compatible.
Further, arc expects py2.6 or later, and so it makes sense to specify such.
Also, we tried setting the path in PHP land before calling the py linter, but it didn't work, sadly.
I'm fine making it configurable...
This comment has been minimized.
What about something like:
PATH=/usr/local/bin:$PATH arc [..](and alias arc to that)That is a good point that system things (namely yum, I suspect) will break with newer Python.
Just tossing out some ideas if @epriestley still doesn't want to clutter the config with this.
This comment has been minimized.
that's a lot of .bashrcs to update :)
This comment has been minimized.
In general, the problems here are:
pythonearlier than 2.6, PEP8 dies with a syntax error which is confusing to users and which they can not resolve unless they are extremely sophisticated, because it gives them no hints that it's a python version error. We should not emit this error, so changing it topythonalone isn't acceptable.pythonand then did a bunch of hacky stuff to check the Python version and try to raise a better error. This didn't work for @jaymzh because the firstpythonin his path was python 2.5 (or some other earlier version).A workaround is:
python2.6anywhere your $PATH.Generally, I'm going to fix this in several ways:
support/bin/for Arcanist, like the similar mechanism in Phabricator. Specifically, arc will ship with an emptysupport/bin/directory and add that directory to its $PATH first.python2.6preferentially, thenpython, and validate the version ofpython.This will probably take a while to get through (like, possibly months). You can pursue the workaround above until then. After the first step lands, you can create the
python2.6symlink inarcanist/support/bininstead of elsewhere on your system.This comment has been minimized.
It sounds like it's the Python 2.5 (<2.6) users that are ruining this for everyone. Since they're likely the dying breed, why not punish them instead of incurring extra steps for more up-to-date and future users?
This comment has been minimized.
All python users are ruining this for me. The action plan above is carefully crafted to reduce support requests as close to zero as I can. :)