To test the compatibility of binaries I want to distribute with other (older) linux systems (mostly FHS based, but also “the other way around”: i.e. my gitlab-runner is on Arch, and I want to run/test on nixos), I’m trying to use an fhsnix-shell like this one:
glibc has very high compatibility assurance but only for upgrades. If you try running stuff with older glibc than what you used during build, you’ll often run into problems with missing symbols.
Maybe my description was a bit convoluted, but that’s exactly the point:
I want my binaries to be compatible with older systems, so I want to build them on an old glibc, which I will do in my CI in containers (either on nixos or other).
I then want to test (on nixos) whether indeed the binaries can be run on old glibc environments and newer, so I want to specifically use old glibc-based shell envs.
The issue came up in the first place because my stable nixos had a glibc-2.31 and my CI (up-to-date Arch linux) built my binary on glibc-2.32, which I then couldn’t run on my nixos machine. So I realised that I had to build my binaries on “relatively old” glibc’s for max compatibility.
As a side-note, in this case we’re talkin a flutter-desktop app, so there are a few more deps there.
Ah, I somehow thought the FHS was consumer of the builds, not producer. Another point to think about are any other dependencies/libraries, too. They tend to be more sensitive to correct version than glibc. (In particular, major version changes are usually a problem, even if it’s an upgrade.)
Generally, if you want binaries for a particular (old) system, I would use that system’s tools/libs/etc. to build them. People often use docker or LXC for that with the particular distro inside, as that approach gives quite good tradeoffs.
Thanks again for the quick reply, let me clarify a bit more
I want to build them on an old glibc , which I will do in my CI in containers (either on nixos or other).
I.e. the build is de-facto done on older glibc (native FHS (Arch), nixos, or container (FHS))
The test or run of the binary (built on another system) I want to do on nixos, in differentglibc versions.
For this I want to use fhs shell, but it doesn’t work as expected, because it crashes most programs.
What I seek is a solution to the fhs shell not working as expected, it basically segfaults on any call, even simple ones like which bash.
One more reason to want a working fhs shell is that I’d like to easily be able to run things like a flutter environment that is installed in the official way (e.g. in ~/devel/flutter) and uses vanilla install scripts that rely on FHS.)