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

Python's venv library bypasses the exodus wrapper #63

Open
bhilton opened this issue Feb 22, 2021 · 2 comments
Open

Python's venv library bypasses the exodus wrapper #63

bhilton opened this issue Feb 22, 2021 · 2 comments

Comments

@bhilton
Copy link

bhilton commented Feb 22, 2021

Python's venv creation code bypasses the exodus wrapper, which results in the real Python binary being called directly.

Here's the relevant code: https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L117

Has anyone found a solution for using exodus with applications that follow this pattern? I haven't been able to come up with a workable solution. Even hacking this particular file still doesn't solve the issue, as pip itself seems to do something similar when launching subprocesses.

@sangaline
Copy link
Member

Could you share a few more details about what you're trying to do? Are you trying to create a virtualenv using a version of Python that was bundled using Exodus, or to bundle a script that runs locally in a virtualenv with the necessary dependencies? Bundling something as complex as Python is definitely pushing the boundaries of what Exodus can do, but it might be possible depending on the exact use-case.

@bhilton
Copy link
Author

bhilton commented Feb 27, 2021

The former - trying to create a virtualenv using a version of Python that was bundled using Exodus. It works surprisingly well, aside from some behavior in Python's venv and pip libraries. They launch sub-processes and seem to resolve the executable to Python itself instead of the exodus wrapper.

Apart from that, everything works as expected. I'm able to import C-libs from Python's ssl, kerberos, and other extensions with C library dependencies. I can build on Ubuntu 20.04 and run it inside a vanilla CentOS 6 docker container, which was my initial goal.

If you have any ideas for how to overcome Python's behavior it would be welcome. Thanks for your reply!

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

No branches or pull requests

2 participants