exodus icon indicating copy to clipboard operation
exodus copied to clipboard

Python's venv library bypasses the exodus wrapper

Open bhilton opened this issue 3 years ago • 2 comments

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.

bhilton avatar Feb 22 '21 00:02 bhilton

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.

sangaline avatar Feb 27 '21 17:02 sangaline

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!

bhilton avatar Feb 27 '21 22:02 bhilton