chevah / pythia

Chevah's Python 3 distribution
MIT License
4 stars 2 forks source link

Try building Python statically on Linux. #65

Open dumol opened 1 month ago

dumol commented 1 month ago

Currently, Linux packages are built against either glibc or musl libc libraries.

Building statically against the libc library would have two main benefits:

  1. only one Linux package for arch
  2. a more modern toolchain could be used for building (currently we build on Amazon Linux 2 for glibc-based distributions).

Starting point: https://wiki.python.org/moin/BuildStatically.

Other pointers:

adiroiban commented 1 month ago

I am not sure if having static glibc on Alpine / musl does not defeat the purpose of having a musl based environment in the first place.

Also... we need to see the depenencies between linux kernels and glibc / musl versions

dumol commented 1 month ago

A more powerful way, which would also enable easy cross-compiling: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html

dumol commented 1 month ago

I am not sure if having static glibc on Alpine / musl does not defeat the purpose of having a musl based environment in the first place.

Was actually thinking of building statically against musl, which seems to be more straightforward. Building statically against glibc is frown upon, I remember this: https://stackoverflow.com/questions/57476533/why-is-statically-linking-glibc-discouraged