https://pantsbuild.org/ logo
h

high-yak-85899

04/24/2023, 9:05 PM
Does pex do anything special on startup that would make
.so
files importable? My thinking is "no" since this stuff worked before we were using pants so perhaps there's some kind of venv setup that makes that magic happening.
We're using pex to ship off first and third party code to a separate system, but not to actually run it (for reasons). I'm getting some errors importing
.so
files on the destination system and trying to figure out how all that just works.
e

enough-analyst-54434

04/24/2023, 9:14 PM
A standard PEX unzips itself on 1st execute so that all .py and .so are loose on the filesystem. A venv PEX installs itself in a traditional venv on 1st use, and so similarly has loose .py and .so
You want a venv PEX for all cases except where 1st cold start perf is critical. A venv PEX is faster in all other cases and more compatible.
If you are using a container image you remove the cold start penalty by either running the venv PEX once noop, or better, using
PEX_TOOLS=1 the.pex venv right/here
to pre-install the venv.
h

high-yak-85899

05/04/2023, 5:50 PM
I figured out what this was. I had a wheel compatible for python 3.8 and was running it with python 3.10. I'm kind of abusing pex to be a packager instead of handling running my app for some reasons.