>From 887f2640da75d93560f49edca6198d294d809a41 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 30 May 2015 01:47:21 +0200 Subject: [PATCH] doc: Move hacker tricks to 'HACKING'. * doc/guix.texi (Running Guix before it is installed): Delete node. (Packaging Guidelines): Adapt to it. * HACKING (Running Guix before it is installed): Delete section. (Doing Stuff!): New section. (Building from Git, Doing Stuff!, The Perfect Setup): Split informations. --- HACKING | 33 +++++++++++++++++++++++++++++---- doc/guix.texi | 43 +------------------------------------------ 2 files changed, 30 insertions(+), 46 deletions(-) diff --git a/HACKING b/HACKING index cf10ba5..e5f854b 100644 --- a/HACKING +++ b/HACKING @@ -4,6 +4,7 @@ Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès Copyright © 2013 Nikita Karetnikov +Copyright © 2015 Mathieu Lirzin Copyright © 2014 Pierre-Antoine Rault Copying and distribution of this file, with or without modification, @@ -13,8 +14,10 @@ Copyright © 2014 Pierre-Antoine Rault * Building from Git -When building Guix from a checkout, the following packages are required in -addition to those mentioned in the installation instructions: +If you want to hack Guix itself, it is recommended to use the latest version +from the Git repository. When building Guix from a checkout, the following +packages are required in addition to those mentioned in the installation +instructions: - [[http://www.gnu.org/software/autoconf/][GNU Autoconf]] - [[http://www.gnu.org/software/automake/][GNU Automake]] @@ -44,9 +47,26 @@ Finally, you have to invoke ‘make check’ to run tests. If anything fails, take a look at “info '(guix) Installation'” or send a message to . -* Running Guix before it is installed +* Doing stuff! -See the same-named section in the manual. +In order to keep a sane working environment, you will find it useful to test +the changes made in your local source tree checkout without actually +installing them. So that you can distinguish between your “end-user” hat and +your “motley” costume. + +To that end, all the command-line tools can be used even if you have not run +"make install". To do that, prefix each command with =./pre-inst-env= (this +script lives in the top build tree of Guix), as in: + + $ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild + $ ./pre-inst-env guix build hello + +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, including ‘PATH’ and ‘GUILE_LOAD_PATH’. * The Perfect Setup @@ -59,6 +79,11 @@ Geiser allows for interactive and incremental development from within Emacs: code compilation and evaluation from within buffers, access to on-line documentation (docstrings), context-sensitive completion, M-. to jump to an object definition, a REPL to try out your code, and more. +For convenient Guix development, make sure to augment Guile’s load path +so that it finds source files from your checkout: + + ;; Assuming the Guix checkout is in ~/src/guix. + (add-to-list 'geiser-guile-load-path "~/src/guix") To actually edit the code, Emacs already has a neat Scheme mode. But in addition to that, you must not miss [[http://www.emacswiki.org/emacs/ParEdit][Paredit]]. It provides facilities to diff --git a/doc/guix.texi b/doc/guix.texi index 2d10ec9..6dbd76e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -88,7 +88,6 @@ 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 @@ -253,7 +252,6 @@ 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 @@ -835,44 +833,6 @@ useful in exceptional circumstances, such as if you need to run several daemons on the same machine. @end table address@hidden Running Guix Before It Is Installed address@hidden 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 address@hidden/pre-inst-env} (the @file{pre-inst-env} script lives in the -top build tree of Guix), as in: - address@hidden -$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild -$ ./pre-inst-env guix build hello address@hidden example - address@hidden -Similarly, for a Guile session using the Guix modules: - address@hidden -$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' address@hidden example - -The @command{pre-inst-env} script sets up all the environment variables -necessary to support this, including @code{PATH} and address@hidden - -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: - address@hidden -;; Assuming the Guix checkout is in ~/src/guix. -(add-to-list 'geiser-guile-load-path "~/src/guix") address@hidden lisp - @c ********************************************************************* @node Package Management @@ -6300,8 +6260,7 @@ 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 -(@pxref{Running Guix Before It Is Installed}): +called @code{gnew}, you may run this command from the Guix build tree: @example ./pre-inst-env guix build gnew --keep-failed -- 2.1.4