astral-sh / astral-sh/python-build-standalone

Restore shared extension module and/or dependency libraries

Open
#227 3 comments 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
4.4k
Forks
314
Avg merge
1d 9h
Merged PRs (30d)
27

Description

This project was created in support of PyOxidizer. And a goal of PyOxidizer was to see if it was possible to achieve a single file executable Python application.

In order to achieve that goal, this project built highly statically linked Python distributions.

On Linux and macOS, extension modules are statically linked into libpython. And 3rd party library dependencies of extension modules (OpenSSL, SQLite, etc) are also statically linked into libpython.

This mostly _just works_. Until it doesn't.

For example, ELF symbols resolution prefers symbols in the global namespace over a local namespace. So if you load a .so providing symbol `foo` which is also provided by an external `libpython.so`, the `libpython.so` symbol is used. This leads to wonkiness like https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#static-linking-of-libx11-incompatibility-with-pyqt-on-linux.

As the Python distributions in this project have grown a life outside of PyOxidizer, the opinionated choice of statically linking all extension modules and shared libraries is hard to justify. We're foregoing compatibility with aspects of the larger Python ecosystem.

So I'm proposing that we revert to distributing 3rd party libraries and extension modules as shared libraries.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.