如果你想折腾 Guix 本身,建议使用 Git 仓库里最新的版本:
git clone https://git.savannah.gnu.org/git/guix.git
如何确保已获得存储库的真实副本?要做到这一点,运行 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开发环境的最简单的方式当然是使用Guix!下面这些命令启动一个shell,所有的依赖和环境变量都为折腾Guix设置好了:
guix shell -D guix -CPW
或者,从一个Git worktree内部使用Guix:
guix shell -CPW
如果您的系统不支持 -C (short for --container) , 尝试用
--pure
替代 -CPW. 在 See Invoking guix shell
有更多关于此命令的信息。
当从Git检出构建Guix时无法使用Guix,除安装指导(see 需求)里提及的软件包之外还需要这些包。
在 Guix 上,额外的依赖也可以通过 guix shell
添加:
guix shell -D guix help2man git strace --pure
在这里你可以使用Autoconf和Automake生成构建系统的基础设施。
引导
若你得到一个像这样的错误:
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
它可能意味着Autoconf无法找到由pkg-config提供的pkg.m4。请确保pkg.m4可用。由Guile提供的guile.m4宏也类似。假如你的Automake安装在/usr/local,那么它不会从/usr/share里寻找.m4文件。这种情况下,你必须执行下面这个命令:
export ACLOCAL_PATH=/usr/share/aclocal
参考See Macro Search Path in The GNU Automake Manual.
然后,运行:
./configure
... where /var is the normal localstatedir
value (see 仓库, for information about this) and /etc is the normal
sysconfdir
value. 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
and sysconfdir
values, which get recorded
in the (guix config)
Guile module.
最后,你可以构建 Guix。若你希望,还可以运行测试 (see 运行测试套件):
make make check
如果遇到任何错误,请参考“安装指导”(see 安装)或者给邮件列表发邮件。
从这开始,你可以运行下面的命令认证检出中的所有提交:
guix git authenticate \ 9edb3f66fd807b096b48283debdcddccfea34bad \ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
The first run takes a couple of minutes, but subsequent runs are faster. On subsequent runs, you can run the command without any arguments since the introduction (the commit ID and OpenPGP fingerprints above) will have been recorded43:
guix git authenticate
When your configuration for your local Git repository doesn’t match the
default one, you can provide the reference for the keyring
branch
via the -k option. The following example assumes that you have
a Git remote called ‘myremote’ pointing to the official repository:
guix git authenticate \ -k myremote/keyring \ 9edb3f66fd807b096b48283debdcddccfea34bad \ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
See Invoking guix git authenticate
, for more information on this command.
注: By default, hooks are installed such that
guix git authenticate
is invoked anytime you rungit pull
orgit push
.
在每次更新仓库后,make
可能会因为一个错误而失败,就像下面的例子:
error: failed to load 'gnu/packages/linux.scm': ice-9/eval.scm:293:34: In procedure abi-check: #<record-type <origin>>: record ABI mismatch; recompilation needed
它的意思是 Guix 定义的一个记录类型变动了(在这个例子中,为 origin
记录),并且全部 guix
都需要重编译来让这个变动生效。运行 make clean-go
和 make
来重新编译。
Should make
fail with an Automake error message after updating,
you need to repeat the steps outlined in this section, commencing with
./bootstrap
.