[Vm-dev] nix based build system (was problem with configure and libGL on CentOS 6.5)

Luke Gorrie luke at snabb.co
Thu Apr 27 07:22:21 UTC 2017


On 27 April 2017 at 05:40, Ben Coman <btc at openinworld.com> wrote:

> @Luke, how would you rate the feasibility of a binary built on nix
> being packaged for other linux distributions?
>

Could be instructive to check out how nix itself is built and distributed.
They have a nix expression that builds nix (a C++ application), creates
binary tarball/deb/rpm packages for multiple architectures, and tests each
one in a virtual machine running the appropriate Linux distro.

Code:
https://github.com/NixOS/nix/blob/master/release.nix

Products (via CI):
http://hydra.nixos.org/eval/1353208

How to run the build including all tests in VMs (go for lunch the first
time you run it...):

$ git clone https://github.com/nixos/nix
# Pin the exact same toolchain version as the Nix CI uses
$ pkgs=
https://github.com/nixos/nixpkgs-channels/archive/05db33f79b8b012107bab29e47f27ce3b8aa4aca.tar.gz
$ nix-build -I nixpkgs=$pkgs nix/release.nix

Could work for Pharo too? Guessing there are a lot of potential pitfalls
with the configure script reporting aspects of the build environment that
don't match the target environment, but since you guys are already
distributing binaries you have probably dealt with those already. The only
extra step would be a 'patchelf' command to set the dynamic library paths
the way you want them to point (as Alistair is doing for the Pharo "Snap"
package.)

(My own experience is that distributing binaries for Linux is a hard
problem, even getting glibc to link is fraught with symbol versioning
leakage and so on, but guessing you guys know much more about this than I
do and that Nix is one of the best tools for the job.)

P.S. Great nix paper: Automating System Tests using Declarative Virtual
Machines <https://nixos.org/~eelco/pubs/decvms-issre2010-final.pdf>.
Explains their approach to CI. Seems to work well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170427/903ac48f/attachment.html>


More information about the Vm-dev mailing list