pex icon indicating copy to clipboard operation
pex copied to clipboard

Support for pex in zip hostile environments.

Open hrfuller opened this issue 5 years ago • 0 comments

There are certain environments where it would be useful to use pex to bundle applications, but which need the entrypoint of pex to be the real __main__ module. For instance if an application running in a pex wants to pickle itself, to support remotely executing code in the pex, an application that is gaining popularity due to ubiquity of cloud environments, and libraries that try to seamlessly link local and remote execution. @jsirois suggested calling these types of applications zip hostile.

A possible solution to this incompatibility would be to add a new execution time flag (and environment variable) to make pex completely unzip itself, including pex bootstrapping code, and have the pex bootstrapper re-exec itself as a python process using the module specified as the entrypoint as the main module. This style of pex execution would be essentially identical to running source files locally, and therefore should perform like non-pex'ed applications.

hrfuller avatar Feb 28 '20 19:02 hrfuller