pex_binary package fails. I can’t figure out how t...
# general
b
pex_binary package fails. I can’t figure out how to deal with it by looking at the error log. it could be a problem with platforms=linux-x86_64-cp-38-cp38, but I verified it in a macos environment and it installed correctly. It would be very helpful to know how to respond and investigate. https://github.com/pantsbuild/pants/issues/16055
e
The easiest way to debug is to use Pex directly on the same requirements / interpreter constraints. I'll take a look here and see what I can see. Thanks for the details in the issue.
b
Thank you for your help!
e
OK - root issue answered in https://github.com/pantsbuild/pants/issues/16055 - I'm still looking at the form of the error message you got though when not enabling resolves (lock files) - that message is very confusing. In short, you're trying to build a Linux platform PEX on a Mac and one of your project dependencies (termcolor 1.1) is only available as a source distribution. All dependencies must be available as pre-built wheels when building a PEX for a foreign platform like you are. The answer here is generally to pre-build the wheels you need by hand and place them in a custom find-links repo you configure Pants to look at with
[python-repos] repos = ["..."]
. See: https://www.pantsbuild.org/docs/reference-python-repos#section-repos But please speak up if you need more guidance dealing with sdist-only distirbutions like this for your
pex_binary(platforms=[...])
targets.
b
I will comment on Issue, but thanks for the details. I will think of a way to deal with this since the development environment is often mac and the production environment is linux. it seems that it would be better to Build Docker with only CI for the linux environment, without specifying the platform. Thanks for your help.