doc: Add "Running Guix Before It Is Installed".
authorLudovic Courtès <ludo@gnu.org>
Sat, 23 May 2015 13:55:08 +0000 (15:55 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sat, 23 May 2015 13:57:18 +0000 (15:57 +0200)
* doc/guix.texi (Running Guix Before It Is Installed): New node.
  (Packaging Guidelines): Refer to it.

HACKING
doc/guix.texi

diff --git a/HACKING b/HACKING
index e8f6cc4..cf10ba5 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -2,7 +2,7 @@
 
 #+TITLE: Hacking GNU Guix and Its Incredible Distro
 
-Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 Copyright © 2014 Pierre-Antoine Rault <par@rigelk.eu>
 
@@ -46,17 +46,7 @@ take a look at “info '(guix) Installation'” or send a message to
 
 * Running Guix before it is installed
 
-Command-line tools can be used even if you have not run "make install".
-To do that, prefix each command with ‘./pre-inst-env’, as in:
-
-  ./pre-inst-env guix build --help
-
-Similarly, for a Guile session using the Guix modules:
-
-  ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
-
-The ‘pre-inst-env’ script sets up all the environment variables
-necessary to support this.
+See the same-named section in the manual.
 
 * The Perfect Setup
 
index 1d882af..cfb626c 100644 (file)
@@ -88,6 +88,7 @@ Installation
 * Running the Test Suite::      Testing Guix.
 * Setting Up the Daemon::       Preparing the build daemon's environment.
 * Invoking guix-daemon::        Running the build daemon.
+* Running Guix Before It Is Installed:: Hacker tricks.
 
 Setting Up the Daemon
 
@@ -252,6 +253,7 @@ instead, you want to install the complete GNU operating system,
 * Running the Test Suite::      Testing Guix.
 * Setting Up the Daemon::       Preparing the build daemon's environment.
 * Invoking guix-daemon::        Running the build daemon.
+* Running Guix Before It Is Installed::     Hacker tricks.
 @end menu
 
 @node Binary Installation
@@ -830,6 +832,44 @@ useful in exceptional circumstances, such as if you need to run several
 daemons on the same machine.
 @end table
 
+@node Running Guix Before It Is Installed
+@section Running Guix Before It Is Installed
+
+If you are hacking Guix itself---which is a good idea!---you will find
+it useful to test the changes made in your local source tree checkout
+without actually installing them.
+
+To that end, all the command-line tools can be used even if you have not
+run @command{make install}.  To do that, prefix each command with
+@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the
+top build tree of Guix), as in:
+
+@example
+$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild
+$ ./pre-inst-env guix build hello
+@end example
+
+@noindent
+Similarly, for a Guile session using the Guix modules:
+
+@example
+$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
+@end example
+
+The @command{pre-inst-env} script sets up all the environment variables
+necessary to support this, including @code{PATH} and
+@code{GUILE_LOAD_PATH}.
+
+If you are hacking Guix from Emacs using the wonderful Geiser
+(@pxref{Introduction,,, geiser, Geiser User Manual}), make sure to
+augment Guile's load path so that it finds source files from your
+checkout:
+
+@lisp
+;; Assuming the Guix checkout is in ~/src/guix.
+(add-to-list 'geiser-guile-load-path "~/src/guix")
+@end lisp
+
 
 @c *********************************************************************
 @node Package Management
@@ -6215,7 +6255,8 @@ creating packages.  For more information on package definitions,
 Once a package definition is in place, stored in a file in the Guix
 source tree, it can be tested using the @command{guix build} command
 (@pxref{Invoking guix build}).  For example, assuming the new package is
-called @code{gnew}, you may run this command from the Guix build tree:
+called @code{gnew}, you may run this command from the Guix build tree
+(@pxref{Running Guix Before It Is Installed}):
 
 @example
 ./pre-inst-env guix build gnew --keep-failed