Best method of deployment for cross-distro linux



  • So I've got a bit of a problem with distributing software for Linux which I'd like some advice with. At the moment I am statically compiling Qt and linking with system libraries statically - this works fine for older distros but on newer distros is segfaulting due to using getaddrinfo with a problem in some internal libnss (systemd) function call. So then I went back to compiling Qt statically and linking against every other library dynamically but this is even worse and will only run on the system that compiled it, absolutely no other distro will run it (I'm including all the linked libraries and testing with LD_LIBRARY_PATH=/tmp/test ./test) it immediately segfaults, in fact I can't do anything with this with this LD_LIBRARY_PATH, gdb/ldd/everything segfaults which is caused by the libc.so file (if I remove that it stops the segfaulting but the software is entirely useless because it needs a newer libc file).

    So what options do I have for this? Dynamic linking is fine just so long as it actually works without segfaulting. I'm half annoyed that the systemd team can't be bothered to fix their code/system and just insist that it's the users fault when it's quite clearly entirely their fault.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If possible, you should rather consider providing packages for the distributions you plan to support.



  • It's not really feasible to do that as for example there's multiple versions of debian, ubuntu, fedora, suse, etc. so in order to have that covered there would need to be at least 10 VMs to compile on, 10 packaging scripts/systems, then another 10 for testing and any other distros wouldn't be supported whereas at the moment there's one VM to compile on and a handful of VMs to test on so that one package can be installed on any of those distros and for the majority it will work.
    I'm currently looking at abandoning the build system that has systemd and from a quick test yesterday compiling Qt statically and linking the application dynamically then copying all the file over seems to work on the newer systems flawlessly - no getaddrinfo() crash, so I'll probably have a look at compiling everything statically on these systems and see how they run.


  • Lifetime Qt Champion

    AFAIK, a Debian recipe is valid for the variants of that distribution too.

    In any case, flatpak might be of interest.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.