[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 09:12:04 UTC 2017


On 27 April 2017 at 09:41, Luke Gorrie <luke at snabb.co> wrote:

> On 27 April 2017 at 09:22, Luke Gorrie <luke at snabb.co> wrote:
>
>> How to run the build including all tests in VMs (go for lunch the first
>> time you run it...):
>>
>
> ... if you really want to run this then it's probably worth giving e.g.
> '-j 10' to nix-build to parallelize downloads and execution, and also to
> test from the stable branch of nix instead of the master branch (git
> clone -b 1.11-maintenance ...).
>

I actually ran the nix build process now for the first time myself :).

Observations:

By default it builds for Linux-i386, Linux-x86-64, and Darwin-x86-64. These
platforms are all available in the CI but probably not on your local
machine. So could pick a specific attribute to build e.g. '-A
deb_ubuntu1604i386' at the end of the nix-build command.

Interesting that to setup the VMs it actually _bootstraps_ nearly a dozen
Linux distributions e.g. downloads the individual '.deb' files for an
Ubuntu release and creates an image using 'debootstrap' with exactly the
packages that the test suite wants. They could have otherwise taken a
ready-made image from the vendor (with verified sha256 hash) but the
bootstrapping seems to allow a lot of control over the build/runtime
environment for a test case.

Interesting that my machine is actually performing the bootstrapping of
these images. In principle it could just download the cached image from the
Nix CI because the builds are referentially transparent. I suppose that
those binaries are not available, probably because the stable version of
nix was built a ways back and its intermediate build/test artefacts have
been garbage collected on the CI server. So they are built locally on my
machine instead (and then cached until I clear them out here with
'nix-collect-garbage'.)

After all the downloading and building it does work for me and produce
packages:

$ nix-build -j 10 -I nixpkgs=$pkgs nix/release.nix -A deb_ubuntu1604i386
... lots of activity bootstrapping an ubuntu VM, etc...
$ ls result/debs/
nix_1.11.9pre1234-abcdef-1_i386.deb
$ file result/debs/nix_1.11.9pre1234-abcdef-1_i386.deb
result/debs/nix_1.11.9pre1234-abcdef-1_i386.deb: Debian binary package
(format 2.0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170427/9215fbbc/attachment-0001.html>


More information about the Vm-dev mailing list