<Comment on #2120 Generated Pex File works on some...
# github-notifications
c
Comment on #2120 Generated Pex File works on some hosts, not others Discussion answered by jsirois Ok, that is a pretty naive command as it stands. You nowhere nail down the Python(s) you're building for. That is done with
--python
or `--complete-platform` (
--platform
is a lossy version of
--complete-platform
that should probably be avoided). So, what you get now is the PEX will only guaranteed-work for the Python that hosts the
pex
console script on then machine you build the PEX file on (and the associated glibc version). To see more what is going on try
unzip -qc ./bin/my-product.pex PEX-INFO | jq .
(or build your PEX file with
--include-tools
or
--venv
and use
PEX_TOOLS=1 ./bin/my-product.pex info --indent 2
). You'll see a map of
distributions
that represent all the ~wheels your PEX file carries. If you pass multiple
--python
or
--complete-platform
or a mixture, you'll likely see many variants for a given platform-specific wheel to satisfy each of those. At runtime, just the right subset is activated. The activation works by matching wheel tags (and looking at Requires-Python wheel METADATA as well as environment markers). If you're not familiar with wheel tag matching, see these PEPs for a start: • https://peps.python.org/pep-0425/https://peps.python.org/pep-0600/ For Requires-Python see: https://peps.python.org/pep-0345/#requires-python For environment markers see: https://peps.python.org/pep-0508/#environment-markers pantsbuild/pex