Next: , Up: Contribuindo   [Contents][Index]

22.1 Compilando do git

Se você quiser hackear o próprio Guix, é recomendado usar a versão mais recente do repositório Git:

git clone

How do you ensure that you obtained a genuine copy of the repository? To do that, run guix git authenticate, passing it the commit and OpenPGP fingerprint of the channel introduction (see Invoking guix git authenticate):

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

This command completes with exit code zero on success; it prints an error message and exits with a non-zero code otherwise.

As you can see, there is a chicken-and-egg problem: you first need to have Guix installed. Typically you would install Guix System (see Instalação do sistema) or Guix on top of another distro (see Instalação de binários); in either case, you would verify the OpenPGP signature on the installation medium. This “bootstraps” the trust chain.

A maneira mais fácil de configurar um ambiente de desenvolvimento para o Guix é, obviamente, usando o Guix! O comando a seguir inicia um novo shell no qual todas as dependências e variáveis de ambiente apropriadas são configuradas para hackear o Guix:

guix shell -D guix --pure

See Invoking guix shell, 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 Requisitos).

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

provavelmente significa que o Autoconf não conseguiu encontrar o pkg.m4, que é fornecido pelo pkg-config. Certifique-se de que pkg.m4 esteja disponível. O mesmo vale para o conjunto de macros guile.m4 fornecido pelo Guile. Por exemplo, se você instalou o Automake em /usr/local, ele não procuraria arquivos .m4 em /usr/share. Nesse caso, você tem que invocar o seguinte comando:

export ACLOCAL_PATH=/usr/share/aclocal

See Macro Search Path in The GNU Automake Manual, para mais informações.

Then, run:

./configure --localstatedir=/var

... where /var is the normal localstatedir value (see O armazém, 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 Executando a suíte de testes):

make check

If anything fails, take a look at installation instructions (see Instalação) 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

Nota: 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: Executando guix antes dele ser instalado, Up: Contribuindo   [Contents][Index]