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

brave-hair-402

04/26/2023, 9:11 AM
I was reading the pantsbuild blog, and noticed the post on internal python interpreter (https://blog.pantsbuild.org/two-hermetic-pythons/). I was interested in how I can build docker images that use the pants-provided python interpreter; that is, does not rely on the existence of a compatible interpreter on the docker base image. Is there any documentation on that?
e

enough-analyst-54434

04/26/2023, 11:32 AM
There are two things required for compatibility, the right Python major.minor, which you could get via a pre-built Python Build Standalone Linux binary like we do, and a compatible glibc. If you have the former but not the latter and your 3rd party dependencies include C extensions (platform specific wheels) you can still suffer incompatibility errors. See: https://peps.python.org/pep-0600/#specification
That is, I assume your intention is to have your first party python code just work on the image and that goal is inextricably linked to the glibc installed in the image if you rely on any third party python code with C extensions.
b

brave-hair-402

04/26/2023, 12:22 PM
Thank you. That clears this up for me.
2 Views