From 3892f516ca7362919a94f226c1c8ede1161b3ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 12 Oct 2011 14:20:02 +0000 Subject: [PATCH] doc: Write "Building from the Command Line". --- doc/manual/projects.xml | 65 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/doc/manual/projects.xml b/doc/manual/projects.xml index a954efb9..886a65d1 100644 --- a/doc/manual/projects.xml +++ b/doc/manual/projects.xml @@ -353,15 +353,66 @@ in
- Building on the Command Line + Building from the Command Line -Overigens zijn die helemaal niet Hydra-specifiek, je kunt ze gewoon vanaf de -command line bouwen, bijv. als je een patchelf checkout hebt (met een nixpkgs -checkout in ../nixpkgs): + + It is often useful to test a build recipe, for instance before + it is actually used by Hydra, when testing changes, or when + debugging a build issue. Since build recipes for Hydra jobsets + are just plain Nix expressions, they can be evaluated using the + standard Nix tools. + - -$ nix-build release.nix -A rpm_fedora10i386 - + + To evaluate the tarball jobset of , just run: + + + $ nix-build release.nix -A tarball + + + However, doing this with as is will + probably yield an error like this: + + + error: cannot auto-call a function that has an argument without a default value (`nixpkgs') + + + This is because no value was specified for the + nixpkgs argument of the Nix expression. + + + + This is fixed by providing a default value for that argument in + the Nix expression, which will allow nix-build + to auto-call the function: instfead of writing { nixpkgs + }:, we now write { nixpkgs ? <nixpkgs> + }:. What it means is that, by default, the + nixpkgs variable will be bound to the absolute + path of any nixpkgs file found in the Nix + search path. Similarly, a default value for + helloSrc needs to be provided. + + + + Thus, assuming a checkout of Nixpkgs is available under + $HOME/src/nixpkgs, the + tarball jobset can now be evaluated by running: + + + $ nix-build -I ~/src release.nix -A tarball + + + Similarly, the build jobset can be evaluated: + + + $ nix-build -I ~/src release.nix -A build + + + The build job reuses the result of the + tarball job, rebuilding it only if it needs to. + +