Build against an older libc, keep the newest in the runtime closure #303405
Labels
6.topic: architecture
Relating to code and API architecture of Nixpkgs
6.topic: cuda
Parallel computing platform and API
Issue description
Libc and libstdc++ compatibility is a dominating factor in how severe is the effect of allowing impure dependencies such as OpenGL, OpenCL, Vulkan, or CUDA drivers. Ultimately, the heuristic is: build against the oldest library you can, load the most recent at runtime. This practice is widely followed in other distributions and is important e.g. for the "manywheel" standard in python packaging.
Currently, Nixpkgs pins a single fairly recent version of glibc and builds every package against that. A suggestion that has been at least occasionally voiced is to invest time in "making [OpenGL] binaries less demanding in regards to the glibc version"1.
Forgetting about maintenance costs for a moment, one can also see it would benefit downstream applications to start generally tracking each package's lowest compatible glibc - by building against it -, while ensuring that only one version - the newest - is ever referred to in runtime closures. For example, if such a mechanism were in place it would've been "trivial" to use Nix to create "manywheel" releases of python packages.
It would be (?) a reasonable starting point to implement an easy to use
stdenvAdapters
-like mechanism for separating the lib(std)c(++) used at build time from the one recorded in finalRUNPATH
s,LD_LIBRARY_PATH
s,ld.so.cache
-s, etc. We can test such mechanism by first applying it to our impure driversEDIT(2024-08-12): Apparently there's also the matter of which
ld.so
to use:Footnotes
https://discourse.nixos.org/t/help-understanding-the-libgl-abi-problem-and-possible-solutions/42022/21 ↩
The text was updated successfully, but these errors were encountered: