If you want to hack Guix itself, it is recommended to use the latest version from the Git repository:
git clone https://git.savannah.gnu.org/git/guix.git
How do you ensure that you obtained a genuine copy of the repository? Guix itself provides a tool to authenticate your checkout, but you must first make sure this tool is genuine in order to “bootstrap” the trust chain. To do that, run:
git verify-commit `git log --format=%H build-aux/git-authenticate.scm`
The output must look something like:
gpg: Signature made Fri 27 Dec 2019 01:27:41 PM CET gpg: using RSA key 3CE464558A84FDC69DB40CFB090B11993D9AEBB5 … gpg: Signature made Fri 27 Dec 2019 01:25:22 PM CET gpg: using RSA key 3CE464558A84FDC69DB40CFB090B11993D9AEBB5 …
... meaning that changes to this file are all signed with key
3CE464558A84FDC69DB40CFB090B11993D9AEBB5 (you may need to fetch
this key from a key server, if you have not done it yet).
The easiest way to set up a development environment for Guix is, of course, by using Guix! The following command starts a new shell where all the dependencies and appropriate environment variables are set up to hack on Guix:
guix environment guix --pure
See Invoking guix environment, for more information on that command.
If you are unable to use Guix when building Guix from a checkout, the following are the required packages in addition to those mentioned in the installation instructions (see Requirements).
On Guix, extra dependencies can be added by instead running
environment with --ad-hoc:
guix environment guix --pure --ad-hoc help2man git strace
./bootstrap to generate the build system infrastructure
using Autoconf and Automake. If you get an error like this one:
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
it probably means that Autoconf couldn’t find pkg.m4, which is provided by pkg-config. Make sure that pkg.m4 is available. The same holds for the guile.m4 set of macros provided by Guile. For instance, if you installed Automake in /usr/local, it wouldn’t look for .m4 files in /usr/share. In that case, you have to invoke the following command:
See Macro Search Path in The GNU Automake Manual, for more information.
./configure as usual. Make sure to pass
--localstatedir=directory where directory is the
localstatedir value used by your current installation (see The Store, for information about this). We recommend to use the value
Finally, you have to invoke
make check to run tests
(see Running the Test Suite). If anything
fails, take a look at installation instructions (see Installation)
or send a message to the mailing list.
From there on, you can authenticate all the commits included in your checkout by running:
The first run takes a couple of minutes, but subsequent runs are faster.
Note: You are advised to run
make authenticateafter every
git pullinvocation. This ensures you keep receiving valid changes to the repository.