-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_setup_using_eggs failing locally on my laptop #1908
Comments
I'll need your help debugging this. For a start, this may given more info: The line before the failing assert is just taking the current interpreter pants is running under and using its dirname as the path and its identity, ie: CPython-2.7.9 as the filter in an attempt to get back the same interpreter, but setup with setuptools and wheel eggs installed. Of those ingredients, the most likely miss is the setuptools or wheel egg failing to install. The only other miss I can imagine is the dirname operation not playing well with symlinks in some way. This last is very handwavy and I'm having a hard time seeing how |
Here's the full output of running the above command: https://gist.github.com/ericzundel/e988d008ed31a3760027 Note that the test output reports its using 2.7.6, which is what is installed in /usr/bin on my mac.
The version of python on PATH is 2.7.9 though:
|
OK, thanks. More questions:
|
The Python I want is in /usr/local/bin and it is first in the path:
the versions installed in /usr/bin:
And the answer is "Yes" /usr/local/bin/python is a symlink (I think this is normal when Python is installed by brew)
|
Hrm. Do you mind moving aside and saving the complete build-support/ dir then re-trying? |
By moving aside, I guess I mean tar/zip it up somewhere safe then |
I did a I upgraded to Yosemite (macos 10.10) about a month ago. When you say 'default' python 2.7.6 it is the version installed in /usr/bin/, I'm not sure if that changed from 10.9 to 10.0. However, I've had a version higher than 2.7.6 in /usr/local/bin for a long time. I've had a script in place to enforce a minimum runtime version of python for pants of 2.7.8 for our users since March 2015. |
OK - not even close to a solution, but noting some facts as I think through this:
Open questions here for myself:
|
...ok - the 2.7.6 thing is hard to debug without an OSX, I'm basically going to have to ask you to start adding prints to figure this out remotely. Before doing that, I would be interested in you changing your pants.ini interpreter compatbility constraint if its not already set to >=2.7.8, ie; [python-setup]
interpreter_requirement: CPython>=2.7.8,<3 With a clean-all I'm guessing this test might pass since that constraint should keep 2.7.6 out of the interpreter cache, thus the brew python should be selected, and its presumably more sane path structure (or whatever is leading to this bug), should allow the test to pass. This would not be a fix I'm satisfied with, but it could shed more light. |
A pre-emptive debug request after the 2.7.8 constraint test is to apply this patch and report back on the results (w/o the 2.7.8 forcing bit in-play): $ git diff
diff --git a/tests/python/pants_test/python/test_interpreter_cache.py b/tests/python/pants_test/python/test_interpreter_cache.py
index f48d229..0cffee6 100644
--- a/tests/python/pants_test/python/test_interpreter_cache.py
+++ b/tests/python/pants_test/python/test_interpreter_cache.py
@@ -93,6 +93,13 @@ class TestInterpreterCache(unittest.TestCase):
python_repos = create_subsystem(PythonRepos, indexes=[], repos=[egg_dir])
cache = PythonInterpreterCache(python_setup, python_repos)
+ print('')
+ print('>>> interpreter selection inputs')
+ print(' self._interpreter.binary: {}'.format(self._interpreter.binary))
+ print(' path: {}'.format(os.path.dirname(self._interpreter.binary)))
+ print(' filter: {}'.format(interpreter_requirement))
+ print('')
+
interpereters = cache.setup(paths=[os.path.dirname(self._interpreter.binary)],
filters=[str(interpreter_requirement)])
self.assertGreater(len(interpereters), 0) |
The 2.7.8 constraint test worked (the test passed). Output here: https://gist.github.com/ericzundel/201a88dc370e4b87482c Here's the output with the diff above applied (and the test failing): https://gist.github.com/ericzundel/169b0a1d5045946d957e |
Thank you very much, that solves it. The binary is Python and the regexes pex uses assume python: https://github.com/pantsbuild/pex/blob/master/pex/interpreter.py#L181-L182 I'll fork off an issue and PR for pex. |
Fix is out here: https://rbcommons.com/s/twitter/r/2586/ |
I made that change to pex locally but I'm not sure how to point pants at it to see if this solves the issue on my laptop. |
Its easiest to just edit |
Unfortunately, the problem persists after that change. |
In the debugging information you added above:
The python I actually want is named 'python2.7' or 'python'
PATH on my machine has /usr/local/bin before /usr/bin
|
I suspect my try it out quick advice was bad. The 'venv' in play is a pex chroot built for tests and that uses the pex in 3rdparty/python/requirements.txt. So... longer story:
The local edit to the pex venv source in pants should continue to be irrelevant. |
It may not have been clear from above, but pants picking 2.7.6 is not wrong given a compatibility of |
Working the current logic for picking a compatible interpreter to respect PATH order instead of picking lowest compatible (the current logic) - is valid, but I'd like to fork an issue for that alone. |
With this test setup I was able to show that the fix is working:
Then run
and in Pants:
(Just setting python-repos was not enough. I tried a |
Excwllwnt. Thanks for working through this with me. I typed the config, should have been the |
Fix is in @ 65ac286 Please re-open if the test still fails for you. |
This is with pants at 0.0.40 on my macbook pro with python 2.7.9 (installed from brew)
The text was updated successfully, but these errors were encountered: