To build for very old glibc
targets (e.g. arm
NAS with glibc
versions as old as 2.17
) I’m using custom build containers based on very old debian
and ubuntu
images that are selected specifically for their glibc
version. The building of these images is tedious, inconsistent and error-prone, because for some deps they need to include updated versions of e.g. gcc
and openssl
, that need to be built from source, because they are not available via apt
(backports).
I’m using buildah
with Makefile
and custom builder sh scripts to build the images, but for most arch/glibc
pairs I need specific workarounds, so it’s kind of cumbersome.
I recently had a great experience building a very specific build image in a devShell
flake, i.e. get an image that has similar inputs as the devShell and will therefore behave the same in a CI as in a dev env, and as a workflow I find this very attractive.
So my thought was whether it could be at all possible to build the above mentioned images leveraging nix
, but with Nix Package Versions it doesn’t nearly go back far enough.
So the next possibility could be to “just” override the versions of packages in an overlay (and especially the components of stdenv
(and use qemu
for non-native archs), but given the notorious difficulty of bootstrapping old glibc
this is probably doomed to fail?
Or is it?
Any informed opinions?