Next: , Up: 贡献   [Contents][Index]

22.1 从Git构建


git clone

如何确保您获得了存储库的真实副本?为此,运行guix git authenticate,将channel introduction(see Invoking guix git authenticate)的提交和OpenPGP指纹传递给它:

git fetch origin keyring:keyring
guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
  "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"


如你所见,存在一个先有鸡还是蛋的问题:首先你需要安装Guix。更多情况,您将在另一个发行版(see 系统安装)上安装Guix系统(see 二进制文件安装)或Guix;但无论如何,您都需要在安装介质上验证OpenPGP签名。这“保证”了信任链。


guix shell -D guix --pure

See Invoking guix shell, for more information on that command.

当从Git检出构建Guix时无法使用Guix,除安装指导(see 需求)里提及的软件包之外还需要这些包。

On Guix, extra dependencies can be added by instead running guix shell:

guix shell -D guix help2man git strace --pure

From there you can generate the build system infrastructure using Autoconf and Automake:


If you get an error like this one: error: possibly undefined macro: PKG_CHECK_MODULES


export ACLOCAL_PATH=/usr/share/aclocal

参考See Macro Search Path in The GNU Automake Manual.

Then, run:

./configure --localstatedir=/var

... where /var is the normal localstatedir value (see 仓库, for information about this). Note that you will probably not run make install at the end (you don’t have to) but it’s still important to pass the right localstatedir.

Finally, you can build Guix and, if you feel so inclined, run the tests (see 运行测试套件):

make check

If anything fails, take a look at installation instructions (see 安装) or send a message to the mailing list.

From there on, you can authenticate all the commits included in your checkout by running:

make authenticate

The first run takes a couple of minutes, but subsequent runs are faster.

Or, when your configuration for your local Git repository doesn’t match the default one, you can provide the reference for the keyring branch through the variable GUIX_GIT_KEYRING. The following example assumes that you have a Git remote called ‘myremote’ pointing to the official repository:

make authenticate GUIX_GIT_KEYRING=myremote/keyring

注: You are advised to run make authenticate after every git pull invocation. This ensures you keep receiving valid changes to the repository.

After updating the repository, make might fail with an error similar to the following example:

error: failed to load 'gnu/packages/dunst.scm':
ice-9/eval.scm:293:34: In procedure abi-check: #<record-type <origin>>: record ABI mismatch; recompilation needed

This means that one of the record types that Guix defines (in this example, the origin record) has changed, and all of guix needs to be recompiled to take that change into account. To do so, run make clean-go followed by make.

Next: 在安装之前运行Guix, Up: 贡献   [Contents][Index]