<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 27 April 2017 at 05:40, Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>@Luke, how would you rate the feasibility of a binary built on nix </div></div><div>being packaged for other linux distributions?</div></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>Code:</div><div><a href="https://github.com/NixOS/nix/blob/master/release.nix">https://github.com/NixOS/nix/blob/master/release.nix</a></div><div><br></div><div>Products (via CI):</div><div><a href="http://hydra.nixos.org/eval/1353208">http://hydra.nixos.org/eval/1353208</a></div><div><br></div><div>How to run the build including all tests in VMs (go for lunch the first time you run it...):</div><div><br></div><div><span style="font-family:monospace,monospace">$ git clone <a href="https://github.com/nixos/nix">https://github.com/nixos/nix</a></span><br></div><div><span style="font-family:monospace,monospace"># Pin the exact same toolchain version as the Nix CI uses</span></div><font face="monospace, monospace">$ pkgs=<a href="https://github.com/nixos/nixpkgs-channels/archive/05db33f79b8b012107bab29e47f27ce3b8aa4aca.tar.gz">https://github.com/nixos/nixpkgs-channels/archive/05db33f79b8b012107bab29e47f27ce3b8aa4aca.tar.gz</a><br>$ nix-build -I nixpkgs=$pkgs nix/release.nix</font></div><div class="gmail_quote"><font face="monospace, monospace"><br></font></div>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.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">(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.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">P.S. Great nix paper: <a href="https://nixos.org/~eelco/pubs/decvms-issre2010-final.pdf">Automating System Tests using Declarative Virtual Machines</a>. Explains their approach to CI. Seems to work well.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>