Skip to content
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

Pex discards the current interpreter's PATH entry when it is a directory entry. #1109

Closed
jsirois opened this issue Nov 10, 2020 · 0 comments · Fixed by #1110
Closed

Pex discards the current interpreter's PATH entry when it is a directory entry. #1109

jsirois opened this issue Nov 10, 2020 · 0 comments · Fixed by #1110
Assignees
Labels

Comments

@jsirois
Copy link
Member

jsirois commented Nov 10, 2020

This means no other interpreters in the current interpreter's directory (sibling interpreters) can be found. This is an egregious problem since interpreters are commonly installed to /usr/bin; i.e.: /usr/bin/python2.7, /usr/bin/python3.6, ... etc will all be siblings and if a PEX is run with any one of them, the others won't be discoverable.

N.B.: Pex only encounters this condition when PEX_PYTHON_PATH / --python-path are used, populating the path function parameter below:
https://github.com/pantsbuild/pex/blob/93b0442c9574a0bba018249d842dc2ac29dc1e27/pex/pex_bootstrapper.py#L40-L45

And the bug is here where we remove both the interpreter binary path (which is ok) and the interpreter binary directory (which is the bug):
https://github.com/pantsbuild/pex/blob/93b0442c9574a0bba018249d842dc2ac29dc1e27/pex/pex_bootstrapper.py#L83-L89

@jsirois jsirois added the bug label Nov 10, 2020
@jsirois jsirois self-assigned this Nov 10, 2020
jsirois added a commit to jsirois/pex that referenced this issue Nov 10, 2020
Previously, if the current interpreter was valid and contained in a
path directory entry, all sibling interpreters in that same directory
went undiscovered. A test is added that fails without the fix.

Fixes pex-tool#1109
jsirois added a commit that referenced this issue Nov 10, 2020
Previously, if the current interpreter was valid and contained in a
path directory entry, all sibling interpreters in that same directory
went undiscovered. A test is added that fails without the fix.

Fixes #1109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant