https://pantsbuild.org/ logo
#general
Title
# general
s

strong-refrigerator-32393

08/26/2022, 6:45 PM
One question, I have the following problem. I am not sure the best way to solve it so maybe someone has an idea. I have created a docker image, the main app of this image is packaged as pex. However, the environment where it will run only has a python interpreter different from my local version, this causes my packaged version to fail. Is there a way to create my pex so that it can be run in a different interpreter from where I compile the pex?
h

hundreds-father-404

08/26/2022, 6:46 PM
a

ancient-france-42909

08/26/2022, 6:47 PM
That’s so painful to use. Not only does it require you to specify everything, but it has to be done for every pex_binary.
in hopefully 2.15, you can tell Pants to do a build like
pex_binary
via Docker
🙏 1
a

ancient-france-42909

08/26/2022, 6:56 PM
But you still need to set it per BUILD file, if I’m not missing something? (re
__defaults__
)
h

hundreds-father-404

08/26/2022, 6:56 PM
you don't, defaults applies to the whole subtree of BUILD files
a

ancient-france-42909

08/26/2022, 6:57 PM
Okay, so we have to put
BUILD
file in the root, got it. “current subtree” was the bit I missed, thanks
h

hundreds-father-404

08/26/2022, 6:57 PM
you can put it in the root, or wherever makes sense. i'm expanding the docs at https://github.com/pantsbuild/pants/pull/16377
a

ancient-france-42909

08/26/2022, 6:58 PM
We’re probably not going to be using this, as there’s no way to build multiarch docker images anyway, and our PEX files are already absolutely monstrous.
But we did consider it 🙂
h

hundreds-father-404

08/26/2022, 6:59 PM
a

ancient-france-42909

08/26/2022, 7:00 PM
Using
platforms
to build multiarch images.
We’d need to have two jobs for packaging anyway, so there’s no benefit to bloating the pex files
Or, well, three jobs 😞