Próximo: , Anterior: , Acima: Contribuindo   [Conteúdo][Índice]

22.2 Executando guix antes dele ser instalado

Para manter um ambiente de trabalho saudável, você achará útil testar as alterações feitas na árvore local de fontes sem realmente instalá-las. Para que você possa distinguir entre o seu chapéude ”usuário final” e sua fantasia ”misturada”.

To that end, all the command-line tools can be used even if you have not run make install. To do that, you first need to have an environment with all the dependencies available (veja Compilando do git), and then simply prefix each command with ./pre-inst-env (the pre-inst-env script lives in the top build tree of Guix; veja Compilando do git to generate it). As an example, here is how you would build the hello package as defined in your working tree (this assumes guix-daemon is already running on your system; it’s OK if it’s a different version):

$ ./pre-inst-env guix build hello

Similarly, an example for a Guile session using the Guix modules:

$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'

;;; ("x86_64-linux")

… and for a REPL (veja Using Guix Interactively):

$ ./pre-inst-env guile
scheme@(guile-user)> ,use(guix)
scheme@(guile-user)> ,use(gnu)
scheme@(guile-user)> (define snakes
                         (lambda (package lst)
                           (if (string-prefix? "python"
                                               (package-name package))
                               (cons package lst)
scheme@(guile-user)> (length snakes)
$1 = 361

If you are hacking on the daemon and its supporting code or if guix-daemon is not already running on your system, you can launch it straight from the build tree41:

$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild

O script pre-inst-env configura todas as variáveis de ambiente necessárias para prover suporte a isso, incluindo PATH e GUILE_LOAD_PATH.

Observe que ./pre-inst-env guix pull não atualiza a área de fontes local; ele simplesmente atualiza o link simbólico ~/.config/guix/current (veja Invocando guix pull). Execute git pull em vez disso, se você quiser atualizar sua árvore de fontes local.

Sometimes, especially if you have recently updated your repository, running ./pre-inst-env will print a message similar to the following example:

;;; note: source file /home/user/projects/guix/guix/progress.scm
;;;       newer than compiled /home/user/projects/guix/guix/progress.go

This is only a note and you can safely ignore it. You can get rid of the message by running make -j4. Until you do, Guile will run slightly slower because it will interpret the code instead of using prepared Guile object (.go) files.

You can run make automatically as you work using watchexec from the watchexec package. For example, to build again each time you update a package file, run ‘watchexec -w gnu/packages -- make -j4’.

Notas de Rodapé


The -E flag to sudo guarantees that GUILE_LOAD_PATH is correctly set such that guix-daemon and the tools it uses can find the Guile modules they need.

Próximo: A configuração perfeita, Anterior: Compilando do git, Acima: Contribuindo   [Conteúdo][Índice]