-
-
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_test_builder.py not finding a suitable interpreter on OS X #851
Comments
It might be useful to know what |
|
Sorry - to be clear, these 2 should be equal: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import os, sys; print(os.path.realpath(sys.prefix))'
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 -c 'import os, sys; print(os.path.realpath(sys.prefix))' |
Correct, these both yield:
|
Interesting -- so two separate binaries but tied to the same Python standard library installation. I wonder if we need to make pex.interpreter aware of sys.prefix and then somehow tie that into the interpreter cache. |
I think so. I never checked content hashes for java/javac, but when Apple packaged java 1.6 it did this same general packaging thing. It had a mac app-in-a-dir style Contents and then the java standard layout and these 2 layouts were maintained via symlinks and - I thought - binary hardlinks, although perhaps the Contents binaries were - as here - slightly different. |
Any news on this? Not being able to run a CI locally is getting to be a hassle... |
Note that this should be easy to workaround on a case by case basis. Install your own python2.7 whether by compiling the distribution tarball yourself, using https://github.com/yyuu/pyenv or brew or what have you and placing this at the head of your PATH. |
That has always been my state:
As far as it's up to me, I only use brew python. |
This makes little sense to me then. Your sys.executable should be a brew one then which should have a sane binary path to do comparisons against. |
My pants binary does indeed run on the brew python. However PythonTask.select_interpreter() is choosing the system one to actually run the tests on. Investigating further. |
This is because PythonInterpreterCache.select_interpreter() returns the interpreter with min(compatibilities), which is the system 2.7.5, not the brew 2.7.6. So pytest executes tests on the system 2.7.5, which is what test_test_builder.py then sees. |
I have been hitting this myself. I didn't realize it was a larger issue and had been running the CI on a totally separate box. All tests pass until the interpreter cache near the end. My OSX machine is getting its backlight repaired but I will report my state early next week. |
Re-discovered in #1908 if I'm not mistaken. I think this was solved when we upgraded to pex 1.0.3 which has this fix for pex-tool/pex#144 for OSX 'Python' (vs 'python') which would previously lead to missed interpreters. |
Reproduces (at least on some OS X systems) with:
PANTS_DEV=1 ./pants goal test tests/python/pants_test/backend/python:test_builder
The problem manifests here.
sys.executable is:
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
And the interpreters available in the interpreter cache are:
So there's no string match.
However note that, although you might reasonably think that the second interpreter in the cache is just a symlink to sys.executable, they are actually different inodes of files with different md5sums.
The text was updated successfully, but these errors were encountered: