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

Add the ability to include extensions & shared libraries in pexs. #166

Closed
wants to merge 1 commit into from
Closed

Add the ability to include extensions & shared libraries in pexs. #166

wants to merge 1 commit into from

Conversation

rouge8
Copy link
Contributor

@rouge8 rouge8 commented Oct 7, 2015

Extensions already (sort-of) worked via add_source - this makes sure that when adding a .(so|dll|pyd), we force zip_safe to False.

In addition this adds the ability to include other shared libraries with the pex. This is intended to be used for dependencies of the python extensions (e.g. a cityhash extension will depend on a cityhash library).

This is an updated version of #61.

@rouge8 rouge8 mentioned this pull request Oct 7, 2015
@wickman
Copy link
Contributor

wickman commented Oct 7, 2015

pex adheres to what's in the standard lib and in PEPs. My reluctance with this feature is that we're going out of the bounds of the python spec and more into the realm of cx_Freeze and p2app, which is a slippery slope of elaborate hacks to make stuff work when we already have ubiquitous solutions for managing dependencies holistically: docker, appc, etc.

It feels like this feature could be a wrapper around pex rather than baked into pex itself, where the wrapper is either heavyweight (docker) or lightweight (walk the pex, introspect the necessary .dylib/.so via something like pyelftools, and construct a shar or zip that sets up the path and execve's the pex.)

@rouge8
Copy link
Contributor Author

rouge8 commented Oct 7, 2015

The PyPy tests pass for me locally with PyPy 2.6.1, which makes me suspect they're failing on Travis from the older PyPy...

@mikekap
Copy link
Contributor

mikekap commented Oct 14, 2015

FYI one way to fix this (as is done at facebook/buck@f485090) - add an -rpath @loader_path/ (or -rpath $ORIGIN/ on linux) to your .so when linking. Then set zip_safe=False and everything should work :).

Extensions already (sort-of) worked via add_source - this makes sure that when adding a .(so|dll|pyd), we force zip_safe to False.
In addition this adds the ability to include other shared libraries with the pex. This is intended to be used for dependencies of the python extensions (e.g. a cityhash extension will depend on a cityhash library).
@jsirois jsirois closed this Mar 18, 2021
@jsirois jsirois deleted the branch pex-tool:master March 18, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants