Hacker News new | ask | show | jobs
by burntsushi 3452 days ago
Can you compile a completely static executable and ship that? Or do you need to compile on distributions as old as RHEL 5?
1 comments

It needs to compile (at least the C or C++ parts). Frequently the people who operate the software will want to make small changes.
I know from experience that it is possible to build Rust binaries that work on very old Linux versions. You could for example supply them with a Docker image with a new build stack which can produce binaries they could copy to the old machines. The same is likely true for Go.
Unfortunately docker couldn't be used on RHEL5, it requires 3.10 or newer. But a disk image/qemu could work.
You can just give a chroot. At a company I used to work for, our build system used a chroot with a bunch of rarely-changing binaries/headers that let us build binaries for old distros, and then the directory with the actual code you were working on got bind-mounted into that chroot. The build process didn't depend on anything at all from the host system except for the build tool itself that set up the chroot environment. Everything to actually do the build (compiler, headers, utilities) lived in source control and was put into the build environment from there, so builds were 100% reproducible.