[Python-Dev] Python startup time

Nathaniel Smith njs at pobox.com
Wed May 2 13:55:53 EDT 2018


On Wed, May 2, 2018, 09:51 Gregory Szorc <gregory.szorc at gmail.com> wrote:

> Correct me if I'm wrong, but aren't there downsides with regards to C
> extension compatibility to not having a shared libpython? Or does all the
> packaging tooling "just work" without a libpython? (It's possible I have my
> wires crossed up with something else regarding a statically linked Python.)
>

IIRC, the rule on Linux is that if you build an extension on a statically
built python, then it can be imported on a shared python, but not
vice-versa. Manylinux wheels are therefore always built on a static python
so that they'll work everywhere. (We should probably clean this up upstream
at some point, but there's not a lot of appetite for touching this stuff –
very obscure, very easy to break things without realizing it, not much
upside.)

On Windows I don't think there is such a thing as a static build, because
extensions have to link to the python dll to work at all. And on MacOS I'm
not sure, though from knowing how their linker works my guess is that all
extensions act like static extensions do on Linux.

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180502/a33dc6b7/attachment-0001.html>


More information about the Python-Dev mailing list