https://pantsbuild.org/ logo
w

worried-painter-31382

08/31/2022, 4:44 PM
Is there some obvious way to find out which platform my
pex_binary
is built to target? I missed that they are built to target the current host machine and have some issues with docker builds and the fact some of our devs use macos.
I tried with linux_x86_64-cp-3.10.2-cp310 (cpython 3.10.2 is our python version) and the
resolve_local_platforms
set to true but that fails with packages missing wheels, while omitting works on ubuntu 20.04
Or even better, could the pex be built inside a docker container?
e

enough-analyst-54434

08/31/2022, 4:57 PM
using platforms or complete_platforms requires, when you're not actually on that platform, that pre-built wheels for the targeted platform are available. So you have to pre-build them on that platform, say via
Copy code
$ /that/platform/python -mvenv wheel-build
$ wheel-build/bin/pip wheel ...
And then make the wheels available via a custom find-links repo and tell Pants about that repo using: https://www.pantsbuild.org/docs/reference-python-repos#section-repos
Or even better, could the pex be built inside a docker container?
Many Pants maintainers are a bit heads-down at the moment working on exactly that feature.
1
❤️ 1
w

worried-painter-31382

08/31/2022, 5:02 PM
Awesome, is there an issue I could watch on gh?
e

enough-analyst-54434

08/31/2022, 5:05 PM
h

hundreds-father-404

08/31/2022, 5:07 PM
and one of the key tickets is https://github.com/pantsbuild/pants/issues/7735, which is how you can specify different environments for localhost vs docker image etc, like environment variables and executable search paths. Design doc at https://docs.google.com/document/d/1vXRHWK7ZjAIp2BxWLwRYm1QOKDeXx02ONQWvXDloxkg/edit?usp=sharing and feedback definitely welcomed
4 Views