about summary refs log tree commit diff
path: root/doc/manual/expressions/debug-build.xml
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-16T12·13+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-16T12·13+0200
commitf0ef6b74b93344798e44c6dc527f88a78b75a32f (patch)
tree8975a82b25a4410e2fc36e80cc042d74675396d7 /doc/manual/expressions/debug-build.xml
parent67e5dd3ce9f46f810c06e16671e98f8e56b4e25c (diff)
parent8901acc97664aa8ebf687ee904428aa57a5192be (diff)
Merge branch 'master' of github.com:thatdocslady/nix
Conflicts:
	doc/manual/release-notes.xml
	doc/manual/writing-nix-expressions.xml
Diffstat (limited to 'doc/manual/expressions/debug-build.xml')
-rw-r--r--doc/manual/expressions/debug-build.xml33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/manual/expressions/debug-build.xml b/doc/manual/expressions/debug-build.xml
new file mode 100644
index 000000000000..508cb2c1930e
--- /dev/null
+++ b/doc/manual/expressions/debug-build.xml
@@ -0,0 +1,33 @@
+<section xmlns="http://docbook.org/ns/docbook"
+      xmlns:xlink="http://www.w3.org/1999/xlink"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      version="5.0"
+      xml:id="sec-debug-build">
+
+<title>Debugging Build Failures</title>
+
+<para>At the beginning of each phase, the set of all shell variables
+is written to the file <filename>env-vars</filename> at the top-level
+build directory.  This is useful for debugging: it allows you to
+recreate the environment in which a build was performed.  For
+instance, if a build fails, then assuming you used the
+<option>-K</option> flag, you can go to the output directory and
+<quote>switch</quote> to the environment of the builder:
+
+<screen>
+$ nix-build -K ./foo.nix
+... fails, keeping build directory `/tmp/nix-1234-0'
+
+$ cd /tmp/nix-1234-0
+
+$ source env-vars
+
+<lineannotation>(edit some files...)</lineannotation>
+
+$ make
+
+<lineannotation>(execution continues with the same GCC, make, etc.)</lineannotation></screen>
+
+</para>
+
+</section>
\ No newline at end of file