Content-Security-Policy: default-src 'none' Content-Type: text/plain; charset=UTF-8 Content-Length: 4415 Content-Disposition: inline; filename="mcron.scm" Last-Modified: Fri, 31 Jan 2025 20:36:45 GMT Expires: Mon, 29 Jan 2035 20:36:45 GMT ETag: "313c8364f871579ff1108dfa23bb70b474a0cbe0"

;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Ludovic Courtès <ludo.org> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu services mcron) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) #:autoload   (gnu packages guile) (mcron2) #:use-module (gu</td></tr></table> <table class='tabs'><tr><td> <a class='active' href='/guix/about/'>about</a><a href='/guix/'>summary</a><a href='/guix/refs/?id=e9bb8eca3d89242f9eee391ff4c0b094f2692fca'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=e9bb8eca3d89242f9eee391ff4c0b094f2692fca'>tree</a><a href='/guix/commit/?id=e9bb8eca3d89242f9eee391ff4c0b094f2692fca'>commit</a><a href='/guix/diff/?id=e9bb8eca3d89242f9eee391ff4c0b094f2692fca'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'> <input type='hidden' name='id' value='e9bb8eca3d89242f9eee391ff4c0b094f2692fca'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='content'><div id='summary'><pre>

Contributing
************

This project is a cooperative effort, and we need your help to make it grow!  Please get in touch with us on guix-devel@gnu.org and #guix on the Libera Chat IRC network.  We welcome ideas, bug reports, patches, and anything that may be helpful to the project.  We particularly welcome help on packaging (see Packaging Guidelines).

We want to provide a warm, friendly, and harassment-free environment, so that anyone can contribute to the best of their abilities.  To this end our project uses a ``Contributor Covenant&apos;&apos;, which was adapted from https://contributor-covenant.org/.  You can find a local version in the CODE-OF-CONDUCT file in the source tree.

Contributors are not required to use their legal name in patches and on-line communication; they can use any name or pseudonym of their choice.

Requirements
============

You can easily hack on Guix itself using Guix and Git, which we use for version control (see Building from Git).

But when packaging Guix for foreign distros or when bootstrapping on systems without Guix, and if you decide to not just trust and install our readily made binary (see Binary Installation), you can download a release version of our reproducible source tarball and read on.

This section lists requirements when building Guix from source.  The build procedure for Guix is the same as for other GNU software, and is not covered here.  Please see the files README and INSTALL in the Guix source tree for additional details.

GNU Guix is available for download from its website at https://www.gnu.org/software/guix/.

GNU Guix depends on the following packages:

  * GNU Guile (https://gnu.org/software/guile/), version 3.0.x, version 3.0.3 or later;

  * Guile-Gcrypt (https://notabug.org/cwebber/guile-gcrypt), version 0.1.0 or later;

  * Guile-GnuTLS (https://gitlab.com/gnutls/guile/) (see how to install the GnuTLS bindings for Guile (GnuTLS-Guile)) (The Guile bindings to GnuTLS (https://gnutls.org/) were distributed as part of GnuTLS until version 3.7.8 included.);

  * Guile-SQLite3 (https://notabug.org/guile-sqlite3/guile-sqlite3), version 0.1.0 or later;

  * Guile-zlib (https://notabug.org/guile-zlib/guile-zlib), version 0.1.0 or later;

  * Guile-lzlib (https://notabug.org/guile-lzlib/guile-lzlib);

  * Guile-Avahi (https://www.nongnu.org/guile-avahi/);

  * Guile-Git (https://gitlab.com/guile-git/guile-git), version 0.5.0 or later;

  * Git (https://git-scm.com) (yes, both!);

  * Guile-JSON (https://savannah.nongnu.org/projects/guile-json/) 4.3.0 or later;

  * GNU Make (https://www.gnu.org/software/make/).

The following dependencies are optional:

  * Support for build offloading (see Daemon Offload Setup) and guix copy (see Invoking guix copy) depends on Guile-SSH (https://github.com/artyom-poptsov/guile-ssh), version 0.13.0 or later.

  * Guile-zstd (https://notabug.org/guile-zstd/guile-zstd), for zstd compression and decompression in guix publish and for substitutes (see Invoking guix publish).

  * Guile-Semver (https://ngyro.com/software/guile-semver.html) for the crate importer (see Invoking guix import).

  * Guile-Lib (https://www.nongnu.org/guile-lib/doc/ref/htmlprag/) for the go importer (see Invoking guix import) and for some of the ``updaters&apos;&apos; (see Invoking guix refresh).

  * When libbz2 (http://www.bzip.org) is available, guix-daemon can use it to compress build logs.

Unless --disable-daemon was passed to configure, the following packages are also needed:

  * GNU libgcrypt (https://gnupg.org/);

  * SQLite 3 (https://sqlite.org);

  * GCC&apos;s g++ (https://gcc.gnu.org), with support for the C++11 standard.

Building from Git
=================

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? 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 \
       &quot;BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA&quot;

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 System Installation) or Guix on top of another distro (see Binary Installation); in either case, you would verify the OpenPGP signature on the installation medium.  This ``bootstraps&apos;&apos; the trust chain.

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 shell -D guix -CPW

or even, from within a Git worktree for Guix:

     guix shell -CPW

If -C (short for --container) is not supported on your system, try --pure instead of -CPW. 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 Requirements).

  * GNU Autoconf (https://gnu.org/software/autoconf/);

  * GNU Automake (https://gnu.org/software/automake/);

  * GNU Gettext (https://gnu.org/software/gettext/);

  * GNU Texinfo (https://gnu.org/software/texinfo/);

  * Graphviz (https://www.graphviz.org/);

  * GNU Help2man (optional) (https://www.gnu.org/software/help2man/).

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:

     ./bootstrap

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:

     export ACLOCAL_PATH=/usr/share/aclocal

See Macro Search Path (The GNU Automake Manual), for more information.

Then, run:

     ./configure

Optionally, --localstatedir and --sysconfdir can also be provided as arguments.  By default, localstatedir is /var (see The Store, for information about this) and sysconfdir is /etc.  Note that you will probably not run make install at the end (you don&apos;t have to) but it&apos;s still important to pass the right localstatedir and sysconfdir values, which get recorded in the (guix config) Guile module.

Finally, you can build Guix and, if you feel so inclined, run the tests (see Running the Test Suite):

     make
     make check

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:

     guix git authenticate \
       9edb3f66fd807b096b48283debdcddccfea34bad \
       &quot;BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA&quot;

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 recorded (This requires a recent version of Guix, from May 2024 or more recent.):

     guix git authenticate

When your configuration for your local Git repository doesn&apos;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 \
       &quot;BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA&quot;

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 run git pull or git push.

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

     error: failed to load &apos;gnu/packages/linux.scm&apos;:
     ice-9/eval.scm:293:34: In procedure abi-check: #&lt;record-type &lt;origin&gt;&gt;: 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.

Should make fail with an Automake error message after updating, you need to repeat the steps outlined in this section, commencing with ./bootstrap.

Running the Test Suite
======================

After a successful configure and make run, it is a good idea to run the test suite.  It can help catch issues with the setup or environment, or bugs in Guix itself---and really, reporting test failures is a good way to help improve the software.  To run the test suite, type:

     make check

Test cases can run in parallel: you can use the -j option of GNU make to speed things up.  The first run may take a few minutes on a recent machine; subsequent runs will be faster because the store that is created for test purposes will already have various things in cache.

It is also possible to run a subset of the tests by defining the TESTS makefile variable as in this example:

     make check TESTS=&quot;tests/store.scm tests/cpio.scm&quot;

By default, tests results are displayed at a file level.  In order to see the details of every individual test cases, it is possible to define the SCM_LOG_DRIVER_FLAGS makefile variable as in this example:

     make check TESTS=&quot;tests/base64.scm&quot; SCM_LOG_DRIVER_FLAGS=&quot;--brief=no&quot;

The underlying SRFI 64 custom Automake test driver used for the &apos;check&apos; test suite (located at build-aux/test-driver.scm) also allows selecting which test cases to run at a finer level, via its --select and --exclude options.  Here&apos;s an example, to run all the test cases from the tests/packages.scm test file whose names start with ``transaction-upgrade-entry&apos;&apos;:

     export SCM_LOG_DRIVER_FLAGS=&quot;--select=^transaction-upgrade-entry&quot;
     make check TESTS=&quot;tests/packages.scm&quot;

Those wishing to inspect the results of failed tests directly from the command line can add the --errors-only=yes option to the SCM_LOG_DRIVER_FLAGS makefile variable and set the VERBOSE Automake makefile variable, as in:

     make check SCM_LOG_DRIVER_FLAGS=&quot;--brief=no --errors-only=yes&quot; VERBOSE=1

The --show-duration=yes option can be used to print the duration of the individual test cases, when used in combination with --brief=no:

     make check SCM_LOG_DRIVER_FLAGS=&quot;--brief=no --show-duration=yes&quot;

See Parallel Test Harness (GNU Automake) for more information about the Automake Parallel Test Harness.

Upon failure, please email bug-guix@gnu.org and attach the test-suite.log file.  Please specify the Guix version being used as well as version numbers of the dependencies (see Requirements) in your message.

Guix also comes with a whole-system test suite that tests complete Guix System instances.  It can only run on systems where Guix is already installed, using:

     make check-system

or, again, by defining TESTS to select a subset of tests to run:

     make check-system TESTS=&quot;basic mcron&quot;

These system tests are defined in the (gnu tests ...) modules.  They work by running the operating systems under test with lightweight instrumentation in a virtual machine (VM).  They can be computationally intensive or rather cheap, depending on whether substitutes are available for their dependencies (see Substitutes). Some of them require a lot of storage space to hold VM images.

If you encounter an error like:

     Compiling Scheme modules...
     ice-9/eval.scm:142:16: In procedure compile-top-call:
     error: all-system-tests: unbound variable
     hint: Did you forget `(use-modules (gnu tests))&apos;?

there may be inconsistencies in the work tree from previous builds.  To resolve this, try running make clean-go followed by make.

Again in case of test failures, please send bug-guix@gnu.org all the details.

Running Guix Before It Is Installed
===================================

In order to keep a sane working environment, you will find it useful to test the changes made in your local source tree checkout without actually installing them.  So that you can distinguish between your ``end-user&apos;&apos; hat and your ``motley&apos;&apos; costume.

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 (see Building from Git), and then simply prefix each command with ./pre-inst-env (the pre-inst-env script lives in the top build tree of Guix; see Building from 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&apos;s OK if it&apos;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 &apos;(use-modules (guix utils)) (pk (%current-system))&apos;

     ;;; (&quot;x86_64-linux&quot;)

... and for a REPL (see Using Guix Interactively):

     $ ./pre-inst-env guile
     scheme@(guile-user)&gt; ,use(guix)
     scheme@(guile-user)&gt; ,use(gnu)
     scheme@(guile-user)&gt; (define snakes
                            (fold-packages
                              (lambda (package lst)
                                (if (string-prefix? &quot;python&quot;
                                                    (package-name package))
                                    (cons package lst)
                                    lst))
                              &apos;()))
     scheme@(guile-user)&gt; (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 tree (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.):

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

The pre-inst-env script sets up all the environment variables necessary to support this, including PATH and GUILE_LOAD_PATH.

Note that ./pre-inst-env guix pull does not upgrade the local source tree; it simply updates the ~/.config/guix/current symlink (see Invoking guix pull).  Run git pull instead if you want to upgrade your local source tree.

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.

The Perfect Setup
=================

The Perfect Setup to hack on Guix is basically the perfect setup used for Guile hacking (see Using Guile in Emacs (Guile Reference Manual)).  First, you need more than an editor, you need Emacs (https://www.gnu.org/software/emacs), empowered by the wonderful Geiser (https://nongnu.org/geiser/).  To set that up, run:

     guix install emacs guile emacs-geiser emacs-geiser-guile

Geiser allows for interactive and incremental development from within Emacs: code compilation and evaluation from within buffers, access to on-line documentation (docstrings), context-sensitive completion, M-. to jump to an object definition, a REPL to try out your code, and more (see Introduction (Geiser User Manual)).  If you allow Emacs to load the .dir-locals.el file at the root of the project checkout, it will cause Geiser to automatically add the local Guix sources to the Guile load path.

To actually edit the code, Emacs already has a neat Scheme mode.  But in addition to that, you must not miss Paredit (https://www.emacswiki.org/emacs/ParEdit).  It provides facilities to directly operate on the syntax tree, such as raising an s-expression or wrapping it, swallowing or rejecting the following s-expression, etc.

We also provide templates for common git commit messages and package definitions in the etc/snippets directory.  These templates can be used to expand short trigger strings to interactive text snippets. If you use YASnippet (https://joaotavora.github.io/yasnippet/), you may want to add the etc/snippets/yas snippets directory to the YAS-SNIPPET-DIRS variable.  If you use Tempel (https://github.com/minad/tempel/), you may want to add the etc/snippets/tempel/* path to the TEMPEL-PATH variable in Emacs.

     ;; Assuming the Guix checkout is in ~/src/guix.
     ;; Yasnippet configuration
     (with-eval-after-load &apos;yasnippet
       (add-to-list &apos;yas-snippet-dirs &quot;~/src/guix/etc/snippets/yas&quot;))
     ;; Tempel configuration
     (with-eval-after-load &apos;tempel
        ;; Ensure tempel-path is a list -- it may also be a string.
        (unless (listp &apos;tempel-path)
          (setq tempel-path (list tempel-path)))
        (add-to-list &apos;tempel-path &quot;~/src/guix/etc/snippets/tempel/*&quot;))

The commit message snippets depend on Magit (https://magit.vc/) to display staged files.  When editing a commit message type add followed by TAB to insert a commit message template for adding a package; type update followed by TAB to insert a template for updating a package; type https followed by TAB to insert a template for changing the home page URI of a package to HTTPS.

The main snippet for scheme-mode is triggered by typing package... followed by TAB.  This snippet also inserts the trigger string origin..., which can be expanded further.  The origin snippet in turn may insert other trigger strings ending on ..., which also can be expanded further.

We additionally provide insertion and automatic update of a copyright in etc/copyright.el.  You may want to set your full name, mail, and load a file.

     (setq user-full-name &quot;Alice Doe&quot;)
     (setq user-mail-address &quot;alice@mail.org&quot;)
     ;; Assuming the Guix checkout is in ~/src/guix.
     (load-file &quot;~/src/guix/etc/copyright.el&quot;)

To insert a copyright at the current line invoke M-x guix-copyright.

To update a copyright you need to specify a copyright-names-regexp.

     (setq copyright-names-regexp
           (format &quot;%s &lt;%s&gt;&quot; user-full-name user-mail-address))

You can check if your copyright is up to date by evaluating M-x copyright-update.  If you want to do it automatically after each buffer save then add (add-hook &apos;after-save-hook &apos;copyright-update) in Emacs.

Viewing Bugs within Emacs
-------------------------

Emacs has a nice minor mode called bug-reference, which, when combined with emacs-debbugs (the Emacs package), can be used to open links such as &lt;https://bugs.gnu.org/58697&gt; or &lt;https://issues.guix.gnu.org/58697&gt; as bug report buffers.  From there you can easily consult the email thread via the Gnus interface, reply or modify the bug status, all without leaving the comfort of Emacs!  Below is a sample configuration to add to your ~/.emacs configuration file:

     ;;; Bug references.
     (require &apos;bug-reference)
     (add-hook &apos;prog-mode-hook #&apos;bug-reference-prog-mode)
     (add-hook &apos;gnus-mode-hook #&apos;bug-reference-mode)
     (add-hook &apos;erc-mode-hook #&apos;bug-reference-mode)
     (add-hook &apos;gnus-summary-mode-hook #&apos;bug-reference-mode)
     (add-hook &apos;gnus-article-mode-hook #&apos;bug-reference-mode)

     ;;; This extends the default expression (the top-most, first expression
     ;;; provided to &apos;or&apos;) to also match URLs such as
     ;;; &lt;https://issues.guix.gnu.org/58697&gt; or &lt;https://bugs.gnu.org/58697&gt;.
     ;;; It is also extended to detect &quot;Fixes: #NNNNN&quot; git trailers.
     (setq bug-reference-bug-regexp
           (rx (group (or (seq word-boundary
                               (or (seq (char &quot;Bb&quot;) &quot;ug&quot;
                                        (zero-or-one &quot; &quot;)
                                        (zero-or-one &quot;#&quot;))
                                   (seq (char &quot;Pp&quot;) &quot;atch&quot;
                                        (zero-or-one &quot; &quot;)
                                        &quot;#&quot;)
                                   (seq (char &quot;Ff&quot;) &quot;ixes&quot;
                                        (zero-or-one &quot;:&quot;)
                                        (zero-or-one &quot; &quot;) &quot;#&quot;)
                                   (seq &quot;RFE&quot;
                                        (zero-or-one &quot; &quot;) &quot;#&quot;)
                                   (seq &quot;PR &quot;
                                        (one-or-more (char &quot;a-z+-&quot;)) &quot;/&quot;))
                               (group (one-or-more (char &quot;0-9&quot;))
                                      (zero-or-one
                                       (seq &quot;#&quot; (one-or-more
                                                 (char &quot;0-9&quot;))))))
                          (seq (? &quot;&lt;&quot;) &quot;https://bugs.gnu.org/&quot;
                               (group-n 2 (one-or-more (char &quot;0-9&quot;)))
                               (? &quot;&gt;&quot;))
                          (seq (? &quot;&lt;&quot;) &quot;https://issues.guix.gnu.org/&quot;
                               (? &quot;issue/&quot;)
                               (group-n 2 (one-or-more (char &quot;0-9&quot;)))
                               (? &quot;&gt;&quot;))))))
     (setq bug-reference-url-format &quot;https://issues.guix.gnu.org/%s&quot;)

     (require &apos;debbugs)
     (require &apos;debbugs-browse)
     (add-hook &apos;bug-reference-mode-hook #&apos;debbugs-browse-mode)
     (add-hook &apos;bug-reference-prog-mode-hook #&apos;debbugs-browse-mode)

     ;; The following allows Emacs Debbugs user to open the issue directly within
     ;; Emacs.
     (setq debbugs-browse-url-regexp
           (rx line-start
               &quot;http&quot; (zero-or-one &quot;s&quot;) &quot;://&quot;
               (or &quot;debbugs&quot; &quot;issues.guix&quot; &quot;bugs&quot;)
               &quot;.gnu.org&quot; (one-or-more &quot;/&quot;)
               (group (zero-or-one &quot;cgi/bugreport.cgi?bug=&quot;))
               (group-n 3 (one-or-more digit))
               line-end))

     ;; Change the default when run as &apos;M-x debbugs-gnu&apos;.
     (setq debbugs-gnu-default-packages &apos;(&quot;guix&quot; &quot;guix-patches&quot;))

     ;; Show feature requests.
     (setq debbugs-gnu-default-severities
      &apos;(&quot;serious&quot; &quot;important&quot; &quot;normal&quot; &quot;minor&quot; &quot;wishlist&quot;))

For more information, refer to Bug Reference (The GNU Emacs Manual) and Minor Mode (The Debbugs User Guide).

Alternative Setups
==================

Alternative setups than Emacs may let you work on Guix with a similar development experience and they might work better with the tools you currently use or help you make the transition to Emacs.

The options listed below only provide the alternatives to the Emacs based setup, which is the most widely used in the Guix community. If you want to really understand how is the perfect setup for Guix development supposed to work, we encourage you to read the section before this regardless the editor you choose to use.

Guile Studio
------------

Guile Studio is a pre-configured Emacs with mostly everything you need to start hacking in Guile. If you are not familiar with Emacs it makes the transition easier for you.

     guix install guile-studio

Guile Studio comes with Geiser preinstalled and prepared for action.

Vim and NeoVim
--------------

Vim (and NeoVim) are also packaged in Guix, just in case you decided to go for the evil path.

     guix install vim

If you want to enjoy a similar development experience to that in the perfect setup, you should install several plugins to configure the editor. Vim (and NeoVim) have the equivalent to Paredit, paredit.vim (https://www.vim.org/scripts/script.php?script_id=3998), that will help you with the structural editing of Scheme files (the support for very large files is not great, though).

     guix install vim-paredit

We also recommend that you run :set autoindent so that your code is automatically indented as you type.

For the interaction with Git, fugitive.vim (https://www.vim.org/scripts/script.php?script_id=2975) is the most commonly used plugin:

     guix install vim-fugitive

And of course if you want to interact with Guix directly from inside of vim, using the built-in terminal emulator, we have our very own guix.vim package!

     guix install vim-guix-vim

In NeoVim you can even make a similar setup to Geiser using Conjure (https://conjure.fun/) that lets you connect to a running Guile process and inject your code there live (sadly it&apos;s not packaged in Guix yet).

Source Tree Structure
=====================

If you&apos;re willing to contribute to Guix beyond packages, or if you&apos;d like to learn how it all fits together, this section provides a guided tour in the code base that you may find useful.

Overall, the Guix source tree contains almost exclusively Guile modules, each of which can be seen as an independent library (see Modules (GNU Guile Reference Manual)).

The following table gives an overview of the main directories and what they contain.  Remember that in Guile, each module name is derived from its file name---e.g., the module in file guix/packages.scm is called (guix packages).

guix
     This is the location of core Guix mechanisms.  To illustrate what is meant by ``core&apos;&apos;, here are a few examples, starting from low-level tools and going towards higher-level tools:

     (guix store)
          Connecting to and interacting with the build daemon (see The Store).

     (guix derivations)
          Creating derivations (see Derivations).

     (guix gexps)
          Writing G-expressions (see G-Expressions).

     (guix packages)
          Defining packages and origins (see package Reference).

     (guix download)
     (guix git-download)
          The url-fetch and git-fetch origin download methods (see origin Reference).

     (guix swh)
          Fetching source code from the Software Heritage archive (https://archive.softwareheritage.org).

     (guix search-paths)
          Implementing search paths (see Search Paths).

     (guix build-system)
          The build system interface (see Build Systems).

     (guix profiles)
          Implementing profiles.

guix/build-system
     This directory contains specific build system implementations (see Build Systems), such as:

     (guix build-system gnu)
          the GNU build system;

     (guix build-system cmake)
          the CMake build system;

     (guix build-system pyproject)
          The Python ``pyproject&apos;&apos; build system.

guix/build
     This contains code generally used on the ``build side&apos;&apos; (see strata of code).  This includes code used to build packages or other operating system components, as well as utilities:

     (guix build utils)
          Utilities for package definitions and more (see Build Utilities).

     (guix build gnu-build-system)
     (guix build cmake-build-system)
     (guix build pyproject-build-system)
          Implementation of build systems, and in particular definition of their build phases (see Build Phases).

     (guix build syscalls)
          Interface to the C library and to Linux system calls.

guix/scripts
     This contains modules corresponding to guix sub-commands.  For example, the (guix scripts shell) module exports the guix-shell procedure, which directly corresponds to the guix shell command (see Invoking guix shell).

guix/import
     This contains supporting code for the importers and updaters (see Invoking guix import, and see Invoking guix refresh).  For example, (guix import pypi) defines the interface to PyPI, which is used by the guix import pypi command.

The directories we have seen so far all live under guix/.  The other important place is the gnu/ directory, which contains primarily package definitions as well as libraries and tools for Guix System (see System Configuration) and Guix Home (see Home Configuration), all of which build upon functionality provided by (guix ...) modules (For this reason, (guix ...) modules must generally not depend on (gnu ...) modules, with notable exceptions: (guix build-system ...) modules may look up packages at run time---e.g., (guix build-system cmake) needs to access the cmake variable at run time---, (guix scripts ...) often rely on (gnu ...) modules, and the same goes for some of the (guix import ...) modules.).

gnu/packages
     This is by far the most crowded directory of the source tree: it contains package modules that export package definitions (see Package Modules).  A few examples:

     (gnu packages base)
          Module providing ``base&apos;&apos; packages: glibc, coreutils, grep, etc.

     (gnu packages guile)
          Guile and core Guile packages.

     (gnu packages linux)
          The Linux-libre kernel and related packages.

     (gnu packages python)
          Python and core Python packages.

     (gnu packages python-xyz)
          Miscellaneous Python packages (we were not very creative).

     In any case, you can jump to a package definition using guix edit (see Invoking guix edit) and view its location with guix show (see Invoking guix package).

gnu/packages/patches
     This directory contains patches applied against packages and obtained using the search-patches procedure.

gnu/services
     This contains service definitions, primarily for Guix System (see Services) but some of them are adapted and reused for Guix Home as we will see below.  Examples:

     (gnu services)
          The service framework itself, which defines the service and service type data types (see Service Composition).

     (gnu services base)
          ``Base&apos;&apos; services (see Base Services).

     (gnu services desktop)
          ``Desktop&apos;&apos; services (see Desktop Services).

     (gnu services shepherd)
          Support for Shepherd services (see Shepherd Services).

     You can jump to a service definition using guix system edit and view its location with guix system search (see Invoking guix system).

gnu/system
     These are core Guix System modules, such as:

     (gnu system)
          Defines operating-system (see operating-system Reference).

     (gnu system file-systems)
          Defines file-system (see File Systems).

     (gnu system mapped-devices)
          Defines mapped-device (see Mapped Devices).

gnu/build
     These are modules that are either used on the ``build side&apos;&apos; when building operating systems or packages, or at run time by operating systems.

     (gnu build accounts)
          Creating /etc/passwd, /etc/shadow, etc. (see User Accounts).

     (gnu build activation)
          Activating an operating system at boot time or reconfiguration time.

     (gnu build file-systems)
          Searching, checking, and mounting file systems.

     (gnu build linux-boot)
     (gnu build hurd-boot)
          Booting GNU/Linux and GNU/Hurd operating systems.

     (gnu build linux-initrd)
          Creating a Linux initial RAM disk (see Initial RAM Disk).

gnu/home
     This contains all things Guix Home (see Home Configuration); examples:

     (gnu home services)
          Core services such as home-files-service-type.

     (gnu home services ssh)
          SSH-related services (see Secure Shell).

gnu/installer
     This contains the text-mode graphical system installer (see Guided Graphical Installation).

gnu/machine
     These are the machine abstractions used by guix deploy (see Invoking guix deploy).

gnu/tests
     This contains system tests---tests that spawn virtual machines to check that system services work as expected (see Running the Test Suite).

Last, there&apos;s also a few directories that contain files that are not Guile modules:

nix
     This is the C++ implementation of guix-daemon, inherited from Nix (see Invoking guix-daemon).

tests
     These are unit tests, each file corresponding more or less to one module, in particular (guix ...) modules (see Running the Test Suite).

doc
     This is the documentation in the form of Texinfo files: this manual and the Cookbook.  See Writing a Texinfo File (GNU Texinfo), for information on Texinfo markup language.

po
     This is the location of translations of Guix itself, of package synopses and descriptions, of the manual, and of the cookbook.  Note that .po files that live here are pulled directly from Weblate (see Translating Guix).

etc
     Miscellaneous files: shell completions, support for systemd and other init systems, Git hooks, etc.

With all this, a fair chunk of your operating system is at your fingertips!  Beyond grep and git grep, see The Perfect Setup on how to navigate code from your editor, and see Using Guix Interactively for information on how to use Scheme modules interactively.  Enjoy!

Packaging Guidelines
====================

The GNU distribution is nascent and may well lack some of your favorite packages.  This section describes how you can help make the distribution grow.

Free software packages are usually distributed in the form of source code tarballs---typically tar.gz files that contain all the source files.  Adding a package to the distribution means essentially two things: adding a recipe that describes how to build the package, including a list of other packages required to build it, and adding package metadata along with that recipe, such as a description and licensing information.

In Guix all this information is embodied in package definitions. Package definitions provide a high-level view of the package.  They are written using the syntax of the Scheme programming language; in fact, for each package we define a variable bound to the package definition, and export that variable from a module (see Package Modules). However, in-depth Scheme knowledge is not a prerequisite for creating packages.  For more information on package definitions, see Defining Packages.

Once a package definition is in place, stored in a file in the Guix source tree, it can be tested using the guix build command (see Invoking guix build).  For example, assuming the new package is called gnew, you may run this command from the Guix build tree (see Running Guix Before It Is Installed):

     ./pre-inst-env guix build gnew --keep-failed

Using --keep-failed makes it easier to debug build failures since it provides access to the failed build tree.  Another useful command-line option when debugging is --log-file, to access the build log.

If the package is unknown to the guix command, it may be that the source file contains a syntax error, or lacks a define-public clause to export the package variable.  To figure it out, you may load the module from Guile to get more information about the actual error:

     ./pre-inst-env guile -c &apos;(use-modules (gnu packages gnew))&apos;

Once your package builds correctly, please send us a patch (see Submitting Patches).  Well, if you need help, we will be happy to help you too.  Once the patch is committed in the Guix repository, the new package automatically gets built on the supported platforms by our continuous integration system (https://SUBSTITUTE-SERVER-1).

Users can obtain the new package definition simply by running guix pull (see Invoking guix pull).  When SUBSTITUTE-SERVER-1 is done building the package, installing the package automatically downloads binaries from there (see Substitutes).  The only place where human intervention is needed is to review and apply the patch.

Software Freedom
----------------

The GNU operating system has been developed so that users can have freedom in their computing.  GNU is free software, meaning that users have the four essential freedoms (https://www.gnu.org/philosophy/free-sw.html): to run the program, to study and change the program in source code form, to redistribute exact copies, and to distribute modified versions.  Packages found in the GNU distribution provide only software that conveys these four freedoms.

In addition, the GNU distribution follow the free software distribution guidelines (https://www.gnu.org/distros/free-system-distribution-guidelines.html).  Among other things, these guidelines reject non-free firmware, recommendations of non-free software, and discuss ways to deal with trademarks and patents.

Some otherwise free upstream package sources contain a small and optional subset that violates the above guidelines, for instance because this subset is itself non-free code.  When that happens, the offending items are removed with appropriate patches or code snippets in the origin form of the package (see Defining Packages).  This way, guix build --source returns the ``freed&apos;&apos; source rather than the unmodified upstream source.

Package Naming
--------------

A package actually has two names associated with it. First, there is the name of the Scheme variable, the one following define-public.  By this name, the package can be made known in the Scheme code, for instance as input to another package.  Second, there is the string in the name field of a package definition.  This name is used by package management commands such as guix package and guix build.

Both are usually the same and correspond to the lowercase conversion of the project name chosen upstream, with underscores replaced with hyphens.  For instance, GNUnet is available as gnunet, and SDL_net as sdl-net.

A noteworthy exception to this rule is when the project name is only a single character, or if an older maintained project with the same name already exists---regardless of whether it has already been packaged for Guix.  Use common sense to make such names unambiguous and meaningful. For example, Guix&apos;s package for the shell called ``s&apos;&apos; upstream is s-shell and not s.  Feel free to ask your fellow hackers for inspiration.

We do not add lib prefixes for library packages, unless these are already part of the official project name.  But see Python Modules and Perl Modules for special rules concerning modules for the Python and Perl languages.

Font package names are handled differently, see Fonts.

Version Numbers
---------------

We usually package only the latest version of a given free software project.  But sometimes, for instance for incompatible library versions, two (or more) versions of the same package are needed.  These require different Scheme variable names.  We use the name as defined in Package Naming for the most recent version; previous versions use the same name, suffixed by - and the smallest prefix of the version number that may distinguish the two versions.

The name inside the package definition is the same for all versions of a package and does not contain any version number.

For instance, the versions 2.24.20 and 3.9.12 of GTK+ may be packaged as follows:

     (define-public gtk+
       (package
         (name &quot;gtk+&quot;)
         (version &quot;3.9.12&quot;)
         ...))
     (define-public gtk+-2
       (package
         (name &quot;gtk+&quot;)
         (version &quot;2.24.20&quot;)
         ...))

If we also wanted GTK+ 3.8.2, this would be packaged as

     (define-public gtk+-3.8
       (package
         (name &quot;gtk+&quot;)
         (version &quot;3.8.2&quot;)
         ...))

Occasionally, we package snapshots of upstream&apos;s version control system (VCS) instead of formal releases.  This should remain exceptional, because it is up to upstream developers to clarify what the stable release is.  Yet, it is sometimes necessary.  So, what should we put in the version field?

Clearly, we need to make the commit identifier of the VCS snapshot visible in the version string, but we also need to make sure that the version string is monotonically increasing so that guix package --upgrade can determine which version is newer.  Since commit identifiers, notably with Git, are not monotonically increasing, we add a revision number that we increase each time we upgrade to a newer snapshot.  The resulting version string looks like this:

     2.0.11-3.cabba9e
       ^    ^    ^
       |    |    `-- upstream commit ID
       |    |
       |    `--- Guix package revision
       |
     latest upstream version

It is a good idea to strip commit identifiers in the version field to, say, 7 digits.  It avoids an aesthetic annoyance (assuming aesthetics have a role to play here) as well as problems related to OS limits such as the maximum shebang length (127 bytes for the Linux kernel).  There are helper functions for doing this for packages using git-fetch or hg-fetch (see below).  It is best to use the full commit identifiers in origins, though, to avoid ambiguities. A typical package definition may look like this:

     (define my-package
       (let ((commit &quot;c3f29bc928d5900971f65965feaae59e1272a3f7&quot;)
             (revision &quot;1&quot;))          ;Guix package revision
         (package
           (version (git-version &quot;0.9&quot; revision commit))
           (source (origin
                     (method git-fetch)
                     (uri (git-reference
                           (url &quot;git://example.org/my-package.git&quot;)
                           (commit commit)))
                     (sha256 (base32 &quot;1mbikn...&quot;))
                     (file-name (git-file-name name version))))
           ;; ...
           )))

 -- Procedure: git-version VERSION REVISION COMMIT
     Return the version string for packages using git-fetch.

          (git-version &quot;0.2.3&quot; &quot;0&quot; &quot;93818c936ee7e2f1ba1b315578bde363a7d43d05&quot;)
          => &quot;0.2.3-0.93818c9&quot;

 -- Procedure: hg-version VERSION REVISION CHANGESET
     Return the version string for packages using hg-fetch.  It works in the same way as git-version.

Synopses and Descriptions
-------------------------

As we have seen before, each package in GNU Guix includes a synopsis and a description (see Defining Packages).  Synopses and descriptions are important: They are what guix package --search searches, and a crucial piece of information to help users determine whether a given package suits their needs.  Consequently, packagers should pay attention to what goes into them.

Synopses must start with a capital letter and must not end with a period.  They must not start with ``a&apos;&apos; or ``the&apos;&apos;, which usually does not bring anything; for instance, prefer ``File-frobbing tool&apos;&apos; over ``A tool that frobs files&apos;&apos;.  The synopsis should say what the package is---e.g., ``Core GNU utilities (file, text, shell)&apos;&apos;---or what it is used for---e.g., the synopsis for GNU grep is ``Print lines matching a pattern&apos;&apos;.

Keep in mind that the synopsis must be meaningful for a very wide audience.  For example, ``Manipulate alignments in the SAM format&apos;&apos; might make sense for a seasoned bioinformatics researcher, but might be fairly unhelpful or even misleading to a non-specialized audience.  It is a good idea to come up with a synopsis that gives an idea of the application domain of the package.  In this example, this might give something like ``Manipulate nucleotide sequence alignments&apos;&apos;, which hopefully gives the user a better idea of whether this is what they are looking for.

Descriptions should take between five and ten lines.  Use full sentences, and avoid using acronyms without first introducing them. Please avoid marketing phrases such as ``world-leading&apos;&apos;, ``industrial-strength&apos;&apos;, and ``next-generation&apos;&apos;, and avoid superlatives like ``the most advanced&apos;&apos;---they are not helpful to users looking for a package and may even sound suspicious.  Instead, try to be factual, mentioning use cases and features.

Descriptions can include Texinfo markup, which is useful to introduce ornaments such as @code or @dfn, bullet lists, or hyperlinks (see Overview (GNU Texinfo)).  However you should be careful when using some characters for example @ and curly braces which are the basic special characters in Texinfo (see Special Characters (GNU Texinfo)).  User interfaces such as guix show take care of rendering it appropriately.

Synopses and descriptions are translated by volunteers at Weblate (https://translate.fedoraproject.org/projects/guix/packages) so that as many users as possible can read them in their native language.  User interfaces search them and display them in the language specified by the current locale.

To allow xgettext to extract them as translatable strings, synopses and descriptions must be literal strings.  This means that you cannot use string-append or format to construct these strings:

     (package
       ;; ...
       (synopsis &quot;This is translatable&quot;)
       (description (string-append &quot;This is &quot; &quot;*not*&quot; &quot; translatable.&quot;)))

Translation is a lot of work so, as a packager, please pay even more attention to your synopses and descriptions as every change may entail additional work for translators.  In order to help them, it is possible to make recommendations or instructions visible to them by inserting special comments like this (see xgettext Invocation (GNU Gettext)):

     ;; TRANSLATORS: &quot;X11 resize-and-rotate&quot; should not be translated.
     (description &quot;ARandR is designed to provide a simple visual front end
     for the X11 resize-and-rotate (RandR) extension. ...&quot;)

Snippets versus Phases
----------------------

The boundary between using an origin snippet versus a build phase to modify the sources of a package can be elusive.  Origin snippets are typically used to remove unwanted files such as bundled libraries, nonfree sources, or to apply simple substitutions.  The source derived from an origin should produce a source that can be used to build the package on any system that the upstream package supports (i.e., act as the corresponding source).  In particular, origin snippets must not embed store items in the sources; such patching should rather be done using build phases.  Refer to the origin record documentation for more information (see origin Reference).

Cyclic Module Dependencies
--------------------------

While there cannot be circular dependencies between packages, Guile&apos;s lax module loading mechanism allows circular dependencies between Guile modules, which doesn&apos;t cause problems as long as the following conditions are followed for two modules part of a dependency cycle:

 1. Macros are not shared between the co-dependent modules

 2. Top-level variables are only referenced in delayed (thunked) package fields: arguments, native-inputs, inputs, propagated-inputs or replacement

 3. Procedures referencing top-level variables from another module are not called at the top level of a module themselves.

Straying away from the above rules may work while there are no dependency cycles between modules, but given such cycles are confusing and difficult to troubleshoot, it is best to follow the rules to avoid introducing problems down the line.

Here is a common trap to avoid:

     (define-public avr-binutils
       (package
         (inherit (cross-binutils &quot;avr&quot;))
         (name &quot;avr-binutils&quot;)))

In the above example, the avr-binutils package was defined in the module (gnu packages avr), and the cross-binutils procedure in (gnu packages cross-base).  Because the inherit field is not delayed (thunked), it is evaluated at the top level at load time, which is problematic in the presence of module dependency cycles.  This could be resolved by turning the package into a procedure instead, like:

     (define (make-avr-binutils)
       (package
         (inherit (cross-binutils &quot;avr&quot;))
         (name &quot;avr-binutils&quot;)))

Care would need to be taken to ensure the above procedure is only ever used in a package delayed fields or within another procedure also not called at the top level.

Emacs Packages
--------------

Emacs packages should preferably use the Emacs build system (see emacs-build-system), for uniformity and the benefits provided by its build phases, such as the auto-generation of the autoloads file and the byte compilation of the sources.  Because there is no standardized way to run a test suite for Emacs packages, tests are disabled by default.  When a test suite is available, it should be enabled by setting the #:tests? argument to #true.  By default, the command to run the test is make check, but any command can be specified via the #:test-command argument.  The #:test-command argument expects a list containing a command and its arguments, to be invoked during the check phase.

The Elisp dependencies of Emacs packages are typically provided as propagated-inputs when required at run time.  As for other packages, build or test dependencies should be specified as native-inputs.

Emacs packages sometimes depend on resources directories that should be installed along the Elisp files.  The #:include argument can be used for that purpose, by specifying a list of regexps to match.  The best practice when using the #:include argument is to extend rather than override its default value (accessible via the %default-include variable).  As an example, a yasnippet extension package typically include a snippets directory, which could be copied to the installation directory using:

     #:include (cons &quot;^snippets/&quot; %default-include)

When encountering problems, it is wise to check for the presence of the Package-Requires extension header in the package main source file, and whether any dependencies and their versions listed therein are satisfied.

Python Modules
--------------

We currently package Python 2 and Python 3, under the Scheme variable names python-2 and python as explained in Version Numbers. To avoid confusion and naming clashes with other programming languages, it seems desirable that the name of a package for a Python module contains the word python.

Some modules are compatible with only one version of Python, others with both.  If the package Foo is compiled with Python 3, we name it python-foo.  If it is compiled with Python 2, we name it python2-foo.  Python 2 packages are being removed from the distribution; please do no not submit any new Python 2 packages.

If a project already contains the word python, we drop this; for instance, the module python-dateutil is packaged under the names python-dateutil and python2-dateutil.  If the project name starts with py (e.g. pytz), we keep it and prefix it as described above.

     Currently there are two different build systems for Python packages in Guix: PYTHON-BUILD-SYSTEM and PYPROJECT-BUILD-SYSTEM.  For the longest time, Python packages were built from an informally specified setup.py file.  That worked amazingly well, considering Python&apos;s success, but was difficult to build tooling around.  As a result, a host of alternative build systems emerged and the community eventually settled on a formal standard (https://peps.python.org/pep-0517/) for specifying build requirements.  PYPROJECT-BUILD-SYSTEM is Guix&apos;s implementation of this standard.  It is considered ``experimental&apos;&apos; in that it does not yet support all the various PEP-517 build backends, but you are encouraged to try it for new Python packages and report any problems.  It will eventually be deprecated and merged into PYTHON-BUILD-SYSTEM.

Specifying Dependencies
.......................

Dependency information for Python packages is usually available in the package source tree, with varying degrees of accuracy: in the pyproject.toml file, the setup.py file, in requirements.txt, or in tox.ini (the latter mostly for test dependencies).

Your mission, when writing a recipe for a Python package, is to map these dependencies to the appropriate type of ``input&apos;&apos; (see inputs).  Although the pypi importer normally does a good job (see Invoking guix import), you may want to check the following check list to determine which dependency goes where.

  * We currently package Python with setuptools and pip installed per default.  This is about to change, and users are encouraged to use python-toolchain if they want a build environment for Python.

     guix lint will warn if setuptools or pip are added as native-inputs because they are generally not necessary.

  * Python dependencies required at run time go into propagated-inputs.  They are typically defined with the install_requires keyword in setup.py, or in the requirements.txt file.

  * Python packages required only at build time---e.g., those listed under build-system.requires in pyproject.toml or with the setup_requires keyword in setup.py---or dependencies only for testing---e.g., those in tests_require or tox.ini---go into native-inputs.  The rationale is that (1) they do not need to be propagated because they are not needed at run time, and (2) in a cross-compilation context, it&apos;s the ``native&apos;&apos; input that we&apos;d want.

     Examples are the pytest, mock, and nose test frameworks.  Of course if any of these packages is also required at run-time, it needs to go to propagated-inputs.

  * Anything that does not fall in the previous categories goes to inputs, for example programs or C libraries required for building Python packages containing C extensions.

  * If a Python package has optional dependencies (extras_require), it is up to you to decide whether to add them or not, based on their usefulness/overhead ratio (see guix size).

Perl Modules
------------

Perl programs standing for themselves are named as any other package, using the lowercase upstream name. For Perl packages containing a single class, we use the lowercase class name, replace all occurrences of :: by dashes and prepend the prefix perl-. So the class XML::Parser becomes perl-xml-parser. Modules containing several classes keep their lowercase upstream name and are also prepended by perl-.  Such modules tend to have the word perl somewhere in their name, which gets dropped in favor of the prefix.  For instance, libwww-perl becomes perl-libwww.

Java Packages
-------------

Java programs standing for themselves are named as any other package, using the lowercase upstream name.

To avoid confusion and naming clashes with other programming languages, it is desirable that the name of a package for a Java package is prefixed with java-.  If a project already contains the word java, we drop this; for instance, the package ngsjava is packaged under the name java-ngs.

For Java packages containing a single class or a small class hierarchy, we use the lowercase class name, replace all occurrences of . by dashes and prepend the prefix java-.  So the class apache.commons.cli becomes package java-apache-commons-cli.

Rust Crates
-----------

Rust programs standing for themselves are named as any other package, using the lowercase upstream name.

To prevent namespace collisions we prefix all other Rust packages with the rust- prefix.  The name should be changed to lowercase as appropriate and dashes should remain in place.

In the rust ecosystem it is common for multiple incompatible versions of a package to be used at any given time, so all package definitions should have a versioned suffix.  The versioned suffix is the left-most non-zero digit (and any leading zeros, of course).  This follows the ``caret&apos;&apos; version scheme intended by Cargo.  Examples rust-clap-2, rust-rand-0.6.

Because of the difficulty in reusing rust packages as pre-compiled inputs for other packages the Cargo build system (see cargo-build-system) presents the #:cargo-inputs and cargo-development-inputs keywords as build system arguments.  It would be helpful to think of these as similar to propagated-inputs and native-inputs.  Rust dependencies and build-dependencies should go in #:cargo-inputs, and dev-dependencies should go in #:cargo-development-inputs.  If a Rust package links to other libraries then the standard placement in inputs and the like should be used.

Care should be taken to ensure the correct version of dependencies are used; to this end we try to refrain from skipping the tests or using #:skip-build? when possible.  Of course this is not always possible, as the package may be developed for a different Operating System, depend on features from the Nightly Rust compiler, or the test suite may have atrophied since it was released.

Elm Packages
------------

Elm applications can be named like other software: their names need not mention Elm.

Packages in the Elm sense (see elm-build-system under Build Systems) are required use names of the format AUTHOR/PROJECT, where both the AUTHOR and the PROJECT may contain hyphens internally, and the AUTHOR sometimes contains uppercase letters.

To form the Guix package name from the upstream name, we follow a convention similar to Python packages (see Python Modules), adding an elm- prefix unless the name would already begin with elm-.

In many cases we can reconstruct an Elm package&apos;s upstream name heuristically, but, since conversion to a Guix-style name involves a loss of information, this is not always possible.  Care should be taken to add the &apos;upstream-name property when necessary so that guix import elm will work correctly (see Invoking guix import). The most notable scenarios when explicitly specifying the upstream name is necessary are:

 1. When the AUTHOR is elm and the PROJECT contains one or more hyphens, as with elm/virtual-dom; and

 2. When the AUTHOR contains hyphens or uppercase letters, as with Elm-Canvas/raster-shapes---unless the AUTHOR is elm-explorations, which is handled as a special case, so packages like elm-explorations/markdown do not need to use the &apos;upstream-name property.

The module (guix build-system elm) provides the following utilities for working with names and related conventions:

 -- Procedure: elm-package-origin ELM-NAME VERSION
     HASH
     Returns a Git origin using the repository naming and tagging regime required for a published Elm package with the upstream name ELM-NAME at version VERSION with sha256 checksum HASH.

     For example:

          (package
            (name &quot;elm-html&quot;)
            (version &quot;1.0.0&quot;)
            (source
             (elm-package-origin
              &quot;elm/html&quot;
              version
              (base32 &quot;15k1679ja57vvlpinpv06znmrxy09lbhzfkzdc89i01qa8c4gb4a&quot;)))
            ...)

 -- Procedure: elm-&gt;package-name ELM-NAME
     Returns the Guix-style package name for an Elm package with upstream name ELM-NAME.

     Note that there is more than one possible ELM-NAME for which elm-&gt;package-name will produce a given result.

 -- Procedure: guix-package-&gt;elm-name PACKAGE
     Given an Elm PACKAGE, returns the possibly-inferred upstream name, or #f the upstream name is not specified via the &apos;upstream-name property and can not be inferred by infer-elm-package-name.

 -- Procedure: infer-elm-package-name GUIX-NAME
     Given the GUIX-NAME of an Elm package, returns the inferred upstream name, or #f if the upstream name can&apos;t be inferred.  If the result is not #f, supplying it to elm-&gt;package-name would produce GUIX-NAME.

Fonts
-----

For fonts that are in general not installed by a user for typesetting purposes, or that are distributed as part of a larger software package, we rely on the general packaging rules for software; for instance, this applies to the fonts delivered as part of the X.Org system or fonts that are part of TeX Live.

To make it easier for a user to search for fonts, names for other packages containing only fonts are constructed as follows, independently of the upstream package name.

The name of a package containing only one font family starts with font-; it is followed by the foundry name and a dash - if the foundry is known, and the font family name, in which spaces are replaced by dashes (and as usual, all upper case letters are transformed to lower case). For example, the Gentium font family by SIL is packaged under the name font-sil-gentium.

For a package containing several font families, the name of the collection is used in the place of the font family name. For instance, the Liberation fonts consist of three families, Liberation Sans, Liberation Serif and Liberation Mono. These could be packaged separately under the names font-liberation-sans and so on; but as they are distributed together under a common name, we prefer to package them together as font-liberation.

In the case where several formats of the same font family or font collection are packaged separately, a short form of the format, prepended by a dash, is added to the package name.  We use -ttf for TrueType fonts, -otf for OpenType fonts and -type1 for PostScript Type 1 fonts.

Coding Style
============

In general our code follows the GNU Coding Standards (see GNU Coding Standards).  However, they do not say much about Scheme, so here are some additional rules.

Programming Paradigm
--------------------

Scheme code in Guix is written in a purely functional style.  One exception is code that involves input/output, and procedures that implement low-level concepts, such as the memoize procedure.

Modules
-------

Guile modules that are meant to be used on the builder side must live in the (guix build ...) name space.  They must not refer to other Guix or GNU modules.  However, it is OK for a ``host-side&apos;&apos; module to use a build-side module.  As an example, the (guix search-paths) module should not be imported and used by a package since it isn&apos;t meant to be used as a ``build-side&apos;&apos; module.  It would also couple the module with the package&apos;s dependency graph, which is undesirable.

Modules that deal with the broader GNU system should be in the (gnu ...) name space rather than (guix ...).

Data Types and Pattern Matching
-------------------------------

The tendency in classical Lisp is to use lists to represent everything, and then to browse them ``by hand&apos;&apos; using car, cdr, cadr, and co.  There are several problems with that style, notably the fact that it is hard to read, error-prone, and a hindrance to proper type error reports.

Guix code should define appropriate data types (for instance, using define-record-type*) rather than abuse lists.  In addition, it should use pattern matching, via Guile’s (ice-9 match) module, especially when matching lists (see Pattern Matching (GNU Guile Reference Manual)); pattern matching for records is better done using match-record from (guix records), which, unlike match, verifies field names at macro-expansion time.

When defining a new record type, keep the record type descriptor (RTD) private (see Records (GNU Guile Reference Manual), for more on records and RTDs).  As an example, the (guix packages) module defines &lt;package&gt; as the RTD for package records but it does not export it; instead, it exports a type predicate, a constructor, and field accessors.  Exporting RTDs would make it harder to change the application binary interface (because code in other modules might be matching fields by position) and would make it trivial for users to forge records of that type, bypassing any checks we may have in the official constructor (such as ``field sanitizers&apos;&apos;).

Formatting Code
---------------

When writing Scheme code, we follow common wisdom among Scheme programmers.  In general, we follow the Riastradh&apos;s Lisp Style Rules (https://mumble.net/~campbell/scheme/style.txt).  This document happens to describe the conventions mostly used in Guile’s code too.  It is very thoughtful and well written, so please do read it.

Some special forms introduced in Guix, such as the substitute* macro, have special indentation rules.  These are defined in the .dir-locals.el file, which Emacs automatically uses.  Also note that Emacs-Guix provides guix-devel-mode mode that indents and highlights Guix code properly (see Development (The Emacs-Guix Reference Manual)).

If you do not use Emacs, please make sure to let your editor knows these rules.  To automatically indent a package definition, you can also run:

     ./pre-inst-env guix style PACKAGE

See Invoking guix style, for more information.

We require all top-level procedures to carry a docstring.  This requirement can be relaxed for simple private procedures in the (guix build ...) name space, though.

Procedures should not have more than four positional parameters.  Use keyword parameters for procedures that take more than four parameters.

Submitting Patches
==================

Development is done using the Git distributed version control system. Thus, access to the repository is not strictly necessary.  We welcome contributions in the form of patches as produced by git format-patch sent to the guix-patches@gnu.org mailing list (see Submitting patches to a project (Git User Manual)). Contributors are encouraged to take a moment to set some Git repository options (see Configuring Git) first, which can improve the readability of patches.  Seasoned Guix developers may also want to look at the section on commit access (see Commit Access).

This mailing list is backed by a Debbugs instance, which allows us to keep track of submissions (see Tracking Bugs and Changes). Each message sent to that mailing list gets a new tracking number assigned; people can then follow up on the submission by sending email to ISSUE_NUMBER@debbugs.gnu.org, where ISSUE_NUMBER is the tracking number (see Sending a Patch Series).

Please write commit logs in the ChangeLog format (see Change Logs (GNU Coding Standards)); you can check the commit history for examples.

You can help make the review process more efficient, and increase the chance that your patch will be reviewed quickly, by describing the context of your patch and the impact you expect it to have.  For example, if your patch is fixing something that is broken, describe the problem and how your patch fixes it.  Tell us how you have tested your patch.  Will users of the code changed by your patch have to adjust their workflow at all?  If so, tell us how.  In general, try to imagine what questions a reviewer will ask, and answer those questions in advance.

Before submitting a patch that adds or modifies a package definition, please run through this check list:

 1. If the authors of the packaged software provide a cryptographic signature for the release tarball, make an effort to verify the authenticity of the archive.  For a detached GPG signature file this would be done with the gpg --verify command.

 2. Take some time to provide an adequate synopsis and description for the package.  See Synopses and Descriptions, for some guidelines.

 3. Run guix lint PACKAGE, where PACKAGE is the name of the new or modified package, and fix any errors it reports (see Invoking guix lint).

 4. Run guix style PACKAGE to format the new package definition according to the project&apos;s conventions (see Invoking guix style).

 5. Make sure the package builds on your platform, using guix build PACKAGE.  Also build at least its direct dependents with guix build --dependents=1 PACKAGE (see guix build).

 6. We recommend you also try building the package on other supported platforms.  As you may not have access to actual hardware platforms, we recommend using the qemu-binfmt-service-type to emulate them.  In order to enable it, add the virtualization service module and the following service to the list of services in your operating-system configuration:

          (service qemu-binfmt-service-type
           (qemu-binfmt-configuration
             (platforms (lookup-qemu-platforms &quot;arm&quot; &quot;aarch64&quot;))))

     Then reconfigure your system.

     You can then build packages for different platforms by specifying the --system option.  For example, to build the &quot;hello&quot; package for the armhf or aarch64 architectures, you would run the following commands, respectively:

          guix build --system=armhf-linux --rounds=2 hello
          guix build --system=aarch64-linux --rounds=2 hello

 7. Make sure the package does not use bundled copies of software already available as separate packages.

     Sometimes, packages include copies of the source code of their dependencies as a convenience for users.  However, as a distribution, we want to make sure that such packages end up using the copy we already have in the distribution, if there is one.  This improves resource usage (the dependency is built and stored only once), and allows the distribution to make transverse changes such as applying security updates for a given software package in a single place and have them affect the whole system---something that bundled copies prevent.

 8. Take a look at the profile reported by guix size (see Invoking guix size).  This will allow you to notice references to other packages unwillingly retained.  It may also help determine whether to split the package (see Packages with Multiple Outputs), and which optional dependencies should be used.  In particular, avoid adding texlive as a dependency: because of its extreme size, use texlive-updmap.cfg procedure instead.

 9. Check that dependent packages (if applicable) are not affected by the change; guix refresh --list-dependent PACKAGE will help you do that (see Invoking guix refresh).

 10. Check whether the package&apos;s build process is deterministic.  This typically means checking whether an independent build of the package yields the exact same result that you obtained, bit for bit.

     A simple way to do that is by building the same package several times in a row on your machine (see Invoking guix build):

          guix build --rounds=2 my-package

     This is enough to catch a class of common non-determinism issues, such as timestamps or randomly-generated output in the build result.

     Another option is to use guix challenge (see Invoking guix challenge).  You may run it once the package has been committed and built by SUBSTITUTE-SERVER-1 to check whether it obtains the same result as you did.  Better yet: Find another machine that can build it and run guix publish.  Since the remote build machine is likely different from yours, this can catch non-determinism issues related to the hardware---e.g., use of different instruction set extensions---or to the operating system kernel---e.g., reliance on uname or /proc files.

 11. When writing documentation, please use gender-neutral wording when referring to people, such as singular ``they&apos;&apos;, ``their&apos;&apos;, ``them&apos;&apos; (https://en.wikipedia.org/wiki/Singular_they), and so forth.

 12. Verify that your patch contains only one set of related changes. Bundling unrelated changes together makes reviewing harder and slower.

     Examples of unrelated changes include the addition of several packages, or a package update along with fixes to that package.

 13. Please follow our code formatting rules, possibly running guix style script to do that automatically for you (see Formatting Code).

 14. When possible, use mirrors in the source URL (see Invoking guix download). Use reliable URLs, not generated ones.  For instance, GitHub archives are not necessarily identical from one generation to the next, so in this case it&apos;s often better to clone the repository.  Don&apos;t use the name field in the URL: it is not very useful and if the name changes, the URL will probably be wrong.

 15. Check if Guix builds (see Building from Git) and address the warnings, especially those about use of undefined symbols.

 16. Make sure your changes do not break Guix and simulate a guix pull with:

          guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master

When posting a patch to the mailing list, use [PATCH] ... as a subject, if your patch is to be applied on a branch other than master, say core-updates, specify it in the subject like [PATCH core-updates] ....

You may use your email client, the git send-email command (see Sending a Patch Series) or the mumi send-email command (see Debbugs User Interfaces).  We prefer to get patches in plain text messages, either inline or as MIME attachments.  You are advised to pay attention if your email client changes anything like line breaks or indentation which could potentially break the patches.

Expect some delay when you submit your very first patch to guix-patches@gnu.org. You have to wait until you get an acknowledgement with the assigned tracking number. Future acknowledgements should not be delayed.

When a bug is resolved, please close the thread by sending an email to ISSUE_NUMBER-done@debbugs.gnu.org.

Configuring Git
---------------

If you have not done so already, you may wish to set a name and email that will be associated with your commits (see Telling Git your name (Git User Manual)).  If you wish to use a different name or email just for commits in this repository, you can use git config --local, or edit .git/config in the repository instead of ~/.gitconfig.

Other important Git configuration will automatically be configured when building the project (see Building from Git).  A .git/hooks/commit-msg hook will be installed that embeds Change-Id Git trailers in your commit messages for traceability purposes.  It is important to preserve these when editing your commit messages, particularly if a first version of your proposed changes was already submitted for review.  If you have a commit-msg hook of your own you would like to use with Guix, you can place it under the .git/hooks/commit-msg.d/ directory.

Sending a Patch Series
----------------------

Single Patches
..............

The git send-email command is the best way to send both single patches and patch series (see Multiple Patches) to the Guix mailing list.  Sending patches as email attachments may make them difficult to review in some mail clients, and git diff does not store commit metadata.

     The git send-email command is provided by the send-email output of the git package, i.e. git:send-email.

The following command will create a patch email from the latest commit, open it in your EDITOR or VISUAL for editing, and send it to the Guix mailing list to be reviewed and merged.  Assuming you have already configured Git according to see Configuring Git, you can simply use:

     $ git send-email --annotate -1

     To add a prefix to the subject of your patch, you may use the --subject-prefix option.  The Guix project uses this to specify that the patch is intended for a branch or repository other than the master branch of https://git.savannah.gnu.org/cgit/guix.git.

          git send-email --annotate --subject-prefix=&apos;PATCH core-updates&apos; -1

The patch email contains a three-dash separator line after the commit message.  You may ``annotate&apos;&apos; the patch with explanatory text by adding it under this line.  If you do not wish to annotate the email, you may drop the --annotate option.

If you need to send a revised patch, don&apos;t resend it like this or send a ``fix&apos;&apos; patch to be applied on top of the last one; instead, use git commit --amend or git rebase (https://git-rebase.io) to modify the commit, and use the ISSUE_NUMBER@debbugs.gnu.org address and the -v flag with git send-email.

     $ git commit --amend
     $ git send-email --annotate -vREVISION \
           --to=ISSUE_NUMBER@debbugs.gnu.org -1

     Due to an apparent bug in git send-email, -v REVISION (with the space) will not work; you must use -vREVISION.

You can find out ISSUE_NUMBER either by searching on the mumi interface at https://issues.guix.gnu.org for the name of your patch or reading the acknowledgement email sent automatically by Debbugs in reply to incoming bugs and patches, which contains the bug number.

Notifying Teams
...............

If your git checkout has been correctly configured (see Configuring Git), the git send-email command will automatically notify the appropriate team members, based on the scope of your changes.  This relies on the etc/teams.scm script, which can also be invoked manually if you do not use the preferred git send-email command to submit patches.  To list the available actions of the script, you can invoke it via the etc/teams.scm help command.  For more information regarding teams, see Teams.

     On foreign distros, you might have to use ./pre-inst-env git send-email for etc/teams.scm to work.

Multiple Patches
................

While git send-email alone will suffice for a single patch, an unfortunate flaw in Debbugs means you need to be more careful when sending multiple patches: if you send them all to the guix-patches@gnu.org address, a new issue will be created for each patch!

When sending a series of patches, it&apos;s best to send a Git ``cover letter&apos;&apos; first, to give reviewers an overview of the patch series. We can create a directory called outgoing containing both our patch series and a cover letter called 0000-cover-letter.patch with git format-patch.

     $ git format-patch -NUMBER_COMMITS -o outgoing \
           --cover-letter

     git format-patch accepts a wide range of revision range (https://git-scm.com/docs/gitrevisions) specifiers. For example, if you are working in a branch, you could select all commits in your branch starting at master.

          $ git format-patch master..MY_BRANCH -o outgoing \
                --cover-letter

We can now send just the cover letter to the guix-patches@gnu.org address, which will create an issue that we can send the rest of the patches to.

     $ git send-email outgoing/0000-cover-letter.patch --annotate
     $ rm outgoing/0000-cover-letter.patch # we don&apos;t want to resend it!

Ensure you edit the email to add an appropriate subject line and blurb before sending it.  Note the automatically generated shortlog and diffstat below the blurb.

Once the Debbugs mailer has replied to your cover letter email, you can send the actual patches to the newly-created issue address.

     $ git send-email outgoing/*.patch --to=ISSUE_NUMBER@debbugs.gnu.org
     $ rm -rf outgoing # we don&apos;t need these anymore

Thankfully, this git format-patch dance is not necessary to send an amended patch series, since an issue already exists for the patchset.

     $ git send-email -NUMBER_COMMITS -vREVISION \
           --to=ISSUE_NUMBER@debbugs.gnu.org

If need be, you may use --cover-letter --annotate to send another cover letter, e.g. for explaining what&apos;s changed since the last revision, and these changes are necessary.

Tracking Bugs and Changes
=========================

This section describes how the Guix project tracks its bug reports, patch submissions and topic branches.

The Issue Tracker
-----------------

Bug reports and patch submissions are currently tracked using the Debbugs instance at https://bugs.gnu.org.  Bug reports are filed against the guix ``package&apos;&apos; (in Debbugs parlance), by sending email to bug-guix@gnu.org, while patch submissions are filed against the guix-patches package by sending email to guix-patches@gnu.org (see Submitting Patches).

Managing Patches and Branches
-----------------------------

Changes should be posted to guix-patches@gnu.org.  This mailing list fills the patch-tracking database (see The Issue Tracker).  It also allows patches to be picked up and tested by the quality assurance tooling; the result of that testing eventually shows up on the dashboard at https://qa.guix.gnu.org/issue/ISSUE_NUMBER, where ISSUE_NUMBER is the number assigned by the issue tracker.  Leave time for a review, without committing anything.

As an exception, some changes considered ``trivial&apos;&apos; or ``obvious&apos;&apos; may be pushed directly to the master branch.  This includes changes to fix typos and reverting commits that caused immediate problems.  This is subject to being adjusted, allowing individuals to commit directly on non-controversial changes on parts they’re familiar with.

Changes which affect more than 300 dependent packages (see Invoking guix refresh) should first be pushed to a topic branch other than master; the set of changes should be consistent---e.g., ``GNOME update&apos;&apos;, ``NumPy update&apos;&apos;, etc.  This allows for testing: the branch will automatically show up at https://qa.guix.gnu.org/branch/BRANCH, with an indication of its build status on various platforms.

To help coordinate the merging of branches, you must create a new guix-patches issue each time you create a branch (see The Issue Tracker).  The title of the issue requesting to merge a branch should have the following format:

     Request for merging &quot;NAME&quot; branch

The QA infrastructure (https://qa.guix.gnu.org/) recognizes such issues and lists the merge requests on its main page.  The following points apply to managing these branches:

 1. The commits on the branch should be a combination of the patches relevant to the branch.  Patches not related to the topic of the branch should go elsewhere.

 2. Any changes that can be made on the master branch, should be made on the master branch.  If a commit can be split to apply part of the changes on master, this is good to do.

 3. It should be possible to re-create the branch by starting from master and applying the relevant patches.

 4. Avoid merging master in to the branch.  Prefer rebasing or re-creating the branch on top of an updated master revision.

 5. Minimise the changes on master that are missing on the branch prior to merging the branch in to master.  This means that the state of the branch better reflects the state of master should the branch be merged.

 6. If you don&apos;t have commit access, create the ``Request for merging&apos;&apos; issue and request that someone creates the branch.  Include a list of issues/patches to include on the branch.

Normally branches will be merged in a ``first come, first merged&apos;&apos; manner, tracked through the guix-patches issues.  If you agree on a different order with those involved, you can track this by updating which issues block (You can mark an issue as blocked by another by emailing control@debbugs.gnu.org with the following line in the body of the email: block XXXXX by YYYYY.  Where XXXXX is the number for the blocked issue, and YYYYY is the number for the issue blocking it.) which other issues.  Therefore, to know which branch is at the front of the queue, look for the oldest issue, or the issue that isn&apos;t blocked by any other branch merges.  An ordered list of branches with the open issues is available at https://qa.guix.gnu.org.

Once a branch is at the front of the queue, wait until sufficient time has passed for the build farms to have processed the changes, and for the necessary testing to have happened.  For example, you can check https://qa.guix.gnu.org/branch/BRANCH to see information on some builds and substitute availability.

Once the branch has been merged, the issue should be closed and the branch deleted.

Sometimes, a branch may be a work in progress, for example for larger efforts such as updating the GNOME desktop.  In these cases, the branch name should reflect this by having the wip- prefix.  The QA infrastructure will avoid building work-in-progress branches, so that the available resources can be better focused on building the branches that are ready to be merged.  When the branch is no longer a work in progress, it should be renamed, with the wip- prefix removed, and only then should the merge requests be created, as documented earlier.

Debbugs User Interfaces
-----------------------

Web interface
.............

A web interface (actually two web interfaces!) are available to browse issues:

  * https://issues.guix.gnu.org provides a pleasant interface powered by mumi (Mumi is a nice piece of software written in Guile, and you can help!  See https://git.savannah.gnu.org/cgit/guix/mumi.git.) to browse bug reports and patches, and to participate in discussions; mumi also has a command-line interface as we will see below;

  * https://bugs.gnu.org/guix lists bug reports;

  * https://bugs.gnu.org/guix-patches lists patch submissions.

To view discussions related to issue number N, go to https://issues.guix.gnu.org/N or https://bugs.gnu.org/N.

Command-Line Interface
......................

Mumi also comes with a command-line interface that can be used to search existing issues, open new issues, compose replies, apply and send patches.  You do not need to use Emacs to use the mumi command-line client.  You interact with it only on the command-line.

To use the mumi command-line interface, navigate to a local clone of the Guix git repository, and drop into a shell with mumi, git and git:send-email installed.

     $ cd guix
     ~/guix$ guix shell mumi git git:send-email

To search for issues, say all open issues about &quot;zig&quot;, run

     ~/guix [env]$ mumi search zig is:open

     #60889 Add zig-build-system
     opened on 17 Jan 17:37 Z by Ekaitz Zarraga
     #61036 [PATCH 0/3] Update zig to 0.10.1
     opened on 24 Jan 09:42 Z by Efraim Flashner
     #39136 [PATCH] gnu: services: Add endlessh.
     opened on 14 Jan 2020 21:21 by Nicol? Balzarotti
     #60424 [PATCH] gnu: Add python-online-judge-tools
     opened on 30 Dec 2022 07:03 by gemmaro
     #45601 [PATCH 0/6] vlang 0.2 update
     opened on  1 Jan 2021 19:23 by Ryan Prior

Pick an issue and make it the &quot;current&quot; issue.

     ~/guix [env]$ mumi current 61036

     #61036 [PATCH 0/3] Update zig to 0.10.1
     opened on 24 Jan 09:42 Z by Efraim Flashner

Once an issue is the current issue, you can open the issue in a web browser, compose replies, apply patches, send patches, etc. with short succinct commands.

Open the issue in your web browser using

     ~/guix [env]$ mumi www

Compose a reply using

     ~/guix [env]$ mumi compose

Compose a reply and close the issue using

     ~/guix [env]$ mumi compose --close

mumi compose opens your mail client by passing mailto: URIs to xdg-open.  So, you need to have xdg-open set up to open your mail client correctly.

Apply the latest patchset from the issue using

     ~/guix [env]$ mumi am

You may also apply a patchset of a specific version (say, v3) using

     ~/guix [env]$ mumi am v3

Or, you may apply a patch from a specific e-mail message.  For example, to apply the patch from the 4th message (message index starts from 0), run

     ~/guix [env]$ mumi am @4

mumi am is a wrapper around git am.  You can pass git am arguments to it after a --.  For example, to add a Signed-off-by trailer, run

     ~/guix [env]$ mumi am -- -s

Create and send patches to the issue using

     ~/guix [env]$ git format-patch origin/master
     ~/guix [env]$ mumi send-email foo.patch bar.patch

Note that you do not have to pass in --to or --cc arguments to git format-patch.  mumi send-email will put them in correctly when sending the patches.

To open a new issue, run

     ~/guix [env]$ mumi new

and send an email (using mumi compose) or patches (using mumi send-email).

mumi send-email is really a wrapper around git send-email that automates away all the nitty-gritty of sending patches. It uses the current issue state to automatically figure out the correct To address to send to, other participants to Cc, headers to add, etc.

Also note that, unlike git send-email, mumi send-email works perfectly well with single and multiple patches alike. It automates away the debbugs dance of sending the first patch, waiting for a response from debbugs and sending the remaining patches.  It does so by sending the first patch, polling the server for a response, and then sending the remaining patches.  This polling can unfortunately take a few minutes.  So, please be patient.

Emacs Interface
...............

If you use Emacs, you may find it more convenient to interact with issues using debbugs.el, which you can install with:

     guix install emacs-debbugs

For example, to list all open issues on guix-patches, hit:

     C-u M-x debbugs-gnu RET RET guix-patches RET n y

For a more convenient (shorter) way to access both the bugs and patches submissions, you may want to configure the debbugs-gnu-default-packages and debbugs-gnu-default-severities Emacs variables (see Viewing Bugs within Emacs).

To search for bugs, M-x debbugs-gnu-guix-search can be used.

See Debbugs User Guide, for more information on this nifty tool!

Debbugs Usertags
----------------

Debbugs provides a feature called usertags that allows any user to tag any bug with an arbitrary label.  Bugs can be searched by usertag, so this is a handy way to organize bugs (The list of usertags is public information, and anyone can modify any user&apos;s list of usertags, so keep that in mind if you choose to use this feature.).  If you use Emacs Debbugs, the entry-point to consult existing usertags is the C-u M-x debbugs-gnu-usertags procedure.  To set a usertag, press C while consulting a bug within the *Guix-Patches* buffer opened with C-u M-x debbugs-gnu-bugs buffer, then select usertag and follow the instructions.

For example, to view all the bug reports (or patches, in the case of guix-patches) tagged with the usertag powerpc64le-linux for the user guix, open a URL like the following in a web browser: https://debbugs.gnu.org/cgi-bin/pkgreport.cgi?tag=powerpc64le-linux;users=guix.

For more information on how to use usertags, please refer to the documentation for Debbugs or the documentation for whatever tool you use to interact with Debbugs.

In Guix, we are experimenting with usertags to keep track of architecture-specific issues, as well as reviewed ones.  To facilitate collaboration, all our usertags are associated with the single user guix.  The following usertags currently exist for that user:

powerpc64le-linux
     The purpose of this usertag is to make it easy to find the issues that matter most for the powerpc64le-linux system type.  Please assign this usertag to bugs or patches that affect powerpc64le-linux but not other system types.  In addition, you may use it to identify issues that for some reason are particularly important for the powerpc64le-linux system type, even if the issue affects other system types, too.

reproducibility
     For issues related to reproducibility.  For example, it would be appropriate to assign this usertag to a bug report for a package that fails to build reproducibly.

reviewed-looks-good
     You have reviewed the series and it looks good to you (LGTM).

If you&apos;re a committer and you want to add a usertag, just start using it with the guix user.  If the usertag proves useful to you, consider updating this section of the manual so that others will know what your usertag means.

Cuirass Build Notifications
---------------------------

Cuirass includes RSS (Really Simple Syndication) feeds as one of its features (see Notifications (cuirass)).  Since Berlin (https://ci.guix.gnu.org/) runs an instance of Cuirass, this feature can be used to keep track of recently broken or fixed packages caused by changes pushed to the Guix git repository.  Any RSS client can be used.  A good one, included with Emacs, is see Gnus (gnus).  To register the feed, copy its URL, then from the main Gnus buffer, *Group*, do the following:

     G R https://ci.guix.gnu.org/events/rss/?specification=master RET
     Guix CI - master RET Build events for specification master. RET

Then, back at the *Group* buffer, press s to save the newly added RSS group.  As for any other Gnus group, you can update its content by pressing the g key.  You should now receive notifications that read like:

      . [ ?: Cuirass ] Build tree-sitter-meson.aarch64-linux on master is fixed.
      . [ ?: Cuirass ] Build rust-pbkdf2.aarch64-linux on master is fixed.
      . [ ?: Cuirass ] Build rust-pbkdf2.x86_64-linux on master is fixed.

where each RSS entry contains a link to the Cuirass build details page of the associated build.

Teams
=====

To organize work on Guix, including but not just development efforts, the project has a set of teams.  Each team has its own focus and interests and is the primary contact point for questions and contributions in those areas.  A team&apos;s primary mission is to coordinate and review the work of individuals in its scope (see Reviewing the Work of Others); it can make decisions within its scope, in agreement with other teams whenever there is overlap or a close connection, and in accordance with other project rules such as seeking consensus (see Making Decisions).

As an example, the Python team is responsible for core Python packaging matters; it can decide to upgrade core Python packages in a dedicated python-team branch, in collaboration with any team whose scope is directly dependent on Python---e.g., the Science team---and following branching rules (see Managing Patches and Branches).  The Documentation team helps review changes to the documentation and can initiate overarching documentation changes.  The Translations team organizes translation of Guix and its manual and coordinates efforts in that area.  The Core team is responsible for the development of core functionality and interfaces of Guix; because of its central nature, some of its work may require soliciting input from the community at large and seeking consensus before enacting decisions that would affect the entire community.

Teams are defined in the etc/teams.scm file in the Guix repository.  The scope of each team is defined, when applicable, as a set of files or as a regular expression matching file names.

Anyone with interest in a team&apos;s domain and willing to contribute to its work can apply to become a member by contacting current members by email; commit access is not a precondition.  Membership is formalized by adding the person&apos;s name and email address to etc/teams.scm. Members who have not been participating in the team&apos;s work for one year or more may be removed; they are free to reapply for membership later.

One or more people may propose the creation of a new team by reaching out to the community by email at guix-devel@gnu.org, clarifying the intended scope and purpose.  When consensus is reached on the creation of this team, someone with commit access formalizes its creation by adding it and its initial members to etc/teams.scm.

To list existing teams, run the following command from a Guix checkout:

     $ ./etc/teams.scm list-teams
     id: mentors
     name: Mentors
     description: A group of mentors who chaperone contributions by newcomers.
     members:
     + Charlie Smith &lt;charlie@example.org&gt;
     ...

You can run the following command to have the Mentors team put in CC of a patch series:

     $ git send-email --to=ISSUE_NUMBER@debbugs.gnu.org \
       --header-cmd=&apos;etc/teams.scm cc-mentors-header-cmd&apos; *.patch

The appropriate team or teams can also be inferred from the modified files.  For instance, if you want to send the two latest commits of the current Git repository to review, you can run:

     $ guix shell -D guix
     [env]$ git send-email --to=ISSUE_NUMBER@debbugs.gnu.org -2

Making Decisions
================

It is expected from all contributors, and even more so from committers, to help build consensus and make decisions based on consensus.  By using consensus, we are committed to finding solutions that everyone can live with.  It implies that no decision is made against significant concerns and these concerns are actively resolved with proposals that work for everyone.

A contributor (who may or may not have commit access) wishing to block a proposal bears a special responsibility for finding alternatives, proposing ideas/code or explain the rationale for the status quo to resolve the deadlock.  To learn what consensus decision making means and understand its finer details, you are encouraged to read https://www.seedsforchange.org.uk/consensus.

Commit Access
=============

Everyone can contribute to Guix without having commit access (see Submitting Patches).  However, for frequent contributors, having write access to the repository can be convenient.  As a rule of thumb, a contributor should have accumulated fifty (50) reviewed commits to be considered as a committer and have sustained their activity in the project for at least 6 months.  This ensures enough interactions with the contributor, which is essential for mentoring and assessing whether they are ready to become a committer.  Commit access should not be thought of as a ``badge of honor&apos;&apos; but rather as a responsibility a contributor is willing to take to help the project.

Committers are in a position where they enact technical decisions.  Such decisions must be made by actively building consensus among interested parties and stakeholders.  See Making Decisions, for more on that.

The following sections explain how to get commit access, how to be ready to push commits, and the policies and community expectations for commits pushed upstream.

Applying for Commit Access
--------------------------

When you deem it necessary, consider applying for commit access by following these steps:

 1. Find three committers who would vouch for you.  You can view the list of committers at https://savannah.gnu.org/project/memberlist.php?group=guix.  Each of them should email a statement to guix-maintainers@gnu.org (a private alias for the collective of maintainers), signed with their OpenPGP key.

     Committers are expected to have had some interactions with you as a contributor and to be able to judge whether you are sufficiently familiar with the project&apos;s practices.  It is not a judgment on the value of your work, so a refusal should rather be interpreted as ``let&apos;s try again later&apos;&apos;.

 2. Send guix-maintainers@gnu.org a message stating your intent, listing the three committers who support your application, signed with the OpenPGP key you will use to sign commits, and giving its fingerprint (see below).  See https://emailselfdefense.fsf.org/en/, for an introduction to public-key cryptography with GnuPG.

     Set up GnuPG such that it never uses the SHA1 hash algorithm for digital signatures, which is known to be unsafe since 2019, for instance by adding the following line to ~/.gnupg/gpg.conf (see GPG Esoteric Options (The GNU Privacy Guard Manual)):

          digest-algo sha512

 3. Maintainers ultimately decide whether to grant you commit access, usually following your referrals&apos; recommendation.

 4. If and once you&apos;ve been given access, please send a message to guix-devel@gnu.org to say so, again signed with the OpenPGP key you will use to sign commits (do that before pushing your first commit). That way, everyone can notice and ensure you control that OpenPGP key.

          Before you can push for the first time, maintainers must:

           1. add your OpenPGP key to the keyring branch;

           2. add your OpenPGP fingerprint to the .guix-authorizations file of the branch(es) you will commit to.

 5. Make sure to read the rest of this section and... profit!

     Maintainers are happy to give commit access to people who have been contributing for some time and have a track record---don&apos;t be shy and don&apos;t underestimate your work!

     However, note that the project is working towards a more automated patch review and merging system, which, as a consequence, may lead us to have fewer people with commit access to the main repository.  Stay tuned!

All commits that are pushed to the central repository on Savannah must be signed with an OpenPGP key, and the public key should be uploaded to your user account on Savannah and to public key servers, such as keys.openpgp.org.  To configure Git to automatically sign commits, run:

     git config commit.gpgsign true

     # Substitute the fingerprint of your public PGP key.
     git config user.signingkey CABBA6EA1DC0FF33

To check that commits are signed with correct key, use:

     guix git authenticate

See Building from Git for running the first authentication of a Guix checkout.

To avoid accidentally pushing unsigned or signed with the wrong key commits to Savannah, make sure to configure Git according to see Configuring Git.

Commit Policy
-------------

If you get commit access, please make sure to follow the policy below (discussions of the policy can take place on guix-devel@gnu.org).

Ensure you&apos;re aware of how the changes should be handled (see Managing Patches and Branches) prior to being pushed to the repository, especially for the master branch.

If you&apos;re committing and pushing your own changes, try and wait at least one week (two weeks for more significant changes, up to one month for changes such as removing a package---see Package Removal) after you send them for review.  After this, if no one else is available to review them and if you&apos;re confident about the changes, it&apos;s OK to commit.

When pushing a commit on behalf of somebody else, please add a Signed-off-by line at the end of the commit log message---e.g., with git am --signoff.  This improves tracking of who did what.

When adding channel news entries (see Writing Channel News), make sure they are well-formed by running the following command right before pushing:

     make check-channel-news

Addressing Issues
-----------------

Peer review (see Submitting Patches) and tools such as guix lint (see Invoking guix lint) and the test suite (see Running the Test Suite) should catch issues before they are pushed.  Yet, commits that ``break&apos;&apos; functionality might occasionally go through.  When that happens, there are two priorities: mitigating the impact, and understanding what happened to reduce the chance of similar incidents in the future.  The responsibility for both these things primarily lies with those involved, but like everything this is a group effort.

Some issues can directly affect all users---for instance because they make guix pull fail or break core functionality, because they break major packages (at build time or run time), or because they introduce known security vulnerabilities.

The people involved in authoring, reviewing, and pushing such commit(s) should be at the forefront to mitigate their impact in a timely fashion: by pushing a followup commit to fix it (if possible), or by reverting it to leave time to come up with a proper fix, and by communicating with other developers about the problem.

If these persons are unavailable to address the issue in time, other committers are entitled to revert the commit(s), explaining in the commit log and on the mailing list what the problem was, with the goal of leaving time to the original committer, reviewer(s), and author(s) to propose a way forward.

Once the problem has been dealt with, it is the responsibility of those involved to make sure the situation is understood.  If you are working to understand what happened, focus on gathering information and avoid assigning any blame.  Do ask those involved to describe what happened, do not ask them to explain the situation---this would implicitly blame them, which is unhelpful.  Accountability comes from a consensus about the problem, learning from it and improving processes so that it&apos;s less likely to reoccur.

Commit Revocation
-----------------

In order to reduce the possibility of mistakes, committers will have their Savannah account removed from the Guix Savannah project and their key removed from .guix-authorizations after 12 months of inactivity; they can ask to regain commit access by emailing the maintainers, without going through the vouching process.

Maintainers (See https://guix.gnu.org/en/about for the current list of maintainers.  You can email them privately at guix-maintainers@gnu.org.) may also revoke an individual&apos;s commit rights, as a last resort, if cooperation with the rest of the community has caused too much friction---even within the bounds of the project&apos;s code of conduct (see Contributing).  They would only do so after public or private discussion with the individual and a clear notice.  Examples of behavior that hinders cooperation and could lead to such a decision include:

  * repeated violation of the commit policy stated above;

  * repeated failure to take peer criticism into account;

  * breaching trust through a series of grave incidents.

When maintainers resort to such a decision, they notify developers on guix-devel@gnu.org; inquiries may be sent to guix-maintainers@gnu.org.  Depending on the situation, the individual may still be welcome to contribute.

Helping Out
-----------

One last thing: the project keeps moving forward because committers not only push their own awesome changes, but also offer some of their time reviewing and pushing other people&apos;s changes.  As a committer, you&apos;re welcome to use your expertise and commit rights to help other contributors, too!

Reviewing the Work of Others
============================

Perhaps the biggest action you can do to help GNU Guix grow as a project is to review the work contributed by others.  You do not need to be a committer to do so; applying, reading the source, building, linting and running other people&apos;s series and sharing your comments about your experience will give some confidence to committers.  You must ensure the check list found in the Submitting Patches section has been correctly followed.  A reviewed patch series should give the best chances for the proposed change to be merged faster, so if a change you would like to see merged hasn&apos;t yet been reviewed, this is the most appropriate thing to do!  If you would like to review changes in a specific area and to receive notifications for incoming patches relevant to that domain, consider joining the relevant team(s) (see Teams).

Review comments should be unambiguous; be as clear and explicit as you can about what you think should be changed, ensuring the author can take action on it.  Please try to keep the following guidelines in mind during review:

 1. Be clear and explicit about changes you are suggesting, ensuring the author can take action on it.  In particular, it is a good idea to explicitly ask for new revisions when you want it.

 2. Remain focused: do not change the scope of the work being reviewed.  For example, if the contribution touches code that follows a pattern deemed unwieldy, it would be unfair to ask the submitter to fix all occurrences of that pattern in the code; to put it simply, if a problem unrelated to the patch at hand was already there, do not ask the submitter to fix it.

 3. Ensure progress.  As they respond to review, submitters may submit new revisions of their changes; avoid requesting changes that you did not request in the previous round of comments.  Overall, the submitter should get a clear sense of progress; the number of items open for discussion should clearly decrease over time.

 4. Aim for finalization.  Reviewing code is time-consuming.  Your goal as a reviewer is to put the process on a clear path towards integration, possibly with agreed-upon changes, or rejection, with a clear and mutually-understood reasoning.  Avoid leaving the review process in a lingering state with no clear way out.

 5. Review is a discussion.  The submitter&apos;s and reviewer&apos;s views on how to achieve a particular change may not always be aligned.  To lead the discussion, remain focused, ensure progress and aim for finalization, spending time proportional to the stakes (The tendency to discuss minute details at length is often referred to as ``bikeshedding&apos;&apos;, where much time is spent discussing each one&apos;s preference for the color of the shed at the expense of progress made on the project to keep bikes dry.).  As a reviewer, try hard to explain the rationale for suggestions you make, and to understand and take into account the submitter&apos;s motivation for doing things in a certain way. In other words, build consensus with everyone involved (see Making Decisions).

When you deem the proposed change adequate and ready for inclusion within Guix, the following well understood/codified Reviewed-by: Your Name &lt;your-email@example.com&gt; (The Reviewed-by Git trailer is used by other projects such as Linux, and is understood by third-party tools such as the b4 am sub-command, which is able to retrieve the complete submission email thread from a public-inbox instance and add the Git trailers found in replies to the commit patches.) line should be used to sign off as a reviewer, meaning you have reviewed the change and that it looks good to you:

  * If the whole series (containing multiple commits) looks good to you, reply with Reviewed-by: Your Name &lt;your-email@example.com&gt; to the cover page if it has one, or to the last patch of the series otherwise, adding another (for the whole series) comment on the line below to explicit this fact.

  * If you instead want to mark a single commit as reviewed (but not the whole series), simply reply with Reviewed-by: Your Name &lt;your-email@example.com&gt; to that commit message.

If you are not a committer, you can help others find a series you have reviewed more easily by adding a reviewed-looks-good usertag for the guix user (see Debbugs Usertags).

Updating the Guix Package
=========================

It is sometimes desirable to update the guix package itself (the package defined in (gnu packages package-management)), for example to make new daemon features available for use by the guix-service-type service type.  In order to simplify this task, the following command can be used:

     make update-guix-package

The update-guix-package make target will use the last known commit corresponding to HEAD in your Guix checkout, compute the hash of the Guix sources corresponding to that commit and update the commit, revision and hash of the guix package definition.

To validate that the updated guix package hashes are correct and that it can be built successfully, the following command can be run from the directory of your Guix checkout:

     ./pre-inst-env guix build guix

To guard against accidentally updating the guix package to a commit that others can&apos;t refer to, a check is made that the commit used has already been pushed to the Savannah-hosted Guix git repository.

This check can be disabled, at your own peril, by setting the GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT environment variable.  When this variable is set, the updated package source is also added to the store.  This is used as part of the release process of Guix.

Deprecation Policy
==================

As any lively project with a broad scope, Guix changes all the time and at all levels.  Because it&apos;s user-extensible and programmable, incompatible changes can directly impact users and make their life harder.  It is thus important to reduce user-visible incompatible changes to a minimum and, when such changes are deemed necessary, to clearly communicate them through a deprecation period so everyone can adapt with minimum hassle.  This section defines the project&apos;s commitments for smooth deprecation and describes procedures and mechanisms to honor them.

There are several ways to use Guix; how to handle deprecation will depend on each use case.  Those can be roughly categorized like this:

  * package management exclusively through the command line;

  * advanced package management using the manifest and package interfaces;

  * Home and System management, using the operating-system and/or home-environment interfaces together with the service interfaces;

  * development or use of external tools that use programming interfaces such as the (guix ...) modules.

These use cases form a spectrum with varying degrees of coupling---from ``distant&apos;&apos; to tightly coupled.  Based on this insight, we define the following deprecation policies that we consider suitable for each of these levels.

Command-line tools
     Guix sub-commands should be thought of as remaining available ``forever&apos;&apos;.  Once a Guix sub-command is to be removed, it should be deprecated first, and then remain available for at least one year after the first release that deprecated it.

     Deprecation should first be announced in the manual and as an entry in etc/news.scm; additional communication such as a blog post explaining the rationale is welcome.  Months before the scheduled removal date, the command should print a warning explaining how to migrate.  An example of this is the replacement of guix environment by guix shell, started in October 2021 (For more details on the guix shell transition, see https://guix.gnu.org/en/blog/2021/from-guix-environment-to-guix-shell/.).

     Because of the broad impact of such a change, we recommend conducting a user survey before enacting a plan.

Package name changes
     When a package name changes, it must remain available under its old name for at least one year.  For example, go-ipfs was renamed to kubo following a decision made upstream; to communicate the name change to users, the package module provided this definition:

          (define-public go-ipfs
            (deprecated-package &quot;go-ipfs&quot; kubo))

     That way, someone running guix install go-ipfs or similar sees a deprecation warning mentioning the new name.

Package removal
     Packages whose upstream developers have declared as having reached ``end of life&apos;&apos; or being unmaintained may be removed; likewise, packages that have been failing to build for two months or more may be removed.

     There is no formal deprecation mechanism for this case, unless a replacement exists, in which case the deprecated-package procedure mentioned above can be used.

     If the package being removed is a ``leaf&apos;&apos; (no other packages depend on it), it may be removed after a one-month review period of the patch removing it (this applies even when the removal has additional motivations such as security problems affecting the package).

     If it has many dependent packages---as is the case for example with Python version 2---the relevant team must propose a deprecation removal agenda and seek consensus with other packagers for at least one month.  It may also invite feedback from the broader user community, for example through a survey.  Removal of all impacted packages may be gradual, spanning multiple months, to accommodate all use cases.

     When the package being removed is considered popular, whether or not it is a leaf, its deprecation must be announced as an entry in etc/news.scm.

Package upgrade
     In the case of packages with many dependents and/or many users, an upgrade may be treated like the removal of the previous version.

     Examples include major version upgrades of programming language implementations, as we&apos;ve seen above with Python, and major upgrades of ``big&apos;&apos; libraries such as Qt or GTK.

Services
     Changes to services for Guix Home and Guix System have a direct impact on user configuration.  For a user, adjusting to interface changes is rarely rewarding, which is why any such change must be clearly communicated in advance through deprecation warnings and documentation.

     Renaming of variables related to service, home, or system configuration must be communicated for at least six months before removal using the (guix deprecation) mechanisms.  For example, renaming of murmur-configuration to mumble-server-configuration was communicated through a series of definitions like this one:

          (define-deprecated/public-alias
            murmur-configuration
            mumble-server-configuration)

     Procedures slated for removal may be defined like this:

          (define-deprecated (elogind-service #:key (config (elogind-configuration)))
            elogind-service-type
            (service elogind-service-type config))

     Record fields, notably fields of service configuration records, must follow a similar deprecation period.  This is usually achieved through ad hoc means though.  For example, the hosts-file field of operating-system was deprecated by adding a sanitized property that would emit a warning:

          (define-record-type* &lt;operating-system&gt;
            ;; ...
            (hosts-file %operating-system-hosts-file         ;deprecated
                        (default #f)
                        (sanitize warn-hosts-file-field-deprecation)))

          (define-deprecated (operating-system-hosts-file os)
            hosts-service-type
            (%operating-system-hosts-file os))

     When deprecating interfaces in operating-system, home-environment, (gnu services), or any popular service, the deprecation must come with an entry in etc/news.scm.

Core interfaces
     Core programming interfaces, in particular the (guix ...) modules, may be relied on by a variety of external tools and channels. Any incompatible change must be formally deprecated with define-deprecated, as shown above, for at least one year before removal.  The manual must clearly document the new interface and, except in obvious cases, explain how to migrate from the old one.

     As an example, the build-expression-&gt;derivation procedure was superseded by gexp-&gt;derivation and remained available as a deprecated symbol:

          (define-deprecated (build-expression-&gt;derivation store name exp
                                                           #:key ...)
            gexp-&gt;derivation
            ...)

     Sometimes bindings are moved from one module to another.  In those cases, bindings must be reexported from the original module for at least one year.

This section does not cover all possible situations but hopefully allows users to know what to expect and developers to stick to its spirit. Please email guix-devel@gnu.org for any questions.

Writing Documentation
=====================

Guix is documented using the Texinfo system.  If you are not yet familiar with it, we accept contributions for documentation in most formats.  That includes plain text, Markdown, Org, etc.

Documentation contributions can be sent to guix-patches@gnu.org.  Prepend [DOCUMENTATION] to the subject.

When you need to make more than a simple addition to the documentation, we prefer that you send a proper patch as opposed to sending an email as described above.  See Submitting Patches for more information on how to send your patches.

To modify the documentation, you need to edit doc/guix.texi and doc/contributing.texi (which contains this documentation section), or doc/guix-cookbook.texi for the cookbook.  If you compiled the Guix repository before, you will have many more .texi files that are translations of these documents.  Do not modify them, the translation is managed through Weblate (https://translate.fedoraproject.org/projects/guix). See Translating Guix for more information.

To render documentation, you must first make sure that you ran ./configure in your source tree (see Running Guix Before It Is Installed).  After that you can run one of the following commands:

  * make doc/guix.info to compile the Info manual. You can check it with info doc/guix.info.

  * make doc/guix.html to compile the HTML version. You can point your browser to the relevant file in the doc/guix.html directory.

  * make doc/guix-cookbook.info for the cookbook Info manual.

  * make doc/guix-cookbook.html for the cookbook HTML version.

Translating Guix
================

Writing code and packages is not the only way to provide a meaningful contribution to Guix.  Translating to a language you speak is another example of a valuable contribution you can make.  This section is designed to describe the translation process.  It gives you advice on how you can get involved, what can be translated, what mistakes you should avoid and what we can do to help you!

Guix is a big project that has multiple components that can be translated. We coordinate the translation effort on a Weblate instance (https://translate.fedoraproject.org/projects/guix/) hosted by our friends at Fedora.  You will need an account to submit translations.

Some of the software packaged in Guix also contain translations.  We do not host a translation platform for them.  If you want to translate a package provided by Guix, you should contact their developers or find the information on their website.  As an example, you can find the homepage of the hello package by typing guix show hello.  On the ``homepage&apos;&apos; line, you will see https://www.gnu.org/software/hello/ as the homepage.

Many GNU and non-GNU packages can be translated on the Translation Project (https://translationproject.org).  Some projects with multiple components have their own platform.  For instance, GNOME has its own platform, Damned Lies (https://l10n.gnome.org/).

Guix has five components hosted on Weblate.

  * guix contains all the strings from the Guix software (the guided system installer, the package manager, etc), excluding packages.

  * packages contains the synopsis (single-sentence description of a package) and description (longer description) of packages in Guix.

  * website contains the official Guix website, except for blog posts and multimedia content.

  * documentation-manual corresponds to this manual.

  * documentation-cookbook is the component for the cookbook.

General Directions
..................

Once you get an account, you should be able to select a component from the guix project (https://translate.fedoraproject.org/projects/guix/), and select a language.  If your language does not appear in the list, go to the bottom and click on the ``Start new translation&apos;&apos; button.  Select the language you want to translate to from the list, to start your new translation.

Like lots of other free software packages, Guix uses GNU Gettext (https://www.gnu.org/software/gettext) for its translations, with which translatable strings are extracted from the source code to so-called PO files.

Even though PO files are text files, changes should not be made with a text editor but with PO editing software.  Weblate integrates PO editing functionality.  Alternatively, translators can use any of various free-software tools for filling in translations, of which Poedit (https://poedit.net/) is one example, and (after logging in) upload (https://docs.weblate.org/en/latest/user/files.html) the changed file.  There is also a special PO editing mode (https://www.emacswiki.org/emacs/PoMode) for users of GNU Emacs.  Over time translators find out what software they are happy with and what features they need.

On Weblate, you will find various links to the editor, that will show various subsets (or all) of the strings.  Have a look around and at the documentation (https://docs.weblate.org/en/latest/) to familiarize yourself with the platform.

Translation Components
......................

In this section, we provide more detailed guidance on the translation process, as well as details on what you should or should not do.  When in doubt, please contact us, we will be happy to help!

guix
     Guix is written in the Guile programming language, and some strings contain special formatting that is interpreted by Guile.  These special formatting should be highlighted by Weblate.  They start with ~ followed by one or more characters.

     When printing the string, Guile replaces the special formatting symbols with actual values.  For instance, the string ambiguous package specification `~a&apos; would be substituted to contain said package specification instead of ~a.  To properly translate this string, you must keep the formatting code in your translation, although you can place it where it makes sense in your language.  For instance, the French translation says spécification du paquet « ~a » ambiguë because the adjective needs to be placed in the end of the sentence.

     If there are multiple formatting symbols, make sure to respect the order. Guile does not know in which order you intended the string to be read, so it will substitute the symbols in the same order as the English sentence.

     As an example, you cannot translate package &apos;~a&apos; has been superseded by &apos;~a&apos; by &apos;~a&apos; superseeds package &apos;~a&apos;, because the meaning would be reversed.  If FOO is superseded by BAR, the translation would read &apos;foo&apos; superseeds package &apos;bar&apos;.  To work around this problem, it is possible to use more advanced formatting to select a given piece of data, instead of following the default English order.  See Formatted Output (GNU Guile Reference Manual), for more information on formatting in Guile.

packages

     Package descriptions occasionally contain Texinfo markup (see Synopses and Descriptions).   Texinfo markup looks like @code{rm -rf}, @emph{important}, etc.  When translating, please leave markup as is.

     The characters after ``@&apos;&apos; form the name of the markup, and the text between ``{&apos;&apos; and ``}&apos;&apos; is its content.  In general, you should not translate the content of markup like @code, as it contains literal code that do not change with language.  You can translate the content of formatting markup such as @emph, @i, @itemize, @item.  However, do not translate the name of the markup, or it will not be recognized.  Do not translate the word after @end, it is the name of the markup that is closed at this position (e.g. @itemize ... @end itemize).

documentation-manual and documentation-cookbook

     The first step to ensure a successful translation of the manual is to find and translate the following strings first:

       * version.texi: Translate this string as version-xx.texi, where xx is your language code (the one shown in the URL on weblate).

       * contributing.texi: Translate this string as contributing.xx.texi, where xx is the same language code.

       * Top: Do not translate this string, it is important for Texinfo. If you translate it, the document will be empty (missing a Top node). Please look for it, and register Top as its translation.

     Translating these strings first ensure we can include your translation in the guix repository without breaking the make process or the guix pull machinery.

     The manual and the cookbook both use Texinfo.  As for packages, please keep Texinfo markup as is.  There are more possible markup types in the manual than in the package descriptions.  In general, do not translate the content of @code, @file, @var, @value, etc.  You should translate the content of formatting markup such as @emph, @i, etc.

     The manual contains sections that can be referred to by name by @ref, @xref and @pxref.  We have a mechanism in place so you do not have to translate their content.  If you keep the English title, we will automatically replace it with your translation of that title.  This ensures that Texinfo will always be able to find the node. If you decide to change the translation of the title, the references will automatically be updated and you will not have to update them all yourself.

     When translating references from the cookbook to the manual, you need to replace the name of the manual and the name of the section.  For instance, to translate @pxref{Defining Packages,,, guix, GNU Guix Reference Manual}, you would replace Defining Packages with the title of that section in the translated manual only if that title is translated. If the title is not translated in your language yet, do not translate it here, or the link will be broken.  Replace guix with guix.xx where xx is your language code.  GNU Guix Reference Manual is the text of the link.  You can translate it however you wish.

website

     The website pages are written using SXML, an s-expression version of HTML, the basic language of the web.  We have a process to extract translatable strings from the source, and replace complex s-expressions with a more familiar XML markup, where each markup is numbered.  Translators can arbitrarily change the ordering, as in the following example.

          #. TRANSLATORS: Defining Packages is a section name
          #. in the English (en) manual.
          #: apps/base/templates/about.scm:64
          msgid &quot;Packages are &lt;1&gt;defined&lt;1.1&gt;en&lt;/1.1&gt;&lt;1.2&gt;Defining-Packages.html&lt;/1.2&gt;&lt;/1&gt; as native &lt;2&gt;Guile&lt;/2&gt; modules.&quot;
          msgstr &quot;Pakete werden als reine &lt;2&gt;Guile&lt;/2&gt;-Module &lt;1&gt;definiert&lt;1.1&gt;de&lt;/1.1&gt;&lt;1.2&gt;Pakete-definieren.html&lt;/1.2&gt;&lt;/1&gt;.&quot;

     Note that you need to include the same markups.  You cannot skip any.

In case you make a mistake, the component might fail to build properly with your language, or even make guix pull fail.  To prevent that, we have a process in place to check the content of the files before pushing to our repository. We will not be able to update the translation for your language in Guix, so we will notify you (through weblate and/or by email) so you get a chance to fix the issue.

Outside of Weblate
..................

Currently, some parts of Guix cannot be translated on Weblate, help wanted!

  * guix pull news can be translated in news.scm, but is not available from Weblate.  If you want to provide a translation, you can prepare a patch as described above, or simply send us your translation with the name of the news entry you translated and your language. See Writing Channel News, for more information about channel news.

  * Guix blog posts cannot currently be translated.

  * The installer script (for foreign distributions) is entirely in English.

  * Some of the libraries Guix uses cannot be translated or are translated outside of the Guix project.  Guile itself is not internationalized.

  * Other manuals linked from this manual or the cookbook might not be translated.

Conditions for Inclusion
........................

There are no conditions for adding new translations of the guix and guix-packages components, other than they need at least one translated string.  New languages will be added to Guix as soon as possible.  The files may be removed if they fall out of sync and have no more translated strings.

Given that the web site is dedicated to new users, we want its translation to be as complete as possible before we include it in the language menu. For a new language to be included, it needs to reach at least 80% completion. When a language is included, it may be removed in the future if it stays out of sync and falls below 60% completion.

The manual and cookbook are automatically added in the default compilation target.  Every time we synchronize translations, developers need to recompile all the translated manuals and cookbooks.  This is useless for what is essentially the English manual or cookbook.  Therefore, we will only include a new language when it reaches 10% completion in the component. When a language is included, it may be removed in the future if it stays out of sync and falls below 5% completion.

Translation Infrastructure
..........................

Weblate is backed by a git repository from which it discovers new strings to translate and pushes new and updated translations.  Normally, it would be enough to give it commit access to our repositories.  However, we decided to use a separate repository for two reasons.  First, we would have to give Weblate commit access and authorize its signing key, but we do not trust it in the same way we trust guix developers, especially since we do not manage the instance ourselves.  Second, if translators mess something up, it can break the generation of the website and/or guix pull for all our users, independently of their language.

For these reasons, we use a dedicated repository to host translations, and we synchronize it with our guix and artworks repositories after checking no issue was introduced in the translation.

Developers can download the latest PO files from weblate in the Guix repository by running the make download-po command.  It will automatically download the latest files from weblate, reformat them to a canonical form, and check they do not contain issues.  The manual needs to be built again to check for additional issues that might crash Texinfo.

Before pushing new translation files, developers should add them to the make machinery so the translations are actually available.  The process differs for the various components.

  * New po files for the guix and packages components must be registered by adding the new language to po/guix/LINGUAS or po/packages/LINGUAS.

  * New po files for the documentation-manual component must be registered by adding the file name to DOC_PO_FILES in po/doc/local.mk, the generated %D%/guix.xx.texi manual to info_TEXINFOS in doc/local.mk and the generated %D%/guix.xx.texi and %D%/contributing.xx.texi to TRANSLATED_INFO also in doc/local.mk.

  * New po files for the documentation-cookbook component must be registered by adding the file name to DOC_COOKBOOK_PO_FILES in po/doc/local.mk, the generated %D%/guix-cookbook.xx.texi manual to info_TEXINFOS in doc/local.mk and the generated %D%/guix-cookbook.xx.texi to TRANSLATED_INFO also in doc/local.mk.

  * New po files for the website component must be added to the guix-artwork repository, in website/po/. website/po/LINGUAS and website/po/ietf-tags.scm must be updated accordingly (see website/i18n-howto.txt for more information on the process).

Contributing to Guix&apos;s Infrastructure
==========================================

Since its inception, the Guix project has always valued its autonomy, and that reflects in its infrastructure: our servers run Guix System and exclusively free software, and are administered by volunteers.

Of course this comes at a cost and this is why we need contributions.  Our hope is to make infrastructure-related activity more legible so that maybe you can picture yourself helping in one of these areas.

Coding
------

The project runs many Guix-specific services; this is all lovely Scheme code but it tends to receive less attention than Guix itself:

  * Build Farm Front-End: bffe (https://git.cbaines.net/guix/bffe)

  * Cuirass: Cuirass (https://guix.gnu.org/cuirass/)

  * Goggles (IRC logger): Goggles (https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/goggles.scm)

  * Guix Build Coordinator: Build-Coordinator (https://git.savannah.gnu.org/cgit/guix/build-coordinator.git/)

  * Guix Data Service: Data-Service (https://git.savannah.gnu.org/git/guix/data-service.git/)

  * Guix Packages Website: Guix-Packages-Website (https://codeberg.org/luis-felipe/guix-packages-website.git)

  * mumi: Mumi (https://git.savannah.gnu.org/cgit/guix/mumi.git/)

  * nar-herder: Nar-Herder (https://git.savannah.gnu.org/cgit/guix/nar-herder.git/)

  * QA Frontpage: QA-Frontpage (https://git.savannah.gnu.org/git/guix/qa-frontpage.git)

There is no time constraint on this coding activity: any improvement is welcome, whenever it comes.  Most of these code bases are relatively small, which should make it easier to get started.

Prerequisites: Familiarity with Guile, HTTP, and databases.

If you wish to get started, check out the README of the project of your choice and get in touch with guix-devel and the primary developer(s) of the tool as per git shortlog -s | sort -k1 -n.

System Administration
---------------------

Guix System configuration for all our systems is held in this repository:

https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/

The two front-ends are berlin.scm (the machine behind ci.guix.gnu.org) and bayfront.scm (the machine behind bordeaux.guix.gnu.org, guix.gnu.org, hpc.guix.info, qa.guix.gnu.org, and more).  Both connect to a number of build machines and helpers.

Without even having SSH access to the machine, you can help by posting patches to improve the configuration (you can test it with guix system vm). Here are ways you can help:

  * Improve infra monitoring: set up a dashboard to monitor all the infrastructure, and an out-of-band channel to communicate about downtime.

  * Implement web site redundancy: guix.gnu.org should be backed by several machines on different sites.  Get in touch with us and/or send a patch!

  * Implement substitute redundancy: likewise, bordeaux.guix.gnu.org and ci.guix.gnu.org should be backed by several head nodes.

  * Improve backup: there&apos;s currently ad-hoc backup of selected pieces over rsync between the two head nodes; we can improve on that, for example with a dedicated backup site and proper testing of recoverability.

  * Support mirroring: We&apos;d like to make it easy for others to mirror substitutes from ci.guix and bordeaux.guix, perhaps by offering public rsync access.

  * Optimize our web services: Monitor the performance of our services and tweak nginx config or whatever it takes to improve it.

     There is no time constraint on this activity: any improvement is welcome, whenever you can work on it.

     Prerequisite: Familiarity with Guix System administration and ideally with the infrastructure handbook:

     Infra-Handbook (https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/doc/infra-handbook.org)

Day-to-Day System Administration
--------------------------------

We&apos;re also looking for people who&apos;d be willing to have SSH access to some of the infrastructure to help with day-to-day maintenance: restarting a build, restarting the occasional service that has gone wild (that can happen), reconfiguring/upgrading a machine, rebooting, etc.

This day-to-day activity requires you to be available some of the time (during office hours or not, during the week-end or not), whenever is convenient for you, so you can react to issues reported on IRC, on the mailing list, or elsewhere, and synchronize with other sysadmins.

Prerequisite: Being a ``known&apos;&apos; member of the community, familiarity with Guix System administration, with some of the services/web sites being run, and with the infrastructure handbook:

Infra-Handbook (https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/doc/infra-handbook.org)

On-Site Intervention
--------------------

The first front-end is currently generously hosted by the Max Delbrück Center (MDC), a research institute in Berlin, Germany. Only authorized personnel can physically access it.

The second one, bordeaux.guix.gnu.org, is hosted in Bordeaux, France, in a professional data center shared with non-profit ISP Aquilenet.  If you live in the region of Bordeaux and would like to help out when we need to go on-site, please make yourself known by emailing guix-sysadmin@gnu.org.

On-site interventions are rare, but they&apos;re usually in response to an emergency.

Hosting
-------

We&apos;re looking for people who can host machines and help out whenever physical access is needed.  More specifically:

  * We need hosting of ``small&apos;&apos; machines such as single-board computers (AArch64, RISC-V) for use as build machines.

  * We need hosting for front-ends and x86_64 build machines in a data center where they can be racked and where, ideally, several local Guix sysadmins can physically access them.

The machines should be accessible over Wireguard VPN most of the time, so longer power or network interruptions should be the exception.

Prerequisites: Familiarity with installing and remotely administering Guix System.

Administrative Tasks
--------------------

The infra remains up and running thanks to crucial administrative tasks, which includes:

  * Selecting and purchasing hardware, for example build machines.

  * Renewing domain names.

  * Securing funding, in particular via the Guix Foundation: Guix Foundation (https://foundation.guix.info)

Prerequisites: Familiarity with hardware, and/or DNS registrars, and/or sponsorship, and/or crowdfunding. </pre> </div></div> <!-- class=content --> <div class=footer>generated by <a href="https://git.zx2c4.com/cgit/about/"> cgit </a> </div> </div> <!-- id=cgit --> </body> </html>