projects/guix·blob python-team · refs

3796 lines · 150.4 KiB

1@node Contributing
2@chapter Contributing
3
4This project is a cooperative effort, and we need your help to make it
5grow! Please get in touch with us on @email{guix-devel@@gnu.org} and
6@code{#guix} on the Libera Chat IRC network. We welcome ideas, bug
7reports, patches, and anything that may be helpful to the project. We
8particularly welcome help on packaging (@pxref{Packaging Guidelines}).
9
10@cindex code of conduct, of contributors
11@cindex contributor covenant
12We want to provide a warm, friendly, and harassment-free environment, so
13that anyone can contribute to the best of their abilities. To this end
14our project uses a ``Contributor Covenant'', which was adapted from
15@url{https://contributor-covenant.org/}. You can find a local version in
16the @file{CODE-OF-CONDUCT} file in the source tree.
17
18Contributors are not required to use their legal name in patches and
19on-line communication; they can use any name or pseudonym of their
20choice.
21
22@menu
23* Requirements:: Software needed to build and run Guix.
24* Building from Git:: The latest and greatest.
25* Running the Test Suite:: Testing Guix.
26* Running Guix Before It Is Installed:: Hacker tricks.
27* The Perfect Setup:: The right tools.
28* Source Tree Structure:: Source code guided tour.
29* Packaging Guidelines:: Growing the distribution.
30* Coding Style:: Hygiene of the contributor.
31* Copyright Matters:: Because copyleft matters.
32* Submitting Patches:: Share your work.
33* Tracking Bugs and Changes:: Keeping it all organized.
34* Teams:: Coordinating efforts.
35* Making Decisions:: Collectively choosing the way forward.
36* Commit Access:: Pushing to the official repository.
37* Reviewing the Work of Others:: Some guidelines for sharing reviews.
38* Updating the Guix Package:: Updating the Guix package definition.
39* Deprecation Policy:: Commitments and tools for deprecation.
40* Writing Documentation:: Improving documentation in GNU Guix.
41* Translating Guix:: Make Guix speak your native language.
42* Contributing to Guix's Infrastructure:: Make Guix ecosystem work better.
43@end menu
44
45@node Requirements
46@section Requirements
47
48You can easily hack on Guix itself using Guix and Git, which we use for
49version control (@pxref{Building from Git}).
50
51But when packaging Guix for foreign distros or when bootstrapping on
52systems without Guix, and if you decide to not just trust and install
53our readily made binary (@pxref{Binary Installation}), you can download
54a release version of our reproducible source tarball and read on.
55
56This section lists requirements when building Guix from source. The
57build procedure for Guix is the same as for other GNU software, and is
58not covered here. Please see the files @file{README} and @file{INSTALL}
59in the Guix source tree for additional details.
60
61@cindex official website
62GNU Guix is available for download from its website at
63@url{https://guix.gnu.org}.
64
65GNU Guix depends on the following packages:
66
67@itemize
68@item @url{https://gnu.org/software/guile/, GNU Guile}, version 3.0.x,
69version 3.0.9 or later;
70@item @url{https://codeberg.org/guile-gcrypt/guile-gcrypt, Guile-Gcrypt}, version
710.1.0 or later;
72@item
73@uref{https://codeberg.org/guile-gnutls/guile-gnutls, Guile-GnuTLS} (@pxref{Guile
74Preparations, how to install the GnuTLS bindings for Guile,,
75gnutls-guile, GnuTLS-Guile})@footnote{The Guile bindings to
76@uref{https://gnutls.org/, GnuTLS} were distributed as part of GnuTLS
77until version 3.7.8 included.};
78@item
79@uref{https://codeberg.org/guile-sqlite3/guile-sqlite3, Guile-SQLite3}, version 0.1.0
80or later;
81@item @uref{https://codeberg.org/guile-compression/guile-zlib, Guile-zlib},
82version 0.1.0 or later;
83@item @uref{https://codeberg.org/guile-compression/guile-lzlib, Guile-lzlib};
84@item @uref{https://www.nongnu.org/guile-avahi/, Guile-Avahi};
85@item
86@uref{https://codeberg.org/guile-git/guile-git, Guile-Git}, version 0.10.0
87or later;
88@item @uref{https://git-scm.com, Git} (yes, both!);
89@item @uref{https://github.com/aconchillo/guile-json, Guile-JSON}
904.3.0 or later;
91@item @url{https://www.gnu.org/software/make/, GNU Make}.
92@end itemize
93
94The following dependencies are optional:
95
96@itemize
97@item
98@c Note: We need at least 0.13.0 for #:nodelay.
99Support for build offloading (@pxref{Daemon Offload Setup}) and
100@command{guix copy} (@pxref{Invoking guix copy}) depends on
101@uref{https://github.com/artyom-poptsov/guile-ssh, Guile-SSH},
102version 0.13.0 or later.
103
104@item
105@uref{https://codeberg.org/guile-compression/guile-zstd, Guile-zstd}, for zstd
106compression and decompression in @command{guix publish} and for
107substitutes (@pxref{Invoking guix publish}).
108
109@item
110@uref{https://ngyro.com/software/guile-semver.html, Guile-Semver} for
111the @code{crate} importer (@pxref{Invoking guix import}).
112
113@item
114@uref{https://www.nongnu.org/guile-lib/doc/ref/htmlprag/, Guile-Lib} for
115the @code{go} importer (@pxref{Invoking guix import}) and for some of
116the ``updaters'' (@pxref{Invoking guix refresh}).
117
118@item
119When @url{http://www.bzip.org, libbz2} is available,
120@command{guix-daemon} can use it to compress build logs.
121@end itemize
122
123Unless @option{--disable-daemon} was passed to @command{configure}, the
124following packages are also needed:
125
126@itemize
127@item @url{https://gnupg.org/, GNU libgcrypt};
128@item @url{https://sqlite.org, SQLite 3};
129@item @url{https://gcc.gnu.org, GCC's g++}, with support for the
130C++11 standard.
131@end itemize
132
133@node Building from Git
134@section Building from Git
135
136If you want to hack Guix itself, it is recommended to use the latest
137version from the Git repository@footnote{
138Guix uses @code{master} as the default branch name. A proposal in 2025 to
139change the default branch name to @code{main} did not reach consensus.
140See @uref{https://codeberg.org/guix/guix-consensus-documents/src/branch/main/003-rename-default-branch.md,
141Guix Consensus Document 003}.}:
142
143@example
144git clone https://git.guix.gnu.org/guix.git
145cd guix
146@end example
147
148@cindex authentication, of a Guix checkout
149How do you ensure that you obtained a genuine copy of the repository?
150To do that, run @command{guix git authenticate}, passing it the commit
151and OpenPGP fingerprint of the @dfn{channel introduction}
152(@pxref{Invoking guix git authenticate}):
153
154@c The commit and fingerprint below must match those of the channel
155@c introduction in '%default-channels'.
156@example
157guix git authenticate -k origin/keyring \
158 9edb3f66fd807b096b48283debdcddccfea34bad \
159 "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
160@end example
161
162@noindent
163This command completes with exit code zero on success; it prints an
164error message and exits with a non-zero code otherwise.
165
166As you can see, there is a chicken-and-egg problem: you first need to
167have Guix installed. Typically you would install Guix System
168(@pxref{System Installation}) or Guix on top of another distro
169(@pxref{Binary Installation}); in either case, you would verify the
170OpenPGP signature on the installation medium. This ``bootstraps'' the
171trust chain.
172
173The easiest way to set up a development environment for Guix is, of
174course, by using Guix! The following command starts a new shell where
175all the dependencies and appropriate environment variables are set up to
176hack on Guix:
177
178@example
179guix shell -D guix --pure
180@end example
181
182or even, from within a Git worktree for Guix:
183
184@example
185echo $(pwd) >> ~/.config/guix/shell-authorized-directories
186guix shell --pure
187@end example
188
189If you are unable to use Guix when building Guix from a checkout, the
190following are the required packages in addition to those mentioned in the
191installation instructions (@pxref{Requirements}).
192
193@itemize
194@item @url{https://gnu.org/software/autoconf/, GNU Autoconf};
195@item @url{https://gnu.org/software/automake/, GNU Automake};
196@item @url{https://gnu.org/software/gettext/, GNU Gettext};
197@item @url{https://gnu.org/software/texinfo/, GNU Texinfo};
198@item @url{https://www.graphviz.org/, Graphviz};
199@item @url{https://www.gnu.org/software/help2man/, GNU Help2man (optional)}.
200@end itemize
201
202On Guix, other development tools, like @code{strace}, can be included by
203giving them as extra arguments to @command{guix shell}:
204
205@example
206guix shell --pure -D guix strace
207@end example
208
209From there you can generate the build system infrastructure
210using Autoconf and Automake:
211
212@example
213./bootstrap
214@end example
215
216If you get an error like this one:
217
218@example
219configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
220@end example
221
222@noindent
223it probably means that Autoconf couldn’t find @file{pkg.m4}, which is
224provided by pkg-config. Make sure that @file{pkg.m4} is available. The
225same holds for the @file{guile.m4} set of macros provided by Guile. For
226instance, if you installed Automake in @file{/usr/local}, it wouldn’t
227look for @file{.m4} files in @file{/usr/share}. In that case, you have
228to invoke the following command:
229
230@example
231export ACLOCAL_PATH=/usr/share/aclocal
232@end example
233
234@xref{Macro Search Path,,, automake, The GNU Automake Manual}, for
235more information.
236
237@cindex state directory
238@cindex localstatedir
239@cindex system configuration directory
240@cindex sysconfdir
241Then, run:
242
243@example
244./configure
245@end example
246
247@noindent
248Optionally, @code{--localstatedir} and @code{--sysconfdir} can also be
249provided as arguments. By default, @code{localstatedir} is @file{/var}
250(@pxref{The Store}, for information about this) and @code{sysconfdir} is
251@file{/etc}. Note that you will probably not run @command{make install}
252at the end (you don't have to) but it's still important to pass the
253right @code{localstatedir} and @code{sysconfdir} values, which get
254recorded in the @code{(guix config)} Guile module.
255
256Finally, you can build Guix and, if you feel so inclined, run the tests
257(depending on how you setup your environment, some tests might fail,
258@pxref{Running the Test Suite}):
259
260@example
261make
262make check
263@end example
264
265From there on, you can authenticate all the commits included in your
266checkout by running:
267
268@example
269guix git authenticate -k origin/keyring \
270 9edb3f66fd807b096b48283debdcddccfea34bad \
271 "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
272@end example
273
274The first run takes a couple of minutes, but subsequent runs are faster.
275On subsequent runs, you can run the command without any arguments since
276the @dfn{introduction} (the commit ID and OpenPGP fingerprints above)
277will have been recorded@footnote{This requires a recent version of Guix,
278from May 2024 or more recent.}:
279
280@example
281guix git authenticate
282@end example
283
284When your configuration for your local Git repository doesn't match
285the default one, you can provide the reference for the @code{keyring}
286branch @i{via} the @option{-k} option. The following
287example assumes that you have a Git remote called @samp{myremote}
288pointing to the official repository:
289
290@example
291guix git authenticate \
292 -k myremote/keyring \
293 9edb3f66fd807b096b48283debdcddccfea34bad \
294 "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
295@end example
296
297@xref{Invoking guix git authenticate}, for more information on this
298command.
299
300@quotation Note
301By default, hooks are installed such that @command{guix git
302authenticate} is invoked anytime you run @command{git pull} or
303@command{git push}.
304@end quotation
305
306After updating the repository, @command{make} might fail with an error
307similar to the following example:
308
309@example
310error: failed to load 'gnu/packages/linux.scm':
311ice-9/eval.scm:293:34: In procedure abi-check: #<record-type <origin>>: record ABI mismatch; recompilation needed
312@end example
313
314This means that one of the record types that Guix defines (in this
315example, the @code{origin} record) has changed, and all of guix needs
316to be recompiled to take that change into account. To do so, run
317@command{make clean-go} followed by @command{make}.
318
319Should @command{make} fail with an Automake error message after
320updating, you need to repeat the steps outlined in this section,
321commencing with @command{./bootstrap}.
322
323@node Running the Test Suite
324@section Running the Test Suite
325
326@cindex test suite
327After a successful @command{configure} and @code{make} run, it is a good
328idea to run the test suite. It can help catch issues with the setup or
329environment, or bugs in Guix itself---and really, reporting test
330failures is a good way to help improve the software. To run the test
331suite, type:
332
333@example
334make check
335@end example
336
337Some tests might fail or be skipped, depending on your environment.
338For example, many tests require Internet access to download test
339binaries into the temporary store used for testing.
340
341Assuming you set up your environment with @command{guix shell},
342this is what you can expect:
343
344@table @option
345@item --pure
346all tests should either pass or be skipped. This will also
347set up the test store;
348@item -CPWN
349all tests should either pass or be skipped and this should
350also set up the test store@footnote{At the time of writing, June 2026,
351some tests might fail in a @option{-CPWN} shell; those are
352@url{https://codeberg.org/guix/guix/issues/9381, bugs}.};
353@item -CPW
354all network tests should automatically be skipped, but tests
355that require the test store are run, so those will fail unless the test store
356has been set up during an earlier test run with network access.
357@end table
358
359@quotation Note
360Some tests are skipped for other reasons, for example because they are
361only applicable for a specific system.
362@end quotation
363
364Test cases can run in parallel: you can use the @code{-j} option of
365GNU@tie{}make to speed things up. The first run may take a few minutes
366on a recent machine; subsequent runs will be faster because the store
367that is created for test purposes will already have various things in
368cache.
369
370It is also possible to run a subset of the tests by defining the
371@code{TESTS} makefile variable as in this example:
372
373@example
374make check TESTS="tests/store.scm tests/cpio.scm"
375@end example
376
377By default, tests results are displayed at a file level. In order to
378see the details of every individual test cases, it is possible to define
379the @code{SCM_LOG_DRIVER_FLAGS} makefile variable as in this example:
380
381@example
382make check TESTS="tests/base64.scm" SCM_LOG_DRIVER_FLAGS="--brief=no"
383@end example
384
385The underlying SRFI 64 custom Automake test driver used for the 'check'
386test suite (located at @file{build-aux/test-driver.scm}) also allows
387selecting which test cases to run at a finer level, via its
388@option{--select} and @option{--exclude} options. Here's an example, to
389run all the test cases from the @file{tests/packages.scm} test file
390whose names start with ``transaction-upgrade-entry'':
391
392@example
393export SCM_LOG_DRIVER_FLAGS="--select=^transaction-upgrade-entry"
394make check TESTS="tests/packages.scm"
395@end example
396
397Those wishing to inspect the results of failed tests directly from the
398command line can add the @option{--errors-only=yes} option to the
399@code{SCM_LOG_DRIVER_FLAGS} makefile variable and set the @code{VERBOSE}
400Automake makefile variable, as in:
401
402@example
403make check SCM_LOG_DRIVER_FLAGS="--brief=no --errors-only=yes" VERBOSE=1
404@end example
405
406The @option{--show-duration=yes} option can be used to print the
407duration of the individual test cases, when used in combination with
408@option{--brief=no}:
409
410@example
411make check SCM_LOG_DRIVER_FLAGS="--brief=no --show-duration=yes"
412@end example
413
414@xref{Parallel Test Harness,,,automake,GNU Automake} for more
415information about the Automake Parallel Test Harness.
416
417Upon failure, please see if there already exists an issue which
418describes your problem on @uref{https://codeberg.org/guix/guix/issues,
419Codeberg}, else create a new one and attach the @file{test-suite.log}
420file. Please specify the Guix version being used as well as version
421numbers of the dependencies (@pxref{Requirements}) in your message by
422running @code{./pre-inst-env guix describe}.
423
424Guix also comes with a whole-system test suite that tests complete
425Guix System instances. It can only run on systems where
426Guix is already installed, using:
427
428@example
429make check-system
430@end example
431
432@noindent
433or, again, by defining @code{TESTS} to select a subset of tests to run:
434
435@example
436make check-system TESTS="basic mcron"
437@end example
438
439These system tests are defined in the @code{(gnu tests @dots{})}
440modules. They work by running the operating systems under test with
441lightweight instrumentation in a virtual machine (VM). They can be
442computationally intensive or rather cheap, depending on whether
443substitutes are available for their dependencies (@pxref{Substitutes}).
444Some of them require a lot of storage space to hold VM images.
445
446If you encounter an error like:
447
448@example
449Compiling Scheme modules...
450ice-9/eval.scm:142:16: In procedure compile-top-call:
451error: all-system-tests: unbound variable
452hint: Did you forget `(use-modules (gnu tests))'?
453@end example
454
455@noindent
456there may be inconsistencies in the work tree from previous builds. To
457resolve this, try running @command{make clean-go} followed by
458@command{make}.
459
460Again in case of test failures, open an issue on
461@uref{https://codeberg.org/guix/guix/issues, Codeberg} with all the
462details.
463
464@node Running Guix Before It Is Installed
465@section Running Guix Before It Is Installed
466
467In order to keep a sane working environment, you will find it useful to
468test the changes made in your local source tree checkout without
469actually installing them. So that you can distinguish between your
470``end-user'' hat and your ``motley'' costume.
471
472To that end, all the command-line tools can be used even if you have not
473run @code{make install}. To do that, you first need to have an
474environment with all the dependencies available (@pxref{Building from
475Git}), and then simply prefix each command with @command{./pre-inst-env}
476(the @file{pre-inst-env} script lives in the top build tree of Guix;
477@pxref{Building from Git} to generate it). As an example, here is how you
478would build the @code{hello} package as defined in your working tree (this
479assumes @command{guix-daemon} is already running on your system; it's OK if
480it's a different version):
481
482@example
483$ ./pre-inst-env guix build hello
484@end example
485
486@noindent
487Similarly, an example for a Guile session using the Guix modules:
488
489@example
490$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
491
492;;; ("x86_64-linux")
493@end example
494
495@noindent
496@cindex REPL
497@cindex read-eval-print loop
498@dots{} and for a REPL (@pxref{Using Guix Interactively}):
499
500@example
501$ ./pre-inst-env guile
502scheme@@(guile-user)> ,use(guix)
503scheme@@(guile-user)> ,use(gnu)
504scheme@@(guile-user)> (define snakes
505 (fold-packages
506 (lambda (package lst)
507 (if (string-prefix? "python"
508 (package-name package))
509 (cons package lst)
510 lst))
511 '()))
512scheme@@(guile-user)> (length snakes)
513$1 = 361
514@end example
515
516If you are hacking on the daemon and its supporting code or if
517@command{guix-daemon} is not already running on your system, you can
518launch it straight from the build tree@footnote{The @option{-E} flag to
519@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set
520such that @command{guix-daemon} and the tools it uses can find the Guile
521modules they need.}:
522
523@example
524$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
525@end example
526
527The @command{pre-inst-env} script sets up all the environment variables
528necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}.
529
530Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
531local source tree; it simply updates the @file{~/.config/guix/current}
532symlink (@pxref{Invoking guix pull}). Run @command{git pull} instead if
533you want to upgrade your local source tree.
534
535Sometimes, especially if you have recently updated your repository,
536running @command{./pre-inst-env} will print a message similar to the
537following example:
538
539@example
540;;; note: source file /home/user/projects/guix/guix/progress.scm
541;;; newer than compiled /home/user/projects/guix/guix/progress.go
542@end example
543
544This is only a note and you can safely ignore it. You can get rid of
545the message by running @command{make -j4}. Until you do, Guile will run
546slightly slower because it will interpret the code instead of using
547prepared Guile object (@file{.go}) files.
548
549You can run @command{make} automatically as you work using
550@command{watchexec} from the @code{watchexec} package. For example,
551to build again each time you update a package file, run
552@samp{watchexec -w gnu/packages -- make -j4}.
553
554@node The Perfect Setup
555@section The Perfect Setup
556
557@cindex editor setup, for Scheme
558@cindex Scheme code editing
559All configuration and development in Guix is done in the Scheme
560language. Like all languages of the Lisp family, Scheme has a simple
561syntax. The perfect setup is one where the editor you choose makes
562working with that syntax seamless and pleasant; for that it must
563absolutely support a few things for Scheme:
564
565@itemize
566@item
567automatic indentation, such that hitting the ``Enter'' key (or
568@kbd{RET}) places cursor ``at the right place'' on the next line;
569@item
570``parentheses matching'', allowing you to jump from a closing
571parenthesis to the corresponding opening parenthesis and vice-versa;
572@item
573syntax highlighting, so that keywords are visually distinguishable.
574@end itemize
575
576The following optional features can make your life easier:
577
578@itemize
579@item
580structural editing of Scheme syntax;
581@item
582Guile integration so you can easily evaluate code, jump to procedure
583definitions, view documentation, and so on.
584@end itemize
585
586The following sections look at editor setups that are known to work
587well. Do share your setup for these and other editors for inclusion in
588this manual! @xref{Submitting Patches}.
589
590@menu
591* Emacs:: Best-of-breed editor for Scheme code.
592* Guile Studio:: First step in your transition to Emacs.
593* Vim and NeoVim:: Classical Unix editors.
594@end menu
595
596@node Emacs
597@subsection Emacs
598
599@url{https://www.gnu.org/software/emacs, Emacs} is probably the most
600widely used editor in the community; it is also the one that,
601historically, has always had excellent support for Lisp languages, being
602itself a Lisp implementation!
603
604@quotation Note
605If you are just getting started with Emacs, @pxref{Guile Studio} for a
606smooth way to start your transition.
607@end quotation
608
609Just like for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile
610Reference Manual}), Emacs works best when empowered by the wonderful
611@url{https://nongnu.org/geiser/, Geiser}. To set that up, run:
612
613@example
614guix install emacs guile emacs-geiser emacs-geiser-guile emacs-guix
615@end example
616
617Geiser allows for interactive and incremental development from within
618Emacs: code compilation and evaluation from within buffers, access to
619on-line documentation (docstrings), context-sensitive completion,
620@kbd{M-.} to jump to an object definition, a REPL to try out your code,
621and more (@pxref{Introduction,,, geiser, Geiser User Manual}). If you
622allow Emacs to load the @file{.dir-locals.el} file at the root of the
623project checkout, it will cause Geiser to automatically add the local
624Guix sources to the Guile load path.
625
626To actually edit the code, Emacs already has a neat Scheme mode. But in
627addition to that, you must not miss
628@url{https://www.emacswiki.org/emacs/ParEdit, Paredit}. It provides
629facilities to directly operate on the syntax tree, such as raising an
630s-expression or wrapping it, swallowing or rejecting the following
631s-expression, etc.
632
633Cherry on the cake: the Emacs-Guix package provides a convenient
634interface to many commands---e.g., it lets you browse packages, install
635or remove packages, and so on---as well as development helpers that
636enhance @code{scheme-mode} and Geiser. @xref{Introduction,,,
637emacs-guix, Emacs-Guix Reference Manual}, to make sure you don't miss
638out!
639
640@unnumberedsubsubsec Submitting Pull Requests Following the AGit Workflow
641
642@cindex AGit workflow, for pull requests (Emacs).
643@url{https://codeberg.org/halvin/agitjo, Agitjo} is a helper to ease
644AGit workflow based patch submission (@pxref{Submitting Patches}).
645Install it with:
646
647@example
648guix install emacs-agitjo
649@end example
650
651Assuming your local checkout is on the branch containing the changes you
652would like to submit for inclusion in the @code{master} branch, use
653@command{M-x agitjo-push} then:
654
655@itemize
656@item
657Set options like the title @option{-t} and the session identifier
658@option{-s}.
659@item
660Invoke one of the push commands to execute a @command{git push} operation.
661@end itemize
662
663When creating a new pull request, a dedicated buffer will open for
664drafting a description. The force-push option @option{-f} is enabled to
665push changes to the existing pull request.
666
667@unnumberedsubsubsec Taming Boilerplate with Templates
668
669@cindex code snippets
670@cindex templates
671@cindex reducing boilerplate
672We also provide templates for common git commit messages and package
673definitions in the @file{etc/snippets} directory. These templates can
674be used to expand short trigger strings to interactive text snippets. If
675you use @url{https://joaotavora.github.io/yasnippet/, YASnippet}, you
676may want to add the @file{etc/snippets/yas} snippets directory to the
677@var{yas-snippet-dirs} variable. If you use
678@url{https://github.com/minad/tempel/, Tempel}, you may want to add the
679@file{etc/snippets/tempel/*} path to the @var{tempel-path} variable in
680Emacs.
681
682@lisp
683;; @r{Assuming the Guix checkout is in ~/src/guix.}
684;; @r{Yasnippet configuration}
685(with-eval-after-load 'yasnippet
686 (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
687;; @r{Tempel configuration}
688(with-eval-after-load 'tempel
689 ;; Ensure tempel-path is a list -- it may also be a string.
690 (unless (listp 'tempel-path)
691 (setq tempel-path (list tempel-path)))
692 (add-to-list 'tempel-path "~/src/guix/etc/snippets/tempel/*"))
693@end lisp
694
695The commit message snippets depend on @url{https://magit.vc/, Magit} to
696display staged files. When editing a commit message type @code{add}
697followed by @kbd{TAB} to insert a commit message template for adding a
698package; type @code{update} followed by @kbd{TAB} to insert a template
699for updating a package; type @code{https} followed by @kbd{TAB} to
700insert a template for changing the home page URI of a package to HTTPS.
701
702The main snippet for @code{scheme-mode} is triggered by typing
703@code{package...} followed by @kbd{TAB}. This snippet also inserts the
704trigger string @code{origin...}, which can be expanded further. The
705@code{origin} snippet in turn may insert other trigger strings ending on
706@code{...}, which also can be expanded further.
707
708@unnumberedsubsubsec Updating Copyright Lines
709
710@cindex insert or update copyright
711@cindex @code{M-x guix-copyright}
712@cindex @code{M-x copyright-update}
713We additionally provide insertion and automatic update of a copyright in
714@file{etc/copyright.el}. You may want to set your full name, mail, and
715load a file.
716
717@lisp
718(setq user-full-name "Alice Doe")
719(setq user-mail-address "alice@@mail.org")
720;; @r{Assuming the Guix checkout is in ~/src/guix.}
721(load-file "~/src/guix/etc/copyright.el")
722@end lisp
723
724To insert a copyright at the current line invoke @code{M-x guix-copyright}.
725
726To update a copyright you need to specify a @code{copyright-names-regexp}.
727
728@lisp
729(setq copyright-names-regexp
730 (format "%s <%s>" user-full-name user-mail-address))
731@end lisp
732
733You can check if your copyright is up to date by evaluating @code{M-x
734copyright-update}. If you want to do it automatically after each buffer
735save then add @code{(add-hook 'after-save-hook 'copyright-update)} in
736Emacs.
737
738@unnumberedsubsubsec Referencing Bug Reports
739
740@cindex bug references, Emacs
741Emacs has a nice minor mode called @code{bug-reference}, which can be
742used to follow link to issues and pull requests such as @samp{#1234} or
743@samp{guix/guix#1234} (@pxref{Bug Reference,,, emacs, The GNU Emacs
744Manual}). To set it up, enable it in the relevant modes:
745
746@lisp
747(require 'bug-reference)
748(add-hook 'prog-mode-hook #'bug-reference-prog-mode)
749(add-hook 'erc-mode-hook #'bug-reference-mode)
750;; Add extra hooks for your mail user agent: Gnus, mu4e, etc.
751@end lisp
752
753When working from a Git checkout of Guix, setup is automatic:
754@code{bug-reference} automatically detects that the project is hosted on
755Codeberg and infers the issue and pull request URL from there.
756
757@node Guile Studio
758@subsection Guile Studio
759
760Guile Studio is a pre-configured Emacs with mostly everything you need
761to start hacking in Guile. If you are not familiar with Emacs it makes
762the transition easier for you.
763
764@example
765guix install guile-studio
766@end example
767
768Guile Studio comes with Geiser preinstalled and prepared for action.
769
770@node Vim and NeoVim
771@subsection Vim and NeoVim
772
773@cindex Vim, for Scheme code editing
774Vim (and NeoVim) are also packaged in Guix, in case these popular modal
775editors are more to your taste.
776
777@example
778guix install vim
779@end example
780
781If you want to enjoy a similar development experience to that in the perfect
782setup, you should install several plugins to configure the editor. Vim (and
783NeoVim) have the equivalent to Paredit,
784@uref{https://www.vim.org/scripts/script.php?script_id=3998,
785@code{paredit.vim}}, that will help you with the structural editing of Scheme
786files (the support for very large files is not great, though).
787
788@example
789guix install vim-paredit
790@end example
791
792We also recommend that you run @code{:set autoindent} so that your code is
793automatically indented as you type.
794
795For the interaction with Git,
796@uref{https://www.vim.org/scripts/script.php?script_id=2975,
797@code{fugitive.vim}} is the most commonly used plugin:
798
799@example
800guix install vim-fugitive
801@end example
802
803And of course if you want to interact with Guix directly from inside of
804vim, using the built-in terminal emulator, we have our very own
805@code{guix.vim} package!
806
807@example
808guix install vim-guix-vim
809@end example
810
811In NeoVim you can even make a similar setup to Geiser using
812@url{https://conjure.fun/, Conjure} that lets you connect to a running Guile
813process and inject your code there live (sadly it's not packaged in Guix yet).
814
815
816@node Source Tree Structure
817@section Source Tree Structure
818
819@cindex structure, of the source tree
820If you're willing to contribute to Guix beyond packages, or if you'd
821like to learn how it all fits together, this section provides a guided
822tour in the code base that you may find useful.
823
824Overall, the Guix source tree contains almost exclusively Guile
825@dfn{modules}, each of which can be seen as an independent library
826(@pxref{Modules,,, guile, GNU Guile Reference Manual}).
827
828The following table gives an overview of the main directories and what
829they contain. Remember that in Guile, each module name is derived from
830its file name---e.g., the module in file @file{guix/packages.scm} is
831called @code{(guix packages)}.
832
833@table @file
834@item guix
835This is the location of core Guix mechanisms. To illustrate what is
836meant by ``core'', here are a few examples, starting from low-level
837tools and going towards higher-level tools:
838
839@table @code
840@item (guix store)
841Connecting to and interacting with the build daemon (@pxref{The Store}).
842@item (guix derivations)
843Creating derivations (@pxref{Derivations}).
844@item (guix gexps)
845Writing G-expressions (@pxref{G-Expressions}).
846@item (guix packages)
847Defining packages and origins (@pxref{package Reference}).
848@item (guix download)
849@itemx (guix git-download)
850The @code{url-fetch} and @code{git-fetch} origin download methods
851(@pxref{origin Reference}).
852@item (guix swh)
853Fetching source code from the
854@uref{https://archive.softwareheritage.org,Software Heritage archive}.
855@item (guix search-paths)
856Implementing search paths (@pxref{Search Paths}).
857@item (guix build-system)
858The build system interface (@pxref{Build Systems}).
859@item (guix profiles)
860Implementing profiles.
861@end table
862
863@cindex build system, directory structure
864@item guix/build-system
865This directory contains specific build system implementations
866(@pxref{Build Systems}), such as:
867
868@table @code
869@item (guix build-system gnu)
870the GNU build system;
871@item (guix build-system cmake)
872the CMake build system;
873@item (guix build-system pyproject)
874The Python ``pyproject'' build system.
875@end table
876
877@item guix/build
878This contains code generally used on the ``build side''
879(@pxref{G-Expressions, strata of code}). This includes code used to
880build packages or other operating system components, as well as
881utilities:
882
883@table @code
884@item (guix build utils)
885Utilities for package definitions and more (@pxref{Build Utilities}).
886@item (guix build gnu-build-system)
887@itemx (guix build cmake-build-system)
888@itemx (guix build pyproject-build-system)
889Implementation of build systems, and in particular definition of their
890build phases (@pxref{Build Phases}).
891@item (guix build syscalls)
892Interface to the C library and to Linux system calls.
893@end table
894
895@cindex command-line tools, as Guile modules
896@cindex command modules
897@item guix/scripts
898This contains modules corresponding to @command{guix} sub-commands. For
899example, the @code{(guix scripts shell)} module exports the
900@code{guix-shell} procedure, which directly corresponds to the
901@command{guix shell} command (@pxref{Invoking guix shell}).
902
903@cindex importer modules
904@item guix/import
905This contains supporting code for the importers and updaters
906(@pxref{Invoking guix import}, and @pxref{Invoking guix refresh}). For
907example, @code{(guix import pypi)} defines the interface to PyPI, which
908is used by the @command{guix import pypi} command.
909@end table
910
911The directories we have seen so far all live under @file{guix/}. The
912other important place is the @file{gnu/} directory, which contains
913primarily package definitions as well as libraries and tools for Guix
914System (@pxref{System Configuration}) and Guix Home (@pxref{Home
915Configuration}), all of which build upon functionality provided by
916@code{(guix @dots{})} modules@footnote{For this reason, @code{(guix
917@dots{})} modules must generally not depend on @code{(gnu @dots{})}
918modules, with notable exceptions: @code{(guix build-system @dots{})}
919modules may look up packages at run time---e.g., @code{(guix
920build-system cmake)} needs to access the @code{cmake} variable at run
921time---, @code{(guix scripts @dots{})} often rely on @code{(gnu @dots{})}
922modules, and the same goes for some of the @code{(guix import @dots{})}
923modules.}.
924
925@table @file
926@cindex package modules
927@item gnu/packages
928This is by far the most crowded directory of the source tree: it
929contains @dfn{package modules} that export package definitions
930(@pxref{Package Modules}). A few examples:
931
932@table @code
933@item (gnu packages base)
934Module providing ``base'' packages: @code{glibc}, @code{coreutils},
935@code{grep}, etc.
936@item (gnu packages guile)
937Guile and core Guile packages.
938@item (gnu packages linux)
939The Linux-libre kernel and related packages.
940@item (gnu packages python)
941Python and core Python packages.
942@item (gnu packages python-xyz)
943Miscellaneous Python packages (we were not very creative).
944@end table
945
946In any case, you can jump to a package definition using @command{guix
947edit} (@pxref{Invoking guix edit}) and view its location with
948@command{guix show} (@pxref{Invoking guix package}).
949
950@findex search-patches
951@item gnu/packages/patches
952This directory contains patches applied against packages and obtained
953using the @code{search-patches} procedure.
954
955@item gnu/services
956This contains service definitions, primarily for Guix System
957(@pxref{Services}) but some of them are adapted and reused for Guix Home
958as we will see below. Examples:
959
960@table @code
961@item (gnu services)
962The service framework itself, which defines the service and service type
963data types (@pxref{Service Composition}).
964@item (gnu services base)
965``Base'' services (@pxref{Base Services}).
966@item (gnu services desktop)
967``Desktop'' services (@pxref{Desktop Services}).
968@item (gnu services shepherd)
969Support for Shepherd services (@pxref{Shepherd Services}).
970@end table
971
972You can jump to a service definition using @command{guix system edit}
973and view its location with @command{guix system search} (@pxref{Invoking
974guix system}).
975
976@item gnu/system
977These are core Guix System modules, such as:
978
979@table @code
980@item (gnu system)
981Defines @code{operating-system} (@pxref{operating-system Reference}).
982@item (gnu system file-systems)
983Defines @code{file-system} (@pxref{File Systems}).
984@item (gnu system mapped-devices)
985Defines @code{mapped-device} (@pxref{Mapped Devices}).
986@end table
987
988@item gnu/build
989These are modules that are either used on the ``build side'' when
990building operating systems or packages, or at run time by operating
991systems.
992
993@table @code
994@item (gnu build accounts)
995Creating @file{/etc/passwd}, @file{/etc/shadow}, etc. (@pxref{User
996Accounts}).
997@item (gnu build activation)
998Activating an operating system at boot time or reconfiguration time.
999@item (gnu build file-systems)
1000Searching, checking, and mounting file systems.
1001@item (gnu build linux-boot)
1002@itemx (gnu build hurd-boot)
1003Booting GNU/Linux and GNU/Hurd operating systems.
1004@item (gnu build linux-initrd)
1005Creating a Linux initial RAM disk (@pxref{Initial RAM Disk}).
1006@end table
1007
1008@item gnu/home
1009This contains all things Guix Home (@pxref{Home Configuration});
1010examples:
1011
1012@table @code
1013@item (gnu home services)
1014Core services such as @code{home-files-service-type}.
1015@item (gnu home services ssh)
1016SSH-related services (@pxref{Secure Shell}).
1017@end table
1018
1019@item gnu/installer
1020This contains the text-mode graphical system installer (@pxref{Guided
1021Graphical Installation}).
1022
1023@item gnu/machine
1024These are the @dfn{machine abstractions} used by @command{guix deploy}
1025(@pxref{Invoking guix deploy}).
1026
1027@item gnu/tests
1028This contains system tests---tests that spawn virtual machines to check
1029that system services work as expected (@pxref{Running the Test Suite}).
1030@end table
1031
1032Last, there's also a few directories that contain files that are
1033@emph{not} Guile modules:
1034
1035@table @file
1036@item nix
1037This is the C++ implementation of @command{guix-daemon}, inherited from
1038Nix (@pxref{Invoking guix-daemon}).
1039
1040@item tests
1041These are unit tests, each file corresponding more or less to one
1042module, in particular @code{(guix @dots{})} modules (@pxref{Running the
1043Test Suite}).
1044
1045@item doc
1046This is the documentation in the form of Texinfo files: this manual and
1047the Cookbook. @xref{Writing a Texinfo File,,, texinfo, GNU Texinfo},
1048for information on Texinfo markup language.
1049
1050@item po
1051This is the location of translations of Guix itself, of package synopses
1052and descriptions, of the manual, and of the cookbook. Note that
1053@file{.po} files that live here are pulled directly from Weblate
1054(@pxref{Translating Guix}).
1055
1056@item etc
1057Miscellaneous files: shell completions, support for systemd and other
1058init systems, Git hooks, etc.
1059@end table
1060
1061With all this, a fair chunk of your operating system is at your
1062fingertips! Beyond @command{grep} and @command{git grep}, @pxref{The
1063Perfect Setup} on how to navigate code from your editor, and
1064@pxref{Using Guix Interactively} for information on how to use Scheme
1065modules interactively. Enjoy!
1066
1067@node Packaging Guidelines
1068@section Packaging Guidelines
1069
1070@cindex packages, creating
1071The GNU distribution is nascent and may well lack some of your favorite
1072packages. This section describes how you can help make the distribution
1073grow.
1074
1075Free software packages are usually distributed in the form of
1076@dfn{source code tarballs}---typically @file{tar.gz} files that contain
1077all the source files. Adding a package to the distribution means
1078essentially two things: adding a @dfn{recipe} that describes how to
1079build the package, including a list of other packages required to build
1080it, and adding @dfn{package metadata} along with that recipe, such as a
1081description and licensing information.
1082
1083In Guix all this information is embodied in @dfn{package definitions}.
1084Package definitions provide a high-level view of the package. They are
1085written using the syntax of the Scheme programming language; in fact,
1086for each package we define a variable bound to the package definition,
1087and export that variable from a module (@pxref{Package Modules}).
1088However, in-depth Scheme knowledge is @emph{not} a prerequisite for
1089creating packages. For more information on package definitions,
1090@pxref{Defining Packages}.
1091
1092Once a package definition is in place, stored in a file in the Guix
1093source tree, it can be tested using the @command{guix build} command
1094(@pxref{Invoking guix build}). For example, assuming the new package is
1095called @code{gnew}, you may run this command from the Guix build tree
1096(@pxref{Running Guix Before It Is Installed}):
1097
1098@example
1099./pre-inst-env guix build gnew --keep-failed
1100@end example
1101
1102Using @code{--keep-failed} makes it easier to debug build failures since
1103it provides access to the failed build tree. Another useful
1104command-line option when debugging is @code{--log-file}, to access the
1105build log.
1106
1107If the package is unknown to the @command{guix} command, it may be that
1108the source file contains a syntax error, or lacks a @code{define-public}
1109clause to export the package variable. To figure it out, you may load
1110the module from Guile to get more information about the actual error:
1111
1112@example
1113./pre-inst-env guile -c '(use-modules (gnu packages gnew))'
1114@end example
1115
1116Once your package builds correctly, please send us a patch
1117(@pxref{Submitting Patches}). Well, if you need help, we will be happy to
1118help you too. Once the patch is committed in the Guix repository, the
1119new package automatically gets built on the supported platforms by
1120@url{https://@value{SUBSTITUTE-SERVER-1}, our continuous integration system}.
1121
1122@cindex substituter
1123Users can obtain the new package definition simply by running
1124@command{guix pull} (@pxref{Invoking guix pull}). When
1125@code{@value{SUBSTITUTE-SERVER-1}} is done building the package, installing the
1126package automatically downloads binaries from there
1127(@pxref{Substitutes}). The only place where human intervention is
1128needed is to review and apply the patch.
1129
1130
1131@menu
1132* Software Freedom:: What may go into the distribution.
1133* Extracting Bundled Dependencies:: Why do we unbundle dependencies.
1134* Package Naming:: What's in a name?
1135* Version Numbers:: When the name is not enough.
1136* Synopses and Descriptions:: Helping users find the right package.
1137* Snippets versus Phases:: Whether to use a snippet, or a build phase.
1138* Cyclic Module Dependencies:: Going full circle.
1139* Bulk Updates:: This Little Maneuver's Gonna Cost Us 51 Years.
1140* Emacs Packages:: Your Elisp fix.
1141* Python Modules:: A touch of British comedy.
1142* Perl Modules:: Little pearls.
1143* Java Packages:: Coffee break.
1144* Rust Crates:: Beware of oxidation.
1145* Elm Packages:: Trees of browser code
1146* Fonts:: Fond of fonts.
1147@end menu
1148
1149@node Software Freedom
1150@subsection Software Freedom
1151
1152@c Adapted from http://www.gnu.org/philosophy/philosophy.html.
1153@cindex free software
1154The GNU operating system has been developed so that users can have
1155freedom in their computing. GNU is @dfn{free software}, meaning that
1156users have the @url{https://www.gnu.org/philosophy/free-sw.html,four
1157essential freedoms}: to run the program, to study and change the program
1158in source code form, to redistribute exact copies, and to distribute
1159modified versions. Packages found in the GNU distribution provide only
1160software that conveys these four freedoms.
1161
1162In addition, the GNU distribution follow the
1163@url{https://www.gnu.org/distros/free-system-distribution-guidelines.html,free
1164software distribution guidelines}. Among other things, these guidelines
1165reject non-free firmware, recommendations of non-free software, and
1166discuss ways to deal with trademarks and patents.
1167
1168Some otherwise free upstream package sources contain a small and optional
1169subset that violates the above guidelines, for instance because this subset
1170is itself non-free code. When that happens, the offending items are removed
1171with appropriate patches or code snippets in the @code{origin} form of the
1172package (@pxref{Defining Packages}). This way, @code{guix
1173build --source} returns the ``freed'' source rather than the unmodified
1174upstream source.
1175
1176@node Extracting Bundled Dependencies
1177@subsection Extracting Bundled Dependencies
1178@cindex bundling
1179@cindex vendoring
1180@cindex bundled dependencies
1181@cindex vendored dependencies
1182
1183In Guix every package is supposed to be fully built from source
1184(@pxref{Bootstrapping}). This is at the heart of the security and user
1185freedom guarantees provided by the distribution, and it is what allows
1186Guix to correctly reason about the package graph, to apply transversal
1187changes (say, a security update on a single library) and have them
1188propagate to every dependent package.
1189
1190Some projects have the habit of distributing the source code of their
1191dependencies inside their release tarball or version controlled source
1192tree. This practice is called @dfn{bundling} and the dependencies
1193shipped this way are called @dfn{bundled dependencies} or in some cases
1194@dfn{vendored dependencies}. Common manifestations are a @file{vendor/}
1195directory in Go projects, a checked in @file{node_modules/} for
1196JavaScript, a populated @file{.cargo/vendor/} for Rust, or copies of
1197small C libraries shipped inside another project's tree.
1198
1199Bundling dependencies conflicts with several Guix invariants:
1200
1201@itemize
1202@item When a change must be made in a library---e.g., applying a security fix
1203or removing pre-generated code---that change would need to be repeated
1204in every single package that bundles it.
1205@item Guix mainline ships only free software: bundled trees frequently contain
1206minified blobs whose preferred form for modification is missing
1207(@pxref{Software Freedom}).
1208@item Duplicated source code inflates the closure size and makes
1209@command{guix size} (@pxref{Invoking guix size}) and @command{guix
1210graph} (@pxref{Invoking guix graph}) less useful as auditing tools.
1211@end itemize
1212
1213For these reasons, we do our best to remove bundled dependencies before
1214submitting a package.
1215
1216@subsubheading Removing Bundled Code
1217
1218Bundled dependencies should be removed in the package's @code{origin}
1219record, typically using a snippet or a patch, so that the source
1220returned by @command{guix build --source} corresponds to truly free,
1221unbundled sources (@pxref{Snippets versus Phases}). When the removal is
1222more involved, for example because it requires regenerating build files
1223or rewriting import paths, it is acceptable to do it in a build phase
1224instead.
1225
1226Once the bundled tree is gone, the package must be built against
1227existing Guix packages of the same dependencies. When such packages do
1228not yet exist, they must be added.
1229
1230@subsubheading Exceptions
1231
1232Removing bundled code is the rule, but in case a bundled dependency has
1233been changed up to the point that it isn't possible to build a package
1234with the unbundled version of the dependency, it can be considered as
1235part of the source tree it lives in. In general we don't care about
1236upstream's reason for bundling, only the practicality of the unbundling
1237job.
1238
1239@node Package Naming
1240@subsection Package Naming
1241
1242@cindex package name
1243A package actually has two names associated with it.
1244First, there is the name of the @emph{Scheme variable}, the one following
1245@code{define-public}. By this name, the package can be made known in the
1246Scheme code, for instance as input to another package. Second, there is
1247the string in the @code{name} field of a package definition. This name
1248is used by package management commands such as
1249@command{guix package} and @command{guix build}.
1250
1251Both are usually the same and correspond to the lowercase conversion of
1252the project name chosen upstream, with underscores replaced with
1253hyphens. For instance, GNUnet is available as @code{gnunet}, and
1254SDL_net as @code{sdl-net}.
1255
1256A noteworthy exception to this rule is when the project name is only a
1257single character, or if an older maintained project with the same name
1258already exists---regardless of whether it has already been packaged for
1259Guix. Use common sense to make such names unambiguous and meaningful.
1260For example, Guix's package for the shell called ``s'' upstream is
1261@code{s-shell} and @emph{not} @code{s}. Feel free to ask your fellow
1262hackers for inspiration.
1263
1264We do not add @code{lib} prefixes for library packages, unless these are
1265already part of the official project name. But @pxref{Python
1266Modules} and @ref{Perl Modules} for special rules concerning modules for
1267the Python and Perl languages.
1268
1269Font package names are handled differently, @pxref{Fonts}.
1270
1271
1272@node Version Numbers
1273@subsection Version Numbers
1274
1275@cindex package version
1276We usually package only the latest version of a given free software
1277project. But sometimes, for instance for incompatible library versions,
1278two (or more) versions of the same package are needed. These require
1279different Scheme variable names. We use the name as defined
1280in @ref{Package Naming}
1281for the most recent version; previous versions use the same name, suffixed
1282by @code{-} and the smallest prefix of the version number that may
1283distinguish the two versions.
1284
1285The name inside the package definition is the same for all versions of a
1286package and does not contain any version number.
1287
1288For instance, the versions 2.24.20 and 3.9.12 of GTK+ may be packaged as follows:
1289
1290@lisp
1291(define-public gtk+
1292 (package
1293 (name "gtk+")
1294 (version "3.9.12")
1295 ...))
1296(define-public gtk+-2
1297 (package
1298 (name "gtk+")
1299 (version "2.24.20")
1300 ...))
1301@end lisp
1302If we also wanted GTK+ 3.8.2, this would be packaged as
1303@lisp
1304(define-public gtk+-3.8
1305 (package
1306 (name "gtk+")
1307 (version "3.8.2")
1308 ...))
1309@end lisp
1310
1311@c See <https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00425.html>,
1312@c for a discussion of what follows.
1313@cindex version number, for VCS snapshots
1314Occasionally, we package snapshots of upstream's version control system
1315(VCS) instead of formal releases. This should remain exceptional,
1316because it is up to upstream developers to clarify what the stable
1317release is. Yet, it is sometimes necessary. So, what should we put in
1318the @code{version} field?
1319
1320Clearly, we need to make the commit identifier of the VCS snapshot
1321visible in the version string, but we also need to make sure that the
1322version string is monotonically increasing so that @command{guix package
1323--upgrade} can determine which version is newer. Since commit
1324identifiers, notably with Git, are not monotonically increasing, we add
1325a revision number that we increase each time we upgrade to a newer
1326snapshot. The resulting version string looks like this:
1327
1328@example
13292.0.11-3.cabba9e
1330 ^ ^ ^
1331 | | `-- upstream commit ID
1332 | |
1333 | `--- Guix package revision
1334 |
1335latest upstream version
1336@end example
1337
1338It is a good idea to strip commit identifiers in the @code{version}
1339field to, say, 7 digits. It avoids an aesthetic annoyance (assuming
1340aesthetics have a role to play here) as well as problems related to OS
1341limits such as the maximum shebang length (127 bytes for the Linux
1342kernel). There are helper functions for doing this for packages using
1343@code{git-fetch} or @code{hg-fetch} (see below). It is best to use the
1344full commit identifiers in @code{origin}s, though, to avoid ambiguities.
1345A typical package definition may look like this:
1346
1347
1348@lisp
1349(define my-package
1350 (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
1351 (revision "1")) ;Guix package revision
1352 (package
1353 (version (git-version "0.9" revision commit))
1354 (source (origin
1355 (method git-fetch)
1356 (uri (git-reference
1357 (url "git://example.org/my-package.git")
1358 (commit commit)))
1359 (sha256 (base32 "1mbikn@dots{}"))
1360 (file-name (git-file-name name version))))
1361 ;; @dots{}
1362 )))
1363@end lisp
1364
1365@deffn {Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT}
1366Return the version string for packages using @code{git-fetch}.
1367
1368@lisp
1369(git-version "0.2.3" "0" "93818c936ee7e2f1ba1b315578bde363a7d43d05")
1370@result{} "0.2.3-0.93818c9"
1371@end lisp
1372@end deffn
1373
1374@deffn {Procedure} hg-version @var{VERSION} @var{REVISION} @var{CHANGESET}
1375Return the version string for packages using @code{hg-fetch}. It works
1376in the same way as @code{git-version}.
1377@end deffn
1378
1379@node Synopses and Descriptions
1380@subsection Synopses and Descriptions
1381
1382@cindex package description
1383@cindex package synopsis
1384As we have seen before, each package in GNU@tie{}Guix includes a
1385synopsis and a description (@pxref{Defining Packages}). Synopses and
1386descriptions are important: They are what @command{guix package
1387--search} searches, and a crucial piece of information to help users
1388determine whether a given package suits their needs. Consequently,
1389packagers should pay attention to what goes into them.
1390
1391Synopses must start with a capital letter and must not end with a
1392period. They must not start with ``a'' or ``the'', which usually does
1393not bring anything; for instance, prefer ``File-frobbing tool'' over ``A
1394tool that frobs files''. The synopsis should say what the package
1395is---e.g., ``Core GNU utilities (file, text, shell)''---or what it is
1396used for---e.g., the synopsis for GNU@tie{}grep is ``Print lines
1397matching a pattern''.
1398
1399Keep in mind that the synopsis must be meaningful for a very wide
1400audience. For example, ``Manipulate alignments in the SAM format''
1401might make sense for a seasoned bioinformatics researcher, but might be
1402fairly unhelpful or even misleading to a non-specialized audience. It
1403is a good idea to come up with a synopsis that gives an idea of the
1404application domain of the package. In this example, this might give
1405something like ``Manipulate nucleotide sequence alignments'', which
1406hopefully gives the user a better idea of whether this is what they are
1407looking for.
1408
1409Descriptions should take between five and ten lines. Use full
1410sentences, and avoid using acronyms without first introducing them.
1411Please avoid marketing phrases such as ``world-leading'',
1412``industrial-strength'', and ``next-generation'', and avoid superlatives
1413like ``the most advanced''---they are not helpful to users looking for a
1414package and may even sound suspicious. Instead, try to be factual,
1415mentioning use cases and features.
1416
1417@cindex Texinfo markup, in package descriptions
1418Descriptions can include Texinfo markup, which is useful to introduce
1419ornaments such as @code{@@code} or @code{@@dfn}, bullet lists, or
1420hyperlinks (@pxref{Overview,,, texinfo, GNU Texinfo}). However you
1421should be careful when using some characters for example @samp{@@} and
1422curly braces which are the basic special characters in Texinfo
1423(@pxref{Special Characters,,, texinfo, GNU Texinfo}). User interfaces
1424such as @command{guix show} take care of rendering it
1425appropriately.
1426
1427Synopses and descriptions are translated by volunteers
1428@uref{https://translate.codeberg.org/projects/guix/packages, at
1429Weblate} so that as many users as possible can read them in
1430their native language. User interfaces search them and display them in
1431the language specified by the current locale.
1432
1433To allow @command{xgettext} to extract them as translatable strings,
1434synopses and descriptions @emph{must be literal strings}. This means
1435that you cannot use @code{string-append} or @code{format} to construct
1436these strings:
1437
1438@lisp
1439(package
1440 ;; @dots{}
1441 (synopsis "This is translatable")
1442 (description (string-append "This is " "*not*" " translatable.")))
1443@end lisp
1444
1445Translation is a lot of work so, as a packager, please pay even more
1446attention to your synopses and descriptions as every change may entail
1447additional work for translators. In order to help them, it is possible
1448to make recommendations or instructions visible to them by inserting
1449special comments like this (@pxref{xgettext Invocation,,, gettext, GNU
1450Gettext}):
1451
1452@lisp
1453;; TRANSLATORS: "X11 resize-and-rotate" should not be translated.
1454(description "ARandR is designed to provide a simple visual front end
1455for the X11 resize-and-rotate (RandR) extension. @dots{}")
1456@end lisp
1457
1458@node Snippets versus Phases
1459@subsection Snippets versus Phases
1460
1461@cindex snippets, when to use
1462The boundary between using an origin snippet versus a build phase to
1463modify the sources of a package can be elusive. Origin snippets are
1464typically used to remove unwanted files such as bundled libraries,
1465nonfree sources, or to apply simple substitutions. The source derived
1466from an origin should produce a source that can be used to build the
1467package on any system that the upstream package supports (i.e., act as
1468the corresponding source). In particular, origin snippets must not
1469embed store items in the sources; such patching should rather be done
1470using build phases. Refer to the @code{origin} record documentation for
1471more information (@pxref{origin Reference}).
1472
1473@node Cyclic Module Dependencies
1474@subsection Cyclic Module Dependencies
1475
1476While there cannot be circular dependencies between packages, Guile's
1477lax module loading mechanism allows circular dependencies between Guile
1478modules, which doesn't cause problems as long as the following
1479conditions are followed for two modules part of a dependency cycle:
1480
1481@cindex rules to cope with circular module dependencies
1482@enumerate
1483@item
1484Macros are not shared between the co-dependent modules
1485@item
1486Top-level variables are only referenced in delayed (@i{thunked}) package
1487fields: @code{arguments}, @code{native-inputs}, @code{inputs},
1488@code{propagated-inputs} or @code{replacement}
1489@item
1490Procedures referencing top-level variables from another module are not
1491called at the top level of a module themselves.
1492@end enumerate
1493
1494Straying away from the above rules may work while there are no
1495dependency cycles between modules, but given such cycles are confusing
1496and difficult to troubleshoot, it is best to follow the rules to avoid
1497introducing problems down the line.
1498
1499@noindent
1500Here is a common trap to avoid:
1501
1502@lisp
1503(define-public avr-binutils
1504 (package
1505 (inherit (cross-binutils "avr"))
1506 (name "avr-binutils")))
1507@end lisp
1508
1509In the above example, the @code{avr-binutils} package was defined in the
1510module @code{(gnu packages avr)}, and the @code{cross-binutils}
1511procedure in @code{(gnu packages cross-base)}. Because the
1512@code{inherit} field is not delayed (thunked), it is evaluated at the
1513top level at load time, which is problematic in the presence of module
1514dependency cycles. This could be resolved by turning the package into a
1515procedure instead, like:
1516
1517@lisp
1518(define (make-avr-binutils)
1519 (package
1520 (inherit (cross-binutils "avr"))
1521 (name "avr-binutils")))
1522@end lisp
1523
1524Care would need to be taken to ensure the above procedure is only ever
1525used in a package delayed fields or within another procedure also not
1526called at the top level.
1527
1528@node Bulk Updates
1529@subsection Bulk Updates
1530
1531@cindex packaging, maintenance
1532Sometimes you may need to update a monotonic collection of grouped
1533packages, in a particular module---e.g., @code{(gnu packages astronomy)}.
1534Doing so requires refreshing package versions, creating commits
1535following guidelines and testing them. Let's say there are 200+ packages
1536with fresh versions, you may deal with this task by applying the
1537following technique.
1538
1539Enter a development shell in your local Guix checkout, assuming you
1540already ran @code{bootstrap} and @code{configure}:
1541
1542@example
1543~$ guix shell --development guix
1544[env: /gnu/store/@dots{}-profile]
1545> ./pre-inst-env guix refresh --select=module:astronomy --update
1546> ./pre-inst-env etc/committer.scm
1547@end example
1548
1549The first command updates all packages in @code{(gnu packages
1550astronomy)} to the latest versions and writes changes back to the file.
1551The second invokes @code{etc/committer.scm} script, a helper script for
1552larger scale updates; it identifies each package diff and creates
1553corresponding commits with the correct style.
1554
1555If your machine is powerful enough, you may check that the whole
1556collection has no regressions and can still be built successfully:
1557@example
1558[env: /gnu/store/@dots{}-profile]
1559> ./pre-inst-env guix build $(./pre-inst-env guix package -A | awk '/astronomy.scm/@{print $1"@@"$2@}')
1560@end example
1561
1562@node Emacs Packages
1563@subsection Emacs Packages
1564
1565@cindex emacs, packaging
1566@cindex elisp, packaging
1567Emacs packages should preferably use the Emacs build system
1568(@pxref{emacs-build-system}), for uniformity and the benefits provided
1569by its build phases, such as the auto-generation of the autoloads file
1570and the byte compilation of the sources.
1571
1572The Elisp dependencies of Emacs packages are typically provided as
1573@code{propagated-inputs} when required at run time. As for other
1574packages, build or test dependencies should be specified as
1575@code{native-inputs}.
1576
1577Emacs packages sometimes depend on resources directories that should be
1578installed along the Elisp files. The @code{#:include} argument can be
1579used for that purpose, by specifying a list of regexps to match. The
1580best practice when using the @code{#:include} argument is to extend
1581rather than override its default value (accessible via the
1582@code{%default-include} variable). As an example, a yasnippet extension
1583package typically include a @file{snippets} directory, which could be
1584copied to the installation directory using:
1585
1586@lisp
1587#:include (cons "^snippets/" %default-include)
1588@end lisp
1589
1590When encountering problems, it is wise to check for the presence of the
1591@code{Package-Requires} extension header in the package main source
1592file, and whether any dependencies and their versions listed therein are
1593satisfied.
1594
1595@node Python Modules
1596@subsection Python Modules
1597
1598@cindex python
1599The standard way to generate a package definition is to use
1600@code{guix import pypi <name>}, where @var{name} is the name of the
1601Python package on @url{https://pypi.org, PyPI}, see @pxref{Invoking guix
1602import}. Please check with @code{guix lint <package-name>} that the
1603generated package is valid.
1604
1605To avoid confusion and naming clashes with other programming languages,
1606Python module packages should be prefixed with @code{python-}.
1607
1608If a project already contains the word @code{python}, please do not
1609repeat it; for instance, the module python-dateutil is packaged under
1610the name @code{python-dateutil}. If the project name starts with
1611@code{py}, it is kept and prefixed as described above (e.g.@:
1612@code{python-pytz}).
1613
1614@quotation Note
1615The standard build system for Python packages is Guix's implementation
1616of the @url{https://peps.python.org/pep-0517/, formal Python standard}
1617for specifying build requirements: @var{pyproject-build-system}.
1618The @var{python-build-system} which corresponds to the way Python
1619packages were built before PEP517, using the informally specified
1620@file{setup.py} file, is now deprecated. @var{pyproject-build-system}
1621will eventually be deprecated and renamed into
1622@var{python-build-system} after its removal.
1623@end quotation
1624
1625@subsubsection Specifying Dependencies
1626@cindex inputs, for Python packages
1627
1628Dependency information for Python packages is usually available in the
1629package source tree, with varying degrees of accuracy: in the
1630@file{pyproject.toml} file, the @file{setup.py} file, in
1631@file{requirements.txt}, or in @file{tox.ini} (the latter mostly for
1632test dependencies).
1633
1634When editing a recipe for a Python package, the goal is to map these
1635dependencies to the appropriate type of ``input'' (@pxref{package
1636Reference, inputs}). Although the @code{pypi} importer normally does a
1637good job (@pxref{Invoking guix import}), please verify the following
1638check list to determine which dependency goes where.
1639
1640@itemize
1641
1642@item
1643Python is packaged @emph{without} @code{setuptools} and @code{pip}
1644installed per default.
1645
1646@command{guix lint} will warn if @code{pip} or other unneeded
1647native-inputs are added.
1648
1649@item
1650Python dependencies required at run time go into
1651@code{propagated-inputs}. They are typically defined with the
1652@code{install_requires} keyword in @file{setup.py}, or in the
1653@file{requirements.txt} file.
1654
1655@item
1656Python packages required only at build time---e.g., those listed under
1657@code{build-system.requires} in @file{pyproject.toml} or with the
1658@code{setup_requires} keyword in @file{setup.py}---or dependencies only
1659for testing---e.g., those in @code{tests_require} or @file{tox.ini}---go into
1660@code{native-inputs}. The rationale is that (1) they do not need to be
1661propagated because they are not needed at run time, and (2) in a
1662cross-compilation context, it's the target ``native'' input.
1663
1664Examples are the @code{pytest}, @code{mock}, and @code{stestr} test
1665frameworks. Of course if any of these packages is also required at
1666run-time, it needs to go to @code{propagated-inputs}.
1667
1668@item
1669Anything that does not fall in the previous categories goes to
1670@code{inputs}, for example programs or C libraries required for building
1671Python packages containing C extensions.
1672
1673@item
1674If a Python package has optional dependencies (@code{extras_require}),
1675it is up to you to decide whether to add them or not, based on their
1676usefulness/overhead ratio (@pxref{Submitting Patches, @command{guix
1677size}}).
1678
1679@end itemize
1680
1681
1682@node Perl Modules
1683@subsection Perl Modules
1684
1685@cindex perl
1686Perl programs standing for themselves are named as any other package,
1687using the lowercase upstream name.
1688For Perl packages containing a single class, we use the lowercase class name,
1689replace all occurrences of @code{::} by dashes and prepend the prefix
1690@code{perl-}.
1691So the class @code{XML::Parser} becomes @code{perl-xml-parser}.
1692Modules containing several classes keep their lowercase upstream name and
1693are also prepended by @code{perl-}. Such modules tend to have the word
1694@code{perl} somewhere in their name, which gets dropped in favor of the
1695prefix. For instance, @code{libwww-perl} becomes @code{perl-libwww}.
1696
1697
1698@node Java Packages
1699@subsection Java Packages
1700
1701@cindex java
1702Java programs standing for themselves are named as any other package,
1703using the lowercase upstream name.
1704
1705To avoid confusion and naming clashes with other programming languages,
1706it is desirable that the name of a package for a Java package is
1707prefixed with @code{java-}. If a project already contains the word
1708@code{java}, we drop this; for instance, the package @code{ngsjava} is
1709packaged under the name @code{java-ngs}.
1710
1711For Java packages containing a single class or a small class hierarchy,
1712we use the lowercase class name, replace all occurrences of @code{.} by
1713dashes and prepend the prefix @code{java-}. So the class
1714@code{apache.commons.cli} becomes package
1715@code{java-apache-commons-cli}.
1716
1717
1718@node Rust Crates
1719@subsection Rust Crates
1720
1721@cindex rust
1722Rust applications (binary crates) and libraries (library crates) are packaged
1723separately. We put our main efforts into applications and only package
1724libraries as sources, utilizing automation with a manual focus on unbundling
1725vendored dependencies.
1726
1727Rust applications are treated like any other package and named using the
1728lowercase upstream name. When using the Cargo build system (@pxref{Build
1729Systems, @code{cargo-build-system}}), Rust applications should have the
1730@code{#:install-source?} parameter set to @code{#f}, as this parameter only
1731makes sense for libraries. When the package source is a Cargo workspace,
1732@code{#:cargo-install-paths} must be set to enable relevant support.
1733
1734Rust libraries are hidden from the user interface and managed in two modules:
1735
1736@table @code
1737@item (gnu packages rust-crates)
1738Source definitions imported from Rust packages' @file{Cargo.lock} via the
1739@code{crate} importer (@pxref{Invoking guix import}).
1740
1741Imported definitions must be checked and have vendored dependencies unbundled
1742before being contributed to Guix.
1743
1744@item (gnu packages rust-sources)
1745More complex definitions that need to be full packages. This includes Rust
1746libraries requiring external inputs to unbundle and Cargo workspaces.
1747
1748These libraries should have the @code{#:skip-build?} parameter set to @code{#t}.
1749For Cargo workspaces, @code{#:cargo-package-crates} must be set.
1750
1751Since they are added manually, they follow the usual naming convention for Guix
1752packages (@pxref{Package Naming}), with a @code{rust-} prefix.
1753
1754In the Rust community it is common for multiple incompatible versions of a
1755package to be used at any given time, so all libraries should have a versioned
1756suffix. The versioned suffix is the left-most non-zero digit (and any leading
1757zeros, of course). This follows the ``caret'' version scheme intended by Cargo.
1758Examples@: @code{rust-clap-2}, @code{rust-rand-0.6}.
1759
1760In practice we often package development snapshots of Rust libraries and can't
1761simply identify them by version. In this case, the complete version information
1762can be turned into a version string via @code{git-version}, for example
1763@code{rust-pipewire-0.8.0.fd3d8f7} and @code{rust-pubgrub-0.3.0.b70cf70}.
1764@end table
1765
1766When contributing Rust packages, we should have all modifications to these
1767two modules, in the same commit as the package we are contributing.
1768
1769To avoid merge conflicts with changes from multiple branches, these two modules
1770are maintained by the Rust team (@pxref{Teams}).
1771
1772@quotation Warning
1773The @code{(gnu packages rust-crates)} module must not be referenced
1774directly, lest it introduce the risk of cyclic module dependencies
1775(@pxref{Cyclic Module Dependencies}). Instead, the @code{cargo-inputs}
1776procedure from the @code{(guix build-sytem cargo)} module must be used
1777to lookup input lists generated by the lockfile importer.
1778@end quotation
1779
1780@cindex cargo inputs
1781@findex define-cargo-inputs
1782@findex lookup-cargo-inputs
1783@deffn {Procedure} cargo-inputs name [#:module '(gnu packages rust-crates)]
1784Lookup Cargo inputs for @var{name} in @var{module}, return an empty list if
1785unavailable.
1786
1787@var{name} must be consistent with the one used in lockfile importer invocation,
1788usually matching the variable name of the package:
1789
1790@example
1791$ guix import -i @file{gnu/packages/rust-crates.scm} crate -f @file{/path/to/Cargo.lock} @var{name}
1792@end example
1793
1794@var{module} must export a public interface @code{lookup-cargo-inputs}, a
1795template is available in the @file{etc/teams/rust} directory of Guix source
1796tree.
1797@end deffn
1798
1799@xref{Packaging Rust Crates,,, guix-cookbook, GNU Guix Cookbook}, for
1800packaging workflow.
1801
1802@subsubsection Commit messages
1803
1804The commit message must have a general brief mention to entry changes
1805in @code{(gnu packages rust-crates)}. For changes in @code{(gnu packages
1806rust-sources)}, the commit message must explicitly mention all changes to the
1807packages.
1808
1809Here are some examples for different situations:
1810
1811@itemize
1812
1813@item
1814Adding a new Rust package:
1815
1816@example
1817gnu: Add catppuccin-whiskers.
1818
1819* gnu/packages/rust-apps.scm (catppuccin-whiskers): New variable.
1820* gnu/packages/rust-crates.scm (lookup-cargo-inputs)
1821[catppuccin-whiskers]: New entry.
1822@end example
1823
1824@item
1825Updating a simple package:
1826
1827@example
1828gnu: watchexec: Update to 2.3.2.
1829
1830* gnu/packages/rust-apps.scm (watchexec): Update to 2.3.2.
1831* gnu/packages/rust-crates.scm (lookup-cargo-inputs)[watchexec]:
1832Update entry.
1833@end example
1834
1835@item
1836Updating a package with sources:
1837
1838@example
1839gnu: typst: Update to 0.14.0.
1840
1841* gnu/packages/rust-apps.scm (typst): Update to 0.14.0.
1842[arguments]<#:rust>: Use rust-1.88.
1843* gnu/packages/rust-crates.scm (lookup-cargo-inputs)[typst]: Update
1844entry.
1845[rust-syntect-5]: Rename to rust-syntect-5.2.
1846[rust-syntect-5.3]: New entry.
1847* gnu/packages/rust-sources.scm (rust-hypher-0.1): Update to 0.1.6.
1848(rust-syntect-5): Rename to rust-syntect-5.2.
1849[inputs]: Rename cargo-inputs rust-syntect-5 to rust-syntect-5.2.
1850(rust-syntect-5.3): New variable.
1851@end example
1852
1853@end itemize
1854
1855@subsubsection Resolving merge conflicts in Pull Requests
1856
1857For Rust crates, the recommended way to solve merge conflicts is to drop all
1858changes to @code{gnu/packages/rust-crates.scm}, rebase onto the desired branch
1859and run the lockfile importer again, manually adding back all relevant snippets
1860(if any).
1861
1862@xref{Common Workflow for Resolving Merge Conflicts on Existing Pull Requests,,, guix-cookbook, GNU Guix Cookbook} for
1863a suggested workflow on resolving merge conflicts.
1864
1865@node Elm Packages
1866@subsection Elm Packages
1867
1868@cindex Elm
1869Elm applications can be named like other software: their names need not
1870mention Elm.
1871
1872Packages in the Elm sense (see @code{elm-build-system} under @ref{Build
1873Systems}) are required use names of the format
1874@var{author}@code{/}@var{project}, where both the @var{author} and the
1875@var{project} may contain hyphens internally, and the @var{author} sometimes
1876contains uppercase letters.
1877
1878To form the Guix package name from the upstream name, we follow a convention
1879similar to Python packages (@pxref{Python Modules}), adding an @code{elm-}
1880prefix unless the name would already begin with @code{elm-}.
1881
1882In many cases we can reconstruct an Elm package's upstream name heuristically,
1883but, since conversion to a Guix-style name involves a loss of information,
1884this is not always possible. Care should be taken to add the
1885@code{'upstream-name} property when necessary so that @samp{guix import elm}
1886will work correctly (@pxref{Invoking guix import}). The most notable scenarios
1887when explicitly specifying the upstream name is necessary are:
1888
1889@enumerate
1890@item
1891When the @var{author} is @code{elm} and the @var{project} contains one or more
1892hyphens, as with @code{elm/virtual-dom}; and
1893
1894@item
1895When the @var{author} contains hyphens or uppercase letters, as with
1896@code{Elm-Canvas/raster-shapes}---unless the @var{author} is
1897@code{elm-explorations}, which is handled as a special case, so packages like
1898@code{elm-explorations/markdown} do @emph{not} need to use the
1899@code{'upstream-name} property.
1900@end enumerate
1901
1902The module @code{(guix build-system elm)} provides the following utilities for
1903working with names and related conventions:
1904
1905@deffn {Procedure} elm-package-origin @var{elm-name} @var{version} @
1906 @var{hash}
1907Returns a Git origin using the repository naming and tagging regime required
1908for a published Elm package with the upstream name @var{elm-name} at version
1909@var{version} with sha256 checksum @var{hash}.
1910
1911For example:
1912@lisp
1913(package
1914 (name "elm-html")
1915 (version "1.0.0")
1916 (source
1917 (elm-package-origin
1918 "elm/html"
1919 version
1920 (base32 "15k1679ja57vvlpinpv06znmrxy09lbhzfkzdc89i01qa8c4gb4a")))
1921 ...)
1922@end lisp
1923@end deffn
1924
1925@deffn {Procedure} elm->package-name @var{elm-name}
1926Returns the Guix-style package name for an Elm package with upstream name
1927@var{elm-name}.
1928
1929Note that there is more than one possible @var{elm-name} for which
1930@code{elm->package-name} will produce a given result.
1931@end deffn
1932
1933@deffn {Procedure} guix-package->elm-name @var{package}
1934Given an Elm @var{package}, returns the possibly-inferred upstream name, or
1935@code{#f} the upstream name is not specified via the @code{'upstream-name}
1936property and can not be inferred by @code{infer-elm-package-name}.
1937@end deffn
1938
1939@deffn {Procedure} infer-elm-package-name @var{guix-name}
1940Given the @var{guix-name} of an Elm package, returns the inferred upstream
1941name, or @code{#f} if the upstream name can't be inferred. If the result is
1942not @code{#f}, supplying it to @code{elm->package-name} would produce
1943@var{guix-name}.
1944@end deffn
1945
1946@node Fonts
1947@subsection Fonts
1948
1949@cindex fonts
1950For fonts that are in general not installed by a user for typesetting
1951purposes, or that are distributed as part of a larger software package,
1952we rely on the general packaging rules for software; for instance, this
1953applies to the fonts delivered as part of the X.Org system or fonts that
1954are part of TeX Live.
1955
1956To make it easier for a user to search for fonts, names for other packages
1957containing only fonts are constructed as follows, independently of the
1958upstream package name.
1959
1960The name of a package containing only one font family starts with
1961@code{font-}; it is followed by the foundry name and a dash @code{-}
1962if the foundry is known, and the font family name, in which spaces are
1963replaced by dashes (and as usual, all upper case letters are transformed
1964to lower case).
1965For example, the Gentium font family by SIL is packaged under the name
1966@code{font-sil-gentium}.
1967
1968For a package containing several font families, the name of the collection
1969is used in the place of the font family name.
1970For instance, the Liberation fonts consist of three families,
1971Liberation Sans, Liberation Serif and Liberation Mono.
1972These could be packaged separately under the names
1973@code{font-liberation-sans} and so on; but as they are distributed together
1974under a common name, we prefer to package them together as
1975@code{font-liberation}.
1976
1977In the case where several formats of the same font family or font collection
1978are packaged separately, a short form of the format, prepended by a dash,
1979is added to the package name. We use @code{-ttf} for TrueType fonts,
1980@code{-otf} for OpenType fonts and @code{-type1} for PostScript Type 1
1981fonts.
1982
1983
1984@node Coding Style
1985@section Coding Style
1986
1987In general our code follows the GNU Coding Standards (@pxref{Top,,,
1988standards, GNU Coding Standards}). However, they do not say much about
1989Scheme, so here are some additional rules.
1990
1991@menu
1992* Programming Paradigm:: How to compose your elements.
1993* Modules:: Where to store your code?
1994* Data Types and Pattern Matching:: Implementing data structures.
1995* Formatting Code:: Writing conventions.
1996@end menu
1997
1998@node Programming Paradigm
1999@subsection Programming Paradigm
2000
2001Scheme code in Guix is written in a purely functional style. One
2002exception is code that involves input/output, and procedures that
2003implement low-level concepts, such as the @code{memoize} procedure.
2004
2005@node Modules
2006@subsection Modules
2007@cindex build-side modules
2008@cindex host-side modules
2009Guile modules that are meant to be used on the builder side must live in
2010the @code{(guix build @dots{})} name space. They must not refer to
2011other Guix or GNU modules. However, it is OK for a ``host-side'' module
2012to use a build-side module. As an example, the @code{(guix
2013search-paths)} module should not be imported and used by a package since
2014it isn't meant to be used as a ``build-side'' module. It would also
2015couple the module with the package's dependency graph, which is
2016undesirable.
2017
2018Modules that deal with the broader GNU system should be in the
2019@code{(gnu @dots{})} name space rather than @code{(guix @dots{})}.
2020
2021@node Data Types and Pattern Matching
2022@subsection Data Types and Pattern Matching
2023
2024The tendency in classical Lisp is to use lists to represent everything,
2025and then to browse them ``by hand'' using @code{car}, @code{cdr},
2026@code{cadr}, and co. There are several problems with that style,
2027notably the fact that it is hard to read, error-prone, and a hindrance
2028to proper type error reports.
2029
2030@findex define-record-type*
2031@findex match-record
2032@cindex pattern matching
2033Guix code should define appropriate data types (for instance, using
2034@code{define-record-type*}) rather than abuse lists. In addition, it
2035should use pattern matching, via Guile’s @code{(ice-9 match)} module,
2036especially when matching lists (@pxref{Pattern Matching,,, guile, GNU
2037Guile Reference Manual}); pattern matching for records is better done
2038using @code{match-record} from @code{(guix records)}, which, unlike
2039@code{match}, verifies field names at macro-expansion time.
2040
2041When defining a new record type, keep the @dfn{record type descriptor}
2042(RTD) private (@pxref{Records,,, guile, GNU Guile Reference Manual}, for
2043more on records and RTDs). As an example, the @code{(guix packages)}
2044module defines @code{<package>} as the RTD for package records but it
2045does not export it; instead, it exports a type predicate, a constructor,
2046and field accessors. Exporting RTDs would make it harder to change the
2047application binary interface (because code in other modules might be
2048matching fields by position) and would make it trivial for users to
2049forge records of that type, bypassing any checks we may have in the
2050official constructor (such as ``field sanitizers'').
2051
2052@node Formatting Code
2053@subsection Formatting Code
2054
2055@cindex formatting code
2056@cindex coding style
2057When writing Scheme code, we follow common wisdom among Scheme
2058programmers. In general, we follow the
2059@url{https://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
2060Style Rules}. This document happens to describe the conventions mostly
2061used in Guile’s code too. It is very thoughtful and well written, so
2062please do read it.
2063
2064Some special forms introduced in Guix, such as the @code{substitute*}
2065macro, have special indentation rules. These are defined in the
2066@file{.dir-locals.el} file, which Emacs automatically uses. Also note
2067that Emacs-Guix provides @code{guix-devel-mode} mode that indents and
2068highlights Guix code properly (@pxref{Development,,, emacs-guix, The
2069Emacs-Guix Reference Manual}).
2070
2071@cindex indentation, of code
2072@cindex formatting, of code
2073If you do not use Emacs, please make sure your editor knows these rules.
2074To automatically indent a package definition, you can also run:
2075
2076@example
2077./pre-inst-env guix style @var{package}
2078@end example
2079
2080@noindent
2081@xref{Invoking guix style}, for more information.
2082
2083We require all top-level procedures to carry a docstring. This
2084requirement can be relaxed for simple private procedures in the
2085@code{(guix build @dots{})} name space, though.
2086
2087Procedures should not have more than four positional parameters. Use
2088keyword parameters for procedures that take more than four parameters.
2089
2090@node Copyright Matters
2091@section Copyright Matters
2092
2093@cindex project license, GNU GPL version 3 or later
2094GNU Guix is made available under the
2095@url{https://www.gnu.org/licenses/gpl-3.0.html, GNU GPL version 3 or
2096later} license, and authors retain their copyright. Below are some
2097copyright-related project policies.
2098
2099@subsection Copyright Notices
2100
2101@cindex copyright notices, usage in Guix
2102The copyright notices in Guix follow the guidance provided by the GNU
2103Project (@pxref{Copyright Notices,,,maintain,Information for Maintainers
2104of GNU Software}. Using ranges for adjacent years is preferred to
2105listing each individual years. Below is an example of the preferred
2106style used for copyright notices in source file headers:
2107
2108@lisp
2109;;; Copyright © 2019-2023, 2025 Your Name <email@@example.org>
2110@end lisp
2111
2112The above example means there were copyright-able changes made for the
2113years 2019, 2020, 2021, 2022, 2023 and 2025.
2114
2115@subsection Coding Assistants (LLM) Policy
2116@cindex LLM, policy
2117@cindex coding assistants policy
2118@cindex policy, coding assistants
2119@cindex policy, LLM
2120
2121We do not accept contributions that were written by, or based on code
2122written by, a @acronym{LLM, Large Language Model} coding assistant.
2123This is due to the uncertain copyright status of the outputs generated
2124by an LLM, which could be incompatible with and undermine the
2125@url{https://www.gnu.org/licenses/gpl-3.0.html, license} used by the GNU
2126Guix project.
2127
2128@node Submitting Patches
2129@section Submitting Patches
2130
2131@cindex pull requests
2132@cindex patch submission
2133Development is done using the Git distributed version control system.
2134Thus, access to the repository is not strictly necessary. We welcome
2135contributions as @dfn{pull requests} (PR) at
2136@url{https://codeberg.org/guix/guix/pulls/}@footnote{Before January 1st,
21372026, changes would be submitted by email to
2138@email{guix-patches@@gnu.org} and could be
2139@uref{https://issues.guix.gnu.org, browsed online}. In accordance with
2140@uref{https://codeberg.org/guix/guix-consensus-documents/src/branch/main/002-codeberg.md,
2141Guix Consensus Document 002}, this method is no longer supported.}.
2142
2143There are two ways to create a pull request:
2144
2145@itemize
2146@item
2147By creating a personal ``fork'' of @uref{https://codeberg.org/guix/guix,
2148the repository}, creating a branch with your changes, and
2149@uref{https://docs.codeberg.org/collaborating/pull-requests-and-git-flow/,
2150submitting a pull request for that branch}.
2151
2152@item
2153@cindex AGit workflow, for pull requests
2154By following the @uref{https://forgejo.org/docs/next/user/agit-support/,
2155@dfn{AGit workflow}}, which is somewhat more convenient and consumes
2156less disk space at Codeberg since it removes the need to create a
2157``fork''.
2158
2159Assuming your local checkout is on the branch containing the changes you
2160would like to submit for inclusion in the @code{master} branch, run:
2161
2162@example
2163git push origin HEAD:refs/for/master \
2164 -o topic=@var{topic} \
2165 -o title=@var{title} -o description=@var{description}
2166@end example
2167
2168@var{topic} must be an identifier without whitespace, similar to a
2169branch name; @var{title} and @var{description} are arbitrary text that
2170can be omitted, in which case the message of the last commit on the
2171branch fills that role.
2172
2173To send an update to an AGit pull request of yours, run:
2174
2175@example
2176git push origin HEAD:refs/for/master \
2177 -o topic=@var{topic} -o force-push=yes
2178@end example
2179
2180Codeberg automatically figures out which pull request @var{topic}
2181corresponds to and updates the associated branch.
2182@end itemize
2183
2184Contributors are encouraged to take a moment to set some Git
2185repository options (@pxref{Configuring Git}) first, which can improve
2186the readability of patches. Seasoned Guix developers may also want to
2187look at the section on commit access (@pxref{Commit Access}).
2188
2189Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
2190standards, GNU Coding Standards}); you can check the commit history for
2191examples.
2192
2193You can help make the review process more efficient, and increase the
2194chance that your patch will be reviewed quickly, by describing the
2195context of your patch and the impact you expect it to have. For
2196example, if your patch is fixing something that is broken, describe the
2197problem and how your patch fixes it. Tell us how you have tested your
2198patch. Will users of the code changed by your patch have to adjust
2199their workflow at all? If so, tell us how. In general, try to imagine
2200what questions a reviewer will ask, and answer those questions in
2201advance.
2202
2203Before submitting a patch that adds or modifies a package definition,
2204please run through this check list:
2205
2206@enumerate
2207@item
2208If the authors of the packaged software provide a cryptographic
2209signature for the release tarball, make an effort to verify the
2210authenticity of the archive. For a detached GPG signature file this
2211would be done with the @code{gpg --verify} command.
2212
2213@item
2214Take some time to provide an adequate synopsis and description for the
2215package. @xref{Synopses and Descriptions}, for some guidelines.
2216
2217@item
2218Run @command{guix lint @var{package}}, where @var{package} is the
2219name of the new or modified package, and fix any errors it reports
2220(@pxref{Invoking guix lint}).
2221
2222@item
2223Run @command{guix style @var{package}} to format the new package definition
2224according to the project's conventions (@pxref{Invoking guix style}).
2225
2226@item
2227Make sure the package builds on your platform, using @command{guix build
2228@var{package}}. Also build at least its direct dependents with
2229@command{guix build --dependents=1 @var{package}}
2230(@pxref{build-dependents, @command{guix build}}).
2231
2232@item
2233We recommend you also try building the package on other supported
2234platforms. As you may not have access to actual hardware platforms, we
2235recommend using the @code{qemu-binfmt-service-type} to emulate them. In
2236order to enable it, add the @code{virtualization} service module and the
2237following service to the list of services in your @code{operating-system}
2238configuration:
2239
2240@lisp
2241(service qemu-binfmt-service-type
2242 (qemu-binfmt-configuration
2243 (platforms (lookup-qemu-platforms "arm" "aarch64"))))
2244@end lisp
2245
2246Then reconfigure your system.
2247
2248You can then build packages for different platforms by specifying the
2249@code{--system} option. For example, to build the "hello" package for
2250the armhf or aarch64 architectures, you would run the following
2251commands, respectively:
2252@example
2253guix build --system=armhf-linux --rounds=2 hello
2254guix build --system=aarch64-linux --rounds=2 hello
2255@end example
2256
2257@item
2258@cindex bundling
2259Make sure the package does not use bundled copies of software already
2260available as separate packages.
2261
2262Sometimes, packages include copies of the source code of their
2263dependencies as a convenience for users. However, as a distribution, we
2264want to make sure that such packages end up using the copy we already
2265have in the distribution, if there is one. This improves resource usage
2266(the dependency is built and stored only once), and allows the
2267distribution to make transverse changes such as applying security
2268updates for a given software package in a single place and have them
2269affect the whole system---something that bundled copies prevent.
2270
2271@item
2272Take a look at the profile reported by @command{guix size}
2273(@pxref{Invoking guix size}). This will allow you to notice references
2274to other packages unwillingly retained. It may also help determine
2275whether to split the package (@pxref{Packages with Multiple Outputs}),
2276and which optional dependencies should be used. In particular, avoid
2277adding @code{texlive} as a dependency: because of its extreme size, use
2278@code{texlive-local-tree} procedure instead.
2279
2280@item
2281Check that dependent packages (if applicable) are not affected by the
2282change; @command{guix refresh --list-dependent @var{package}} will help you
2283do that (@pxref{Invoking guix refresh}).
2284
2285@item
2286@cindex determinism, of build processes
2287@cindex reproducible builds, checking
2288Check whether the package's build process is deterministic. This
2289typically means checking whether an independent build of the package
2290yields the exact same result that you obtained, bit for bit.
2291
2292A simple way to do that is by building the same package several times in
2293a row on your machine (@pxref{Invoking guix build}):
2294
2295@example
2296guix build --rounds=2 my-package
2297@end example
2298
2299This is enough to catch a class of common non-determinism issues, such
2300as timestamps or randomly-generated output in the build result.
2301
2302Another option is to use @command{guix challenge} (@pxref{Invoking guix
2303challenge}). You may run it once the package has been committed and
2304built by @code{@value{SUBSTITUTE-SERVER-1}} to check whether it obtains the same
2305result as you did. Better yet: Find another machine that can build it
2306and run @command{guix publish}. Since the remote build machine is
2307likely different from yours, this can catch non-determinism issues
2308related to the hardware---e.g., use of different instruction set
2309extensions---or to the operating system kernel---e.g., reliance on
2310@code{uname} or @file{/proc} files.
2311
2312@item
2313When writing documentation, please use gender-neutral wording when
2314referring to people, such as
2315@uref{https://en.wikipedia.org/wiki/Singular_they, singular
2316``they''@comma{} ``their''@comma{} ``them''}, and so forth.
2317
2318@item
2319Verify that your patch contains only one set of related changes.
2320Bundling unrelated changes together makes reviewing harder and slower.
2321
2322Examples of unrelated changes include the addition of several packages,
2323or a package update along with fixes to that package.
2324
2325@item
2326Please follow our code formatting rules, possibly running
2327@command{guix style} script to do that automatically for you
2328(@pxref{Formatting Code}).
2329
2330@item
2331When possible, use mirrors in the source URL (@pxref{Invoking guix download}).
2332Use reliable URLs, not generated ones. For instance, GitHub archives are not
2333necessarily identical from one generation to the next, so in this case it's
2334often better to clone the repository. Don't use the @code{name} field in
2335the URL: it is not very useful and if the name changes, the URL will probably
2336be wrong.
2337
2338@item
2339Check if Guix builds (@pxref{Building from Git}) and address the
2340warnings, especially those about use of undefined symbols.
2341
2342@item
2343Make sure your changes do not break Guix and simulate a @command{guix pull}
2344with:
2345@example
2346guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master --disable-authentication
2347@end example
2348
2349@end enumerate
2350
2351@menu
2352* Configuring Git::
2353@end menu
2354
2355@node Configuring Git
2356@subsection Configuring Git
2357@cindex git configuration
2358
2359If you have not done so already, you may wish to set a name and email
2360that will be associated with your commits (@pxref{telling git your name,
2361, Telling Git your name, git, Git User Manual}). If you wish to use a
2362different name or email just for commits in this repository, you can
2363use @command{git config --local}, or edit @file{.git/config} in the
2364repository instead of @file{~/.gitconfig}.
2365
2366Other important Git configuration will automatically be configured when
2367building the project (@pxref{Building from Git}).
2368
2369@node Tracking Bugs and Changes
2370@section Tracking Bugs and Changes
2371
2372This section describes how the Guix project tracks its bug reports,
2373patch submissions and topic branches.
2374
2375@menu
2376* The Issue Tracker:: The official bug and patch tracker.
2377* Managing Patches and Branches:: How changes to Guix are managed.
2378* Cuirass Build Notifications:: Be alerted of any breakage via RSS feeds.
2379@end menu
2380
2381@node The Issue Tracker
2382@subsection The Issue Tracker
2383
2384Bug reports (@dfn{issues}) and patch submissions (@dfn{pull requests})
2385are currently tracked at the @uref{https://codeberg.org/guix/guix,
2386project's home at Codeberg}.
2387
2388@node Managing Patches and Branches
2389@subsection Managing Patches and Branches
2390@cindex branching strategy
2391@cindex rebuild scheduling strategy
2392
2393@c TODO: Update when qa.guix is hooked up to Codeberg.
2394Submitted patches are picked up and tested by the quality assurance
2395service; the result of that testing eventually shows up on the dashboard
2396at @indicateurl{https://qa.guix.gnu.org/issue/@var{ISSUE_NUMBER}}, where
2397@var{ISSUE_NUMBER} is the number assigned by the issue tracker,
2398currently Debbugs (work is in progress to support Codeberg pull
2399requests). Leave time for a review, without committing anything.
2400
2401As an exception, some changes considered ``trivial'' or ``obvious'' may
2402be pushed directly to the @code{master} branch. This includes changes
2403to fix typos and reverting commits that caused immediate problems. This
2404is subject to being adjusted, allowing individuals to commit directly on
2405non-controversial changes on parts they’re familiar with.
2406
2407Changes which affect more than 300 dependent packages (@pxref{Invoking
2408guix refresh}) should first be pushed to a topic branch other than
2409@code{master}; the set of changes should be consistent---e.g., ``GNOME
2410update'', ``NumPy update'', etc. This allows for testing: the branch
2411will automatically show up at
2412@indicateurl{https://qa.guix.gnu.org/branch/@var{branch}}, with an
2413indication of its build status on various platforms.
2414
2415@cindex feature branches, coordination
2416To help coordinate the merging of branches, you must create a new
2417guix-patches issue each time you create a branch (@pxref{The Issue
2418Tracker}). The title of the issue requesting to merge a branch should
2419have the following format:
2420
2421@cindex merge requests, template
2422@example
2423Request for merging "@var{name}" branch
2424@end example
2425
2426The @url{https://qa.guix.gnu.org/, QA infrastructure} recognizes such
2427issues and lists the merge requests on its main page. The following
2428points apply to managing these branches:
2429
2430@enumerate
2431@item
2432The commits on the branch should be a combination of the patches
2433relevant to the branch. Patches not related to the topic of the branch
2434should go elsewhere.
2435
2436@item
2437Any changes that can be made on the master branch, should be made on the
2438master branch. If a commit can be split to apply part of the changes on
2439master, this is good to do.
2440
2441@item
2442It should be possible to re-create the branch by starting from master
2443and applying the relevant patches.
2444
2445@item
2446Avoid merging master in to the branch. Prefer rebasing or re-creating
2447the branch on top of an updated master revision.
2448
2449@item
2450Minimise the changes on master that are missing on the branch prior to
2451merging the branch in to master. This means that the state of the
2452branch better reflects the state of master should the branch be merged.
2453
2454@item
2455If you don't have commit access, create the ``Request for merging''
2456issue and request that someone creates the branch. Include a list of
2457issues/patches to include on the branch.
2458@end enumerate
2459
2460Normally branches will be merged in a ``first come, first merged''
2461manner, tracked through the guix-patches issues. If you agree on a
2462different order with those involved, you can track this by updating
2463which issues block@footnote{You can mark an issue as blocked by another
2464by emailing @email{control@@debbugs.gnu.org} with the following line in
2465the body of the email: @code{block XXXXX by YYYYY}. Where @code{XXXXX}
2466is the number for the blocked issue, and @code{YYYYY} is the number for
2467the issue blocking it.} which other issues. Therefore, to know which
2468branch is at the front of the queue, look for the oldest issue, or the
2469issue that isn't @dfn{blocked} by any other branch merges. An ordered
2470list of branches with the open issues is available at
2471@url{https://qa.guix.gnu.org}.
2472
2473Once a branch is at the front of the queue, wait until sufficient time
2474has passed for the build farms to have processed the changes, and for
2475the necessary testing to have happened. For example, you can check
2476@indicateurl{https://qa.guix.gnu.org/branch/@var{branch}} to see
2477information on some builds and substitute availability.
2478
2479Once the branch has been merged, the issue should be closed and the
2480branch deleted.
2481
2482@cindex work-in-progress branches, wip
2483@cindex wip branches
2484Sometimes, a branch may be a work in progress, for example for larger
2485efforts such as updating the GNOME desktop. In these cases, the branch
2486name should reflect this by having the @samp{wip-} prefix. The QA
2487infrastructure will avoid building work-in-progress branches, so that
2488the available resources can be better focused on building the branches
2489that are ready to be merged. When the branch is no longer a work in
2490progress, it should be renamed, with the @samp{wip-} prefix removed, and
2491only then should the merge requests be created, as documented earlier.
2492
2493@node Cuirass Build Notifications
2494@subsection Cuirass Build Notifications
2495
2496@cindex build event notifications, RSS feed
2497@cindex notifications, build events
2498Cuirass includes @acronym{RSS, Really Simple Syndication} feeds as one
2499of its features (@pxref{Notifications,,,cuirass}). Since
2500@url{https://ci.guix.gnu.org/, Berlin} runs an instance of Cuirass, this
2501feature can be used to keep track of recently broken or fixed packages
2502caused by changes pushed to the Guix git repository. Any RSS client can
2503be used. A good one, included with Emacs, is @xref{Gnus,,,gnus}. To
2504register the feed, copy its URL, then from the main Gnus buffer,
2505@samp{*Group*}, do the following:
2506
2507@cindex Gnus, configuration to read CI RSS feeds
2508@cindex RSS feeds, Gnus configuration
2509@example
2510@kbd{G R} https://ci.guix.gnu.org/events/rss/?specification=master RET
2511Guix CI - master RET Build events for specification master. RET
2512@end example
2513
2514@noindent
2515Then, back at the @samp{*Group*} buffer, press @kbd{s} to save the newly
2516added RSS group. As for any other Gnus group, you can update its
2517content by pressing the @kbd{g} key. You should now receive
2518notifications that read like:
2519
2520@example
2521 . [ ?: Cuirass ] Build tree-sitter-meson.aarch64-linux on master is fixed.
2522 . [ ?: Cuirass ] Build rust-pbkdf2.aarch64-linux on master is fixed.
2523 . [ ?: Cuirass ] Build rust-pbkdf2.x86_64-linux on master is fixed.
2524@end example
2525
2526@noindent
2527where each RSS entry contains a link to the Cuirass build details page
2528of the associated build.
2529
2530@node Teams
2531@section Teams
2532@cindex teams
2533
2534To organize work on Guix, including but not just development efforts,
2535the project has a set of @dfn{teams}. Each team has its own focus and
2536interests and is the primary contact point for questions and
2537contributions in those areas. A team's primary mission is to coordinate
2538and review the work of individuals in its scope (@pxref{Reviewing the
2539Work of Others}); it can make decisions within its scope, in agreement
2540with other teams whenever there is overlap or a close connection, and in
2541accordance with other project rules such as seeking consensus
2542(@pxref{Making Decisions}).
2543
2544As an example, the Python team is responsible for core Python packaging
2545matters; it can decide to upgrade core Python packages in a dedicated
2546@code{python-team} branch, in collaboration with any team whose scope is
2547directly dependent on Python---e.g., the Science team---and following
2548branching rules (@pxref{Managing Patches and Branches}). The
2549Documentation team helps review changes to the documentation and can
2550initiate overarching documentation changes. The Translations team
2551organizes translation of Guix and its manual and coordinates efforts in
2552that area. The Core team is responsible for the development of core
2553functionality and interfaces of Guix; because of its central nature,
2554some of its work may require soliciting input from the community at
2555large and seeking consensus before enacting decisions that would affect
2556the entire community.
2557
2558Teams are defined in the @file{etc/teams.scm} file in the Guix
2559repository. The scope of each team is defined, when applicable, as a
2560set of files or as a regular expression matching file names.
2561
2562@cindex team membership
2563Anyone with interest in a team's domain and willing to contribute to its
2564work can apply to become a member by contacting current members by
2565email; commit access is not a precondition. Membership is formalized by
2566adding the person's name and email address to @file{etc/teams.scm}.
2567Members who have not been participating in the team's work for one year
2568or more may be removed; they are free to reapply for membership later.
2569
2570@cindex team creation
2571One or more people may propose the creation of a new team by reaching
2572out to the community by email at @email{guix-devel@@gnu.org}, clarifying
2573the intended scope and purpose. When consensus is reached on the
2574creation of this team, someone with commit access formalizes its
2575creation by adding it and its initial members to @file{etc/teams.scm}.
2576
2577To list existing teams, run the following command from a Guix checkout:
2578
2579@example
2580$ ./etc/teams.scm list-teams
2581id: mentors
2582name: Mentors
2583description: A group of mentors who chaperone contributions by newcomers.
2584members:
2585+ Charlie Smith <charlie@@example.org>
2586@dots{}
2587@end example
2588
2589@cindex teams, on Codeberg
2590To generate a @file{CODEOWNERS} file, which Forgejo---the software
2591behind Codeberg---uses to determine which team or person should review
2592changes to a given set of files, run:
2593
2594@example
2595./etc/teams.scm codeowners > CODEOWNERS
2596@end example
2597
2598Teams defined in @file{etc/teams.scm} are reflected
2599@uref{https://codeberg.org/guix/guix, on Codeberg}; the ``Owners'' team
2600on Codeberg, whose members have administration privileges over
2601@uref{https://codeberg.org/guix, the entire ``organization''}, is the
2602only one missing from this file. To synchronize team changes with
2603Codeberg, a member of the ``Owners'' team can run:
2604
2605@example
2606./etc/teams.scm sync-codeberg-teams @var{token}
2607@end example
2608
2609@noindent
2610... where @var{token} is a token created via the
2611@url{https://codeberg.org/user/settings/applications, Codeberg
2612applications settings page}, granting read/write access to the
2613@samp{organization} permission.
2614
2615@node Making Decisions
2616@section Making Decisions
2617
2618@cindex decision making
2619@cindex consensus seeking
2620Every contribution to the project involves a form of decision making.
2621It is expected from all contributors, and even more so from committers,
2622to help build consensus and make decisions based on consensus. By using
2623consensus, we are committed to finding solutions that everyone can live
2624with. It implies that no decision is made against significant concerns
2625and these concerns are actively resolved with proposals that work for
2626everyone.
2627
2628A contributor (who may or may not have commit access) wishing to block
2629a proposal bears a special responsibility for finding alternatives,
2630proposing ideas/code or explain the rationale for the status quo to
2631resolve the deadlock. To learn what consensus decision making means and
2632understand its finer details, you are encouraged to read
2633@url{https://www.seedsforchange.org.uk/consensus}.
2634
2635Day-to-day decision making, for instance discussions about pull requests
2636(@pxref{Reviewing the Work of Others}), happens informally among
2637interested parties such as contributors and members of the relevant
2638teams (@pxref{Teams}).
2639
2640@cindex GCD, Guix Consensus Documents
2641@cindex Guix Consensus Documents (GCD)
2642Decisions that are expected to have an impact on most contributors
2643and/or on the broader user community---e.g., changes to project-wide
2644policies, to core functionality, and so on---are made following the
2645@acronym{GCD, Guix Consensus Document} process. The process provides a
2646framework to formalize proposals and draw attention to them, to leave
2647time for interested parties to discuss them, and to collectively accept
2648or withdraw them based on input from participating team members. It is
2649defined in
2650@uref{https://consensus.guix.gnu.org/gcd/001-gcd-process.html,
2651GCD@tie{}001}. Past GCDs can be seen at
2652@uref{https://consensus.guix.gnu.org}, and discussions take place at
2653@uref{https://codeberg.org/guix/guix-consensus-documents}.
2654
2655@node Commit Access
2656@section Commit Access
2657
2658@cindex commit access, for developers
2659Everyone can contribute to Guix without having commit access
2660(@pxref{Submitting Patches}). However, for frequent contributors,
2661having write access to the repository can be convenient. As a rule of
2662thumb, a contributor should have accumulated fifty (50) reviewed commits
2663to be considered as a committer and have sustained their activity in the
2664project for at least 6 months. This ensures enough interactions with
2665the contributor, which is essential for mentoring and assessing whether
2666they are ready to become a committer. Commit access should not be
2667thought of as a ``badge of honor'' but rather as a responsibility a
2668contributor is willing to take to help the project.
2669
2670Committers are in a position where they enact technical decisions. Such
2671decisions must be made by @emph{actively building consensus} among
2672interested parties and stakeholders. @xref{Making Decisions}, for more
2673on that.
2674
2675The following sections explain how to get commit access, how to be ready
2676to push commits, and the policies and community expectations for commits
2677pushed upstream.
2678
2679@subsection Applying for Commit Access
2680
2681When you deem it necessary, consider applying for commit
2682access by following these steps:
2683
2684@enumerate
2685@item
2686Find three committers who would vouch for you. Each of them should
2687email a statement to @email{guix-maintainers@@gnu.org} (a private alias
2688for the collective of maintainers), signed with their OpenPGP key.
2689
2690Committers are expected to have had some interactions with you as a
2691contributor and to be able to judge whether you are sufficiently
2692familiar with the project's practices. It is @emph{not} a judgment on
2693the value of your work, so a refusal should rather be interpreted as
2694``let's try again later''.
2695
2696@item
2697Send @email{guix-maintainers@@gnu.org} a message stating your intent,
2698listing the three committers who support your application, signed with
2699the OpenPGP key you will use to sign commits, and giving its fingerprint
2700(see below). See @uref{https://emailselfdefense.fsf.org/en/}, for an
2701introduction to public-key cryptography with GnuPG.
2702
2703@c See <https://sha-mbles.github.io/>.
2704Set up GnuPG such that it never uses the SHA1 hash algorithm for digital
2705signatures, which is known to be unsafe since 2019, for instance by
2706adding the following line to @file{~/.gnupg/gpg.conf} (@pxref{GPG
2707Esoteric Options,,, gnupg, The GNU Privacy Guard Manual}):
2708
2709@example
2710digest-algo sha512
2711@end example
2712
2713@item
2714Maintainers ultimately decide whether to grant you commit access,
2715usually following your referrals' recommendation.
2716
2717@item
2718@cindex OpenPGP, signed commits
2719If and once you've been given access, please send a message to
2720@email{guix-devel@@gnu.org} to say so, again signed with the OpenPGP key
2721you will use to sign commits (do that before pushing your first commit).
2722That way, everyone can notice and ensure you control that OpenPGP key.
2723
2724@quotation Important
2725Before you can push for the first time, maintainers must:
2726
2727@enumerate
2728@item
2729add your OpenPGP key to the @code{keyring} branch;
2730@item
2731add your OpenPGP fingerprint to the @file{.guix-authorizations} file of
2732the branch(es) you will commit to.
2733@end enumerate
2734@end quotation
2735
2736@item
2737Make sure to read the rest of this section and... profit!
2738@end enumerate
2739
2740@quotation Note
2741Maintainers are happy to give commit access to people who have been
2742contributing for some time and have a track record---don't be shy and
2743don't underestimate your work!
2744
2745However, note that the project is working towards a more automated patch
2746review and merging system, which, as a consequence, may lead us to have
2747fewer people with commit access to the main repository. Stay tuned!
2748@end quotation
2749
2750All commits that are pushed to the central repository on Codeberg must
2751be signed with an OpenPGP key, and the public key should be uploaded to
2752your user account on Codeberg and to public key servers, such as
2753@code{keys.openpgp.org}. To configure Git to automatically sign
2754commits, run:
2755
2756@example
2757git config commit.gpgsign true
2758
2759# Substitute the fingerprint of your public PGP key.
2760git config user.signingkey CABBA6EA1DC0FF33
2761@end example
2762
2763To check that commits are signed with correct key, use:
2764
2765@example
2766guix git authenticate
2767@end example
2768
2769@xref{Building from Git} for running the first authentication of a Guix
2770checkout.
2771
2772To avoid accidentally pushing unsigned or signed with the wrong key
2773commits to Codeberg, make sure to configure Git according to
2774@xref{Configuring Git}.
2775
2776@subsection Commit Policy
2777
2778If you get commit access, please make sure to follow the policy below
2779(discussions of the policy can take place on
2780@email{guix-devel@@gnu.org}).
2781
2782Ensure you're aware of how the changes should be handled
2783(@pxref{Managing Patches and Branches}) prior to being pushed to the
2784repository, especially for the @code{master} branch.
2785
2786If you're committing and pushing your own changes, try and wait at least
2787one week (two weeks for more significant changes, up to one month for
2788changes such as removing a package---@pxref{package-removal-policy,
2789Package Removal}) after you send them for review. After this, if no one
2790else is available to review them and if you're confident about the
2791changes, it's OK to commit.
2792
2793When pushing a commit on behalf of somebody else, please add a
2794@code{Signed-off-by} line at the end of the commit log message---e.g.,
2795with @command{git am --signoff}. This improves tracking of who did
2796what.
2797
2798When adding channel news entries (@pxref{Channels, Writing Channel
2799News}), make sure they are well-formed by running the following command
2800right before pushing:
2801
2802@example
2803make check-channel-news
2804@end example
2805
2806@subsection Addressing Issues
2807
2808Peer review (@pxref{Submitting Patches}) and tools such as
2809@command{guix lint} (@pxref{Invoking guix lint}) and the test suite
2810(@pxref{Running the Test Suite}) should catch issues before they are
2811pushed. Yet, commits that ``break'' functionality might occasionally
2812go through. When that happens, there are two priorities: mitigating
2813the impact, and understanding what happened to reduce the chance of
2814similar incidents in the future. The responsibility for both these
2815things primarily lies with those involved, but like everything this is
2816a group effort.
2817
2818Some issues can directly affect all users---for instance because they
2819make @command{guix pull} fail or break core functionality, because they
2820break major packages (at build time or run time), or because they
2821introduce known security vulnerabilities.
2822
2823@cindex reverting commits
2824The people involved in authoring, reviewing, and pushing such
2825commit(s) should be at the forefront to mitigate their impact in a
2826timely fashion: by pushing a followup commit to fix it (if possible),
2827or by reverting it to leave time to come up with a proper fix, and by
2828communicating with other developers about the problem.
2829
2830If these persons are unavailable to address the issue in time, other
2831committers are entitled to revert the commit(s), explaining in the
2832commit log and on the mailing list what the problem was, with the goal
2833of leaving time to the original committer, reviewer(s), and author(s)
2834to propose a way forward.
2835
2836Once the problem has been dealt with, it is the responsibility of
2837those involved to make sure the situation is understood. If you are
2838working to understand what happened, focus on gathering information
2839and avoid assigning any blame. Do ask those involved to describe what
2840happened, do not ask them to explain the situation---this would
2841implicitly blame them, which is unhelpful. Accountability comes from
2842a consensus about the problem, learning from it and improving
2843processes so that it's less likely to reoccur.
2844
2845@subsubsection Reverting commits
2846
2847Like normal commits, the commit message should state why the changes are
2848being made, which in this case would be why the commits are being
2849reverted.
2850
2851If the changes are being reverted because they led to excessive number
2852of packages being affected, then a decision should be made whether to
2853allow the build farms to build the changes, or whether to avoid
2854this. For the bordeaux build farm, commits can be ignored by adding them
2855to the @code{ignore-commits} list in the
2856@code{build-from-guix-data-service} record, found in the bayfront
2857machine configuration.
2858
2859@subsection Commit Revocation
2860
2861In order to reduce the possibility of mistakes, committers will have
2862their Codeberg account removed from the Guix Codeberg project and their
2863key removed from @file{.guix-authorizations} after 12 months of
2864inactivity; they can ask to regain commit access by emailing the
2865maintainers, without going through the vouching process.
2866
2867Maintainers@footnote{See @uref{https://guix.gnu.org/en/about} for the
2868current list of maintainers. You can email them privately at
2869@email{guix-maintainers@@gnu.org}.} may also revoke an individual's
2870commit rights, as a last resort, if cooperation with the rest of the
2871community has caused too much friction---even within the bounds of the
2872project's code of conduct (@pxref{Contributing}). They would only do so
2873after public or private discussion with the individual and a clear
2874notice. Examples of behavior that hinders cooperation and could lead to
2875such a decision include:
2876
2877@itemize
2878@item repeated violation of the commit policy stated above;
2879@item repeated failure to take peer criticism into account;
2880@item breaching trust through a series of grave incidents.
2881@end itemize
2882
2883When maintainers resort to such a decision, they notify developers on
2884@email{guix-devel@@gnu.org}; inquiries may be sent to
2885@email{guix-maintainers@@gnu.org}. Depending on the situation, the
2886individual may still be welcome to contribute.
2887
2888@subsection Helping Out
2889
2890One last thing: the project keeps moving forward because committers not
2891only push their own awesome changes, but also offer some of their time
2892@emph{reviewing} and pushing other people's changes. As a committer,
2893you're welcome to use your expertise and commit rights to help other
2894contributors, too!
2895
2896@node Reviewing the Work of Others
2897@section Reviewing the Work of Others
2898
2899Perhaps the biggest action you can do to help GNU Guix grow as a project
2900is to review the work contributed by others. You do not need to be a
2901committer to do so; applying, reading the source, building, linting and
2902running other people's series and sharing your comments about your
2903experience will give some confidence to committers. You must
2904ensure the check list found in the @ref{Submitting Patches} section has
2905been correctly followed. A reviewed patch series should give the best
2906chances for the proposed change to be merged faster, so if a change you
2907would like to see merged hasn't yet been reviewed, this is the most
2908appropriate thing to do! If you would like to review changes in a
2909specific area and to receive notifications for incoming patches relevant
2910to that domain, consider joining the relevant team(s) (@pxref{Teams}).
2911
2912@cindex reviewing, guidelines
2913Review comments should be unambiguous; be as clear and explicit as you
2914can about what you think should be changed, ensuring the author can take
2915action on it. Please try to keep the following guidelines in mind
2916during review:
2917
2918@enumerate
2919@item
2920@emph{Be clear and explicit about changes you are suggesting}, ensuring
2921the author can take action on it. In particular, it is a good idea to
2922explicitly ask for new revisions when you want it.
2923
2924@item
2925@emph{Remain focused: do not change the scope of the work being
2926reviewed.} For example, if the contribution touches code that follows a
2927pattern deemed unwieldy, it would be unfair to ask the submitter to fix
2928all occurrences of that pattern in the code; to put it simply, if a
2929problem unrelated to the patch at hand was already there, do not ask the
2930submitter to fix it.
2931
2932@item
2933@emph{Ensure progress.} As they respond to review, submitters may
2934submit new revisions of their changes; avoid requesting changes that you
2935did not request in the previous round of comments. Overall, the
2936submitter should get a clear sense of progress; the number of items open
2937for discussion should clearly decrease over time.
2938
2939@item
2940@emph{Aim for finalization.} Reviewing code is time-consuming. Your
2941goal as a reviewer is to put the process on a clear path towards
2942integration, possibly with agreed-upon changes, or rejection, with a
2943clear and mutually-understood reasoning. Avoid leaving the review
2944process in a lingering state with no clear way out.
2945
2946@item
2947@emph{Review is a discussion.} The submitter's and reviewer's views on
2948how to achieve a particular change may not always be aligned. To lead
2949the discussion, remain focused, ensure progress and aim for
2950finalization, spending time proportional to the stakes@footnote{The
2951tendency to discuss minute details at length is often referred to as
2952``bikeshedding'', where much time is spent discussing each one's
2953preference for the color of the shed at the expense of progress made on
2954the project to keep bikes dry.}. As a reviewer, try hard to explain the
2955rationale for suggestions you make, and to understand and take into
2956account the submitter's motivation for doing things in a certain way.
2957In other words, build consensus with everyone involved (@pxref{Making
2958Decisions}).
2959@end enumerate
2960
2961When you deem the proposed change adequate and ready for inclusion
2962in Guix, you can explicitly say so for pull requests on Codeberg, for
2963example by selecting ``Approve changes'' in the ``Finish review'' dialog
2964of the web interface.
2965
2966@cindex LGTM, Looks Good To Me
2967@cindex review tags
2968@cindex Reviewed-by, git trailer
2969The following well understood/codified
2970@samp{Reviewed-by:@tie{}Your@tie{}Name@tie{}<your-email@@example.com>}
2971@footnote{The @samp{Reviewed-by} Git trailer is used by other projects
2972such as Linux, and is understood by third-party tools such as the
2973@samp{b4 am} sub-command, which is able to retrieve the complete
2974submission email thread from a public-inbox instance and add the Git
2975trailers found in replies to the commit patches.} line should be used to
2976sign off as a reviewer, meaning you have reviewed the change and that it
2977looks good to you:
2978
2979@itemize
2980@item
2981If the @emph{whole} series (containing multiple commits) looks good to
2982you, reply with
2983@samp{Reviewed-by:@tie{}Your@tie{}Name@tie{}<your-email@@example.com>}
2984to the cover page if it has one, or to the last patch of the series
2985otherwise, adding another @samp{(for the whole series)} comment on the
2986line below to explicit this fact.
2987
2988@item
2989If you instead want to mark a @emph{single commit} as reviewed (but not
2990the whole series), simply reply with
2991@samp{Reviewed-by:@tie{}Your@tie{}Name@tie{}<your-email@@example.com>}
2992to that commit message.
2993@end itemize
2994
2995If you are not a committer, you can help others find a @emph{series} you
2996have reviewed more easily by adding a @code{reviewed-looks-good} usertag
2997for the @code{guix} user.
2998
2999@node Updating the Guix Package
3000@section Updating the Guix Package
3001
3002@cindex update-guix-package, updating the guix package
3003It is sometimes desirable to update the @code{guix} package itself (the
3004package defined in @code{(gnu packages package-management)}), for
3005example to make new daemon features available for use by the
3006@code{guix-service-type} service type. In order to simplify this task,
3007the following command can be used:
3008
3009@example
3010make update-guix-package
3011@end example
3012
3013The @code{update-guix-package} make target will use the last known
3014@emph{commit} corresponding to @code{HEAD} in your Guix checkout,
3015compute the hash of the Guix sources corresponding to that commit and
3016update the @code{commit}, @code{revision} and hash of the @code{guix}
3017package definition.
3018
3019To validate that the updated @code{guix} package hashes are correct and
3020that it can be built successfully, the following command can be run from
3021the directory of your Guix checkout:
3022
3023@example
3024./pre-inst-env guix build guix
3025@end example
3026
3027To guard against accidentally updating the @code{guix} package to a
3028commit that others can't refer to, a check is made that the commit used
3029has already been pushed to the Codeberg-hosted Guix Git repository.
3030
3031This check can be disabled, @emph{at your own peril}, by setting the
3032@code{GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT} environment variable. When
3033this variable is set, the updated package source is also added to the
3034store. This is used as part of the release process of Guix.
3035
3036@node Deprecation Policy
3037@section Deprecation Policy
3038
3039@cindex deprecation policy
3040As any lively project with a broad scope, Guix changes all the time and
3041at all levels. Because it's user-extensible and programmable,
3042incompatible changes can directly impact users and make their life
3043harder. It is thus important to reduce user-visible incompatible
3044changes to a minimum and, when such changes are deemed necessary, to
3045clearly communicate them through a @dfn{deprecation period} so everyone
3046can adapt with minimum hassle. This section defines the project's
3047commitments for smooth deprecation and describes procedures and
3048mechanisms to honor them.
3049
3050There are several ways to use Guix; how to handle deprecation will
3051depend on each use case. Those can be roughly categorized like this:
3052
3053@itemize
3054@item
3055package management exclusively through the command line;
3056
3057@item
3058advanced package management using the manifest and package interfaces;
3059
3060@item
3061Home and System management, using the @code{operating-system} and/or
3062@code{home-environment} interfaces together with the service interfaces;
3063
3064@item
3065development or use of external tools that use programming interfaces
3066such as the @code{(guix ...)} modules.
3067@end itemize
3068
3069These use cases form a spectrum with varying degrees of coupling---from
3070``distant'' to tightly coupled. Based on this insight, we define the
3071following @dfn{deprecation policies} that we consider suitable for each
3072of these levels.
3073
3074@table @asis
3075@item Command-line tools
3076Guix sub-commands should be thought of as remaining available
3077``forever''. Once a Guix sub-command is to be removed, it should be
3078deprecated first, and then remain available for @b{at least one year}
3079after the first release that deprecated it.
3080
3081Deprecation should first be announced in the manual and as an entry in
3082@file{etc/news.scm}; additional communication such as a blog post
3083explaining the rationale is welcome. Months before the scheduled
3084removal date, the command should print a warning explaining how to
3085migrate. An example of this is the replacement of @command{guix
3086environment} by @command{guix shell}, started in October
30872021@footnote{For more details on the @command{guix shell} transition,
3088see
3089@uref{https://guix.gnu.org/en/blog/2021/from-guix-environment-to-guix-shell/}.}.
3090
3091Because of the broad impact of such a change, we recommend conducting a
3092user survey before enacting a plan.
3093
3094@cindex package deprecation
3095@item Package name changes
3096When a package name changes, it must remain available under its old name
3097for @b{at least six months}; the deprecation date should be stated in
3098a comment in the code to ease the final removal.
3099
3100For example, @code{go-ipfs} was renamed to
3101@code{kubo} following a decision made upstream; to communicate the name
3102change to users, the package module provided this definition:
3103
3104@findex deprecated-package
3105@findex define-deprecated-package
3106@lisp
3107(define-deprecated-package go-ipfs
3108 kubo)
3109@end lisp
3110
3111That way, someone running @command{guix install go-ipfs} or similar sees
3112a deprecation warning mentioning the new package name; likewise, someone
3113referring to the @code{go-ipfs} @emph{variable} from their manifest or
3114package definition will see a warning.
3115
3116Under the hood, @code{define-deprecated-package} combines
3117@code{define-deprecated/public-alias} to mark the variable as deprecated
3118(see below), and the @code{deprecated-package} procedure to mark the
3119package name as deprecated.
3120
3121@cindex package removal policy
3122@anchor{package-removal-policy}
3123@item Package removal
3124
3125How packages may be removed depends on their build status and on their
3126position in the package graph.
3127@itemize
3128@item Removal of packages that do not build
3129
3130A package that does not build becomes a removal candidate immediately.
3131A pull request removing such a package should be filed on Codeberg
3132with the @samp{deprecation} label. Additional justification for the
3133(non-)importance, obsolescence etc. of the package is welcome, but not
3134required.
3135Such a pull request may be merged @b{at least three weeks} later if there
3136is no opposition to the removal or if nobody has volunteered to repair the
3137affected packages.
3138
3139@item Removal of building packages
3140
3141There are various reasons why packages may become removal candidates
3142although they still build: For instance we may have a newer version of
3143the same package in Guix, maintenance has stopped upstream, or the package
3144is not adequately maintained in Guix.
3145
3146@table @asis
3147@item Removal candidates that are building leaf packages
3148Leaf packages may be removed following the above process, assuming that
3149there is no opposition to the removal or that consensus for the removal
3150has been reached.
3151Leaf packages that are typically installed into user profiles (for
3152instance applications, but also packages used in a service) should
3153not be removed unless there are particularly good reasons, such as
3154security implications.
3155
3156@item Removal candidates that are building packages with dependents
3157Removing building packages on which other packages depend causes more
3158disruption than removing leaf packages, since at the same time all
3159dependent packages need to be removed. This may still be desirable for
3160overarching reasons. For instance, we want to remove older versions of
3161packages for which newer versions are already packaged, remove packages
3162that are unmaintained or have reached end of life upstream, or that suffer
3163from security vulnerabilities.
3164
3165In this case, the removal candidate may be removed together with all
3166packages depending on it following the above procedure. If the removal
3167candidate falls into the realm of a team, this team must be notified,
3168and consensus shall be sought about the removal in particular with this
3169team. Reasonable efforts shall be made beforehand to update or otherwise
3170preserve dependent packages.
3171
3172@end table
3173@end itemize
3174
3175@quotation Note
3176Learn about pending package removals by checking
3177@uref{https://codeberg.org/guix/guix/pulls?labels=445131,
3178pull requests with the @samp{deprecation} label}.
3179@end quotation
3180
3181@item Moving packages between modules
3182
3183When a package is moved from one module to another one, the corresponding
3184variable @var{name} should be marked as deprecated in the old location
3185for @b{at least six months}, for instance by adding
3186@findex define-deprecated/public-alias
3187@lisp
3188(define-deprecated/public-alias @var{name}
3189 (@@ (gnu packages @var{new-module}) @var{name}))
3190@end lisp
3191in @var{gnu/packages/old-module.scm}.
3192
3193@item Package additions
3194
3195Packages submitted for inclusion must not fulfill the criteria to become
3196a removal candidate immediately after addition.
3197
3198
3199@cindex service deprecation
3200@item Services
3201Changes to services for Guix Home and Guix System have a direct impact
3202on user configuration. For a user, adjusting to interface changes is
3203rarely rewarding, which is why any such change must be clearly
3204communicated in advance through deprecation warnings and documentation.
3205
3206Renaming of variables related to service, home, or system configuration
3207must be communicated for at least six months before removal using the
3208@code{(guix deprecation)} mechanisms. For example, renaming of
3209@code{murmur-configuration} to @code{mumble-server-configuration} was
3210communicated through a series of definitions like this one:
3211
3212@findex define-deprecated/public-alias
3213@lisp
3214(define-deprecated/public-alias
3215 murmur-configuration
3216 mumble-server-configuration)
3217@end lisp
3218
3219Procedures slated for removal may be defined like this:
3220
3221@findex define-deprecated
3222@lisp
3223(define-deprecated (elogind-service #:key (config (elogind-configuration)))
3224 elogind-service-type
3225 (service elogind-service-type config))
3226@end lisp
3227
3228Record fields, notably fields of service configuration records, must
3229follow a similar deprecation period. This is usually achieved through
3230@i{ad hoc} means though. For example, the @code{hosts-file} field of
3231@code{operating-system} was deprecated by adding a @code{sanitized}
3232property that would emit a warning:
3233
3234@lisp
3235(define-record-type* <operating-system>
3236 ;; @dots{}
3237 (hosts-file %operating-system-hosts-file ;deprecated
3238 (default #f)
3239 (sanitize warn-hosts-file-field-deprecation)))
3240
3241(define-deprecated (operating-system-hosts-file os)
3242 hosts-service-type
3243 (%operating-system-hosts-file os))
3244@end lisp
3245
3246When deprecating interfaces in @code{operating-system},
3247@code{home-environment}, @code{(gnu services)}, or any popular service,
3248the deprecation must come with an entry in @code{etc/news.scm}.
3249
3250@cindex deprecation of programming interfaces
3251@item Core interfaces
3252Core programming interfaces, in particular the @code{(guix ...)}
3253modules, may be relied on by a variety of external tools and channels.
3254Any incompatible change must be formally deprecated with
3255@code{define-deprecated}, as shown above, for @b{at least one year}
3256before removal. The manual must clearly document the new interface and,
3257except in obvious cases, explain how to migrate from the old one.
3258
3259As an example, the @code{build-expression->derivation} procedure was
3260superseded by @code{gexp->derivation} and remained available as a
3261deprecated symbol:
3262
3263@lisp
3264(define-deprecated (build-expression->derivation store name exp
3265 #:key @dots{})
3266 gexp->derivation
3267 @dots{})
3268@end lisp
3269
3270Sometimes bindings are moved from one module to another. In those
3271cases, bindings must be reexported from the original module for at least
3272one year.
3273@end table
3274
3275This section does not cover all possible situations but hopefully allows
3276users to know what to expect and developers to stick to its spirit.
3277Please email @email{guix-devel@@gnu.org} for any questions.
3278
3279@cindex documentation
3280@node Writing Documentation
3281@section Writing Documentation
3282
3283Guix is documented using the Texinfo system. If you are not yet
3284familiar with it, we accept contributions for documentation in most
3285formats. That includes plain text, Markdown, Org, etc.
3286
3287Documentation contributions can be sent to
3288@email{guix-patches@@gnu.org}. Prepend @samp{[DOCUMENTATION]} to the
3289subject.
3290
3291When you need to make more than a simple addition to the documentation,
3292we prefer that you send a proper patch as opposed to sending an email
3293as described above. @xref{Submitting Patches} for more information on
3294how to send your patches.
3295
3296To modify the documentation, you need to edit @file{doc/guix.texi} and
3297@file{doc/contributing.texi} (which contains this documentation
3298section), or @file{doc/guix-cookbook.texi} for the cookbook. If
3299you compiled the Guix repository before, you will have
3300many more @file{.texi} files that are translations of these
3301documents. Do not modify them, the translation is managed through
3302@uref{https://translate.codeberg.org/projects/guix, Weblate}.
3303@xref{Translating Guix} for more information.
3304
3305To render documentation, you must first make sure that you ran
3306@command{./configure} in your source tree (@pxref{Running Guix Before
3307It Is Installed}). After that you can run one of the following
3308commands:
3309
3310@itemize
3311@item @samp{make doc/guix.info} to compile the Info manual.
3312 You can check it with @command{info doc/guix.info}.
3313@item @samp{make doc/guix.html} to compile the HTML version.
3314 You can point your browser to the relevant file in the
3315 @file{doc/guix.html} directory.
3316@item @samp{make doc/guix-cookbook.info} for the cookbook Info manual.
3317@item @samp{make doc/guix-cookbook.html} for the cookbook HTML version.
3318@end itemize
3319
3320@cindex translation
3321@cindex l10n
3322@cindex i18n
3323@cindex native language support
3324@node Translating Guix
3325@section Translating Guix
3326
3327Writing code and packages is not the only way to provide a meaningful
3328contribution to Guix. Translating to a language you speak is another
3329example of a valuable contribution you can make. This section is designed
3330to describe the translation process. It gives you advice on how you can
3331get involved, what can be translated, what mistakes you should avoid and
3332what we can do to help you!
3333
3334Guix is a big project that has multiple components that can be translated.
3335We coordinate the translation effort on a
3336@uref{https://translate.codeberg.org/projects/guix/,Weblate instance}
3337hosted by Codeberg. You will need an account to submit translations.
3338
3339Some of the software packaged in Guix also contain translations. We do not
3340host a translation platform for them. If you want to translate a package
3341provided by Guix, you should contact their developers or find the information
3342on their website. As an example, you can find the homepage of the
3343@code{hello} package by typing @command{guix show hello}. On the ``homepage''
3344line, you will see @url{https://www.gnu.org/software/hello/} as the homepage.
3345
3346Many GNU and non-GNU packages can be translated on the
3347@uref{https://translationproject.org,Translation Project}. Some projects
3348with multiple components have their own platform. For instance, GNOME has
3349its own platform, @uref{https://l10n.gnome.org/,Damned Lies}.
3350
3351Guix has five components hosted on Weblate.
3352
3353@itemize
3354@item @code{guix} contains all the strings from the Guix software (the
3355 guided system installer, the package manager, etc), excluding packages.
3356@item @code{packages} contains the synopsis (single-sentence description
3357 of a package) and description (longer description) of packages in Guix.
3358@item @code{website} contains the official Guix website, except for
3359 blog posts and multimedia content.
3360@item @code{documentation-manual} corresponds to this manual.
3361@item @code{documentation-cookbook} is the component for the cookbook.
3362@end itemize
3363
3364@subsubheading General Directions
3365
3366Once you get an account, you should be able to select a component from
3367@uref{https://translate.codeberg.org/projects/guix/,the guix project},
3368and select a language. If your language does not appear in the list, go
3369to the bottom and click on the ``Start new translation'' button. Select
3370the language you want to translate to from the list, to start your new
3371translation.
3372
3373Like lots of other free software packages, Guix uses
3374@uref{https://www.gnu.org/software/gettext,GNU Gettext} for its translations,
3375with which translatable strings are extracted from the source code to so-called
3376PO files.
3377
3378Even though PO files are text files, changes should not be made with a text
3379editor but with PO editing software. Weblate integrates PO editing
3380functionality. Alternatively, translators can use any of various
3381free-software tools for filling in translations, of which
3382@uref{https://poedit.net/,Poedit} is one example, and (after logging in)
3383@uref{https://docs.weblate.org/en/latest/user/files.html,upload} the changed
3384file. There is also a special
3385@uref{https://www.emacswiki.org/emacs/PoMode,PO editing mode} for users of GNU
3386Emacs. Over time translators find out what software they are happy with and
3387what features they need.
3388
3389On Weblate, you will find various links to the editor, that will show various
3390subsets (or all) of the strings. Have a look around and at the
3391@uref{https://docs.weblate.org/en/latest/,documentation} to familiarize
3392yourself with the platform.
3393
3394@subsubheading Translation Components
3395
3396In this section, we provide more detailed guidance on the translation
3397process, as well as details on what you should or should not do. When in
3398doubt, please contact us, we will be happy to help!
3399
3400@table @asis
3401@item guix
3402Guix is written in the Guile programming language, and some strings contain
3403special formatting that is interpreted by Guile. These special formatting
3404should be highlighted by Weblate. They start with @code{~} followed by one
3405or more characters.
3406
3407When printing the string, Guile replaces the special formatting symbols with
3408actual values. For instance, the string @samp{ambiguous package specification
3409`~a'} would be substituted to contain said package specification instead of
3410@code{~a}. To properly translate this string, you must keep the formatting
3411code in your translation, although you can place it where it makes sense in
3412your language. For instance, the French translation says @samp{spécification
3413du paquet « ~a » ambiguë} because the adjective needs to be placed in the
3414end of the sentence.
3415
3416If there are multiple formatting symbols, make sure to respect the order.
3417Guile does not know in which order you intended the string to be read, so it
3418will substitute the symbols in the same order as the English sentence.
3419
3420As an example, you cannot translate @samp{package '~a' has been superseded by
3421'~a'} by @samp{'~a' supersedes package '~a'}, because the meaning would be
3422reversed. If @var{foo} is superseded by @var{bar}, the translation would read
3423@samp{'foo' supersedes package 'bar'}. To work around this problem, it
3424is possible to use more advanced formatting to select a given piece of data,
3425instead of following the default English order. @xref{Formatted Output,,,
3426guile, GNU Guile Reference Manual}, for more information on formatting in Guile.
3427
3428@item packages
3429
3430Package descriptions occasionally contain Texinfo markup (@pxref{Synopses
3431and Descriptions}). Texinfo markup looks like @samp{@@code@{rm -rf@}},
3432@samp{@@emph@{important@}}, etc. When translating, please leave markup as is.
3433
3434The characters after ``@@'' form the name of the markup, and the text between
3435``@{'' and ``@}'' is its content. In general, you should not translate the
3436content of markup like @code{@@code}, as it contains literal code that do not
3437change with language. You can translate the content of formatting markup such
3438as @code{@@emph}, @code{@@i}, @code{@@itemize}, @code{@@item}. However, do
3439not translate the name of the markup, or it will not be recognized. Do
3440not translate the word after @code{@@end}, it is the name of the markup that
3441is closed at this position (e.g.@: @code{@@itemize ... @@end itemize}).
3442
3443@item documentation-manual and documentation-cookbook
3444
3445The first step to ensure a successful translation of the manual is to find
3446and translate the following strings @emph{first}:
3447
3448@itemize
3449@item @code{version.texi}: Translate this string as @code{version-xx.texi},
3450 where @code{xx} is your language code (the one shown in the URL on
3451 weblate).
3452@item @code{contributing.texi}: Translate this string as
3453 @code{contributing.xx.texi}, where @code{xx} is the same language code.
3454@item @code{Top}: Do not translate this string, it is important for Texinfo.
3455 If you translate it, the document will be empty (missing a Top node).
3456 Please look for it, and register @code{Top} as its translation.
3457@end itemize
3458
3459Translating these strings first ensure we can include your translation in
3460the guix repository without breaking the make process or the
3461@command{guix pull} machinery.
3462
3463The manual and the cookbook both use Texinfo. As for @code{packages}, please
3464keep Texinfo markup as is. There are more possible markup types in the manual
3465than in the package descriptions. In general, do not translate the content
3466of @code{@@code}, @code{@@file}, @code{@@var}, @code{@@value}, etc. You
3467should translate the content of formatting markup such as @code{@@emph},
3468@code{@@i}, etc.
3469
3470The manual contains sections that can be referred to by name by @code{@@ref},
3471@code{@@xref} and @code{@@pxref}. We have a mechanism in place so you do
3472not have to translate their content. If you keep the English title, we will
3473automatically replace it with your translation of that title. This ensures
3474that Texinfo will always be able to find the node. If you decide to change
3475the translation of the title, the references will automatically be updated
3476and you will not have to update them all yourself.
3477
3478When translating references from the cookbook to the manual, you need to
3479replace the name of the manual and the name of the section. For instance,
3480to translate @code{@@pxref@{Defining Packages,,, guix, GNU Guix Reference
3481Manual@}}, you would replace @code{Defining Packages} with the title of that
3482section in the translated manual @emph{only} if that title is translated.
3483If the title is not translated in your language yet, do not translate it here,
3484or the link will be broken. Replace @code{guix} with @code{guix.xx} where
3485@code{xx} is your language code. @code{GNU Guix Reference Manual} is the
3486text of the link. You can translate it however you wish.
3487
3488@item website
3489
3490The website pages are written using SXML, an s-expression version of HTML,
3491the basic language of the web. We have a process to extract translatable
3492strings from the source, and replace complex s-expressions with a more familiar
3493XML markup, where each markup is numbered. Translators can arbitrarily change
3494the ordering, as in the following example.
3495
3496@example
3497#. TRANSLATORS: Defining Packages is a section name
3498#. in the English (en) manual.
3499#: apps/base/templates/about.scm:64
3500msgid "Packages are <1>defined<1.1>en</1.1><1.2>Defining-Packages.html</1.2></1> as native <2>Guile</2> modules."
3501msgstr "Pakete werden als reine <2>Guile</2>-Module <1>definiert<1.1>de</1.1><1.2>Pakete-definieren.html</1.2></1>."
3502@end example
3503
3504Note that you need to include the same markups. You cannot skip any.
3505@end table
3506
3507In case you make a mistake, the component might fail to build properly with your
3508language, or even make guix pull fail. To prevent that, we have a process
3509in place to check the content of the files before pushing to our repository.
3510We will not be able to update the translation for your language in Guix, so
3511we will notify you (through weblate and/or by email) so you get a chance to
3512fix the issue.
3513
3514@subsubheading Outside of Weblate
3515
3516Currently, some parts of Guix cannot be translated on Weblate, help wanted!
3517
3518@itemize
3519@item @command{guix pull} news can be translated in @file{news.scm}, but is not
3520 available from Weblate. If you want to provide a translation, you
3521 can prepare a patch as described above, or simply send us your
3522 translation with the name of the news entry you translated and your
3523 language. @xref{Writing Channel News}, for more information about
3524 channel news.
3525@item Guix blog posts cannot currently be translated.
3526@item The installer script (for foreign distributions) is entirely in English.
3527@item Some of the libraries Guix uses cannot be translated or are translated
3528 outside of the Guix project. Guile itself is not internationalized.
3529@item Other manuals linked from this manual or the cookbook might not be
3530 translated.
3531@end itemize
3532
3533@subsubheading Conditions for Inclusion
3534
3535There are no conditions for adding new translations of the @code{guix} and
3536@code{guix-packages} components, other than they need at least one translated
3537string. New languages will be added to Guix as soon as possible. The
3538files may be removed if they fall out of sync and have no more translated
3539strings.
3540
3541Given that the web site is dedicated to new users, we want its translation
3542to be as complete as possible before we include it in the language menu.
3543For a new language to be included, it needs to reach at least 80% completion.
3544When a language is included, it may be removed in the future if it stays
3545out of sync and falls below 60% completion.
3546
3547The manual and cookbook are automatically added in the default compilation
3548target. Every time we synchronize translations, developers need to
3549recompile all the translated manuals and cookbooks. This is useless for what
3550is essentially the English manual or cookbook. Therefore, we will only
3551include a new language when it reaches 10% completion in the component.
3552When a language is included, it may be removed in the future if it stays
3553out of sync and falls below 5% completion.
3554
3555@subsubheading Translation Infrastructure
3556
3557Weblate is backed by a git repository from which it discovers new strings to
3558translate and pushes new and updated translations. Normally, it would be
3559enough to give it commit access to our repositories. However, we decided
3560to use a separate repository for two reasons. First, we would have to give
3561Weblate commit access and authorize its signing key, but we do not trust it
3562in the same way we trust guix developers, especially since we do not manage
3563the instance ourselves. Second, if translators mess something up, it can
3564break the generation of the website and/or guix pull for all our users,
3565independently of their language.
3566
3567For these reasons, we use a dedicated repository to host translations, and we
3568synchronize it with our guix and artworks repositories after checking no issue
3569was introduced in the translation.
3570
3571Developers can download the latest PO files from weblate in the Guix
3572repository by running the @command{make download-po} command. It will
3573automatically download the latest files from weblate, reformat them to a
3574canonical form, and check they do not contain issues. The manual needs to be
3575built again to check for additional issues that might crash Texinfo.
3576
3577Before pushing new translation files, developers should add them to the
3578make machinery so the translations are actually available. The process
3579differs for the various components.
3580
3581@itemize
3582@item New po files for the @code{guix} and @code{packages} components must
3583 be registered by adding the new language to @file{po/guix/LINGUAS} or
3584 @file{po/packages/LINGUAS}.
3585@item New po files for the @code{documentation-manual} component must be
3586 registered by adding the file name to @code{DOC_PO_FILES} in
3587 @file{po/doc/local.mk}, the generated @file{%D%/guix.xx.texi} manual to
3588 @code{info_TEXINFOS} in @file{doc/local.mk} and the generated
3589 @file{%D%/guix.xx.texi} and @file{%D%/contributing.xx.texi} to
3590 @code{TRANSLATED_INFO} also in @file{doc/local.mk}.
3591@item New po files for the @code{documentation-cookbook} component must be
3592 registered by adding the file name to @code{DOC_COOKBOOK_PO_FILES} in
3593 @file{po/doc/local.mk}, the generated @file{%D%/guix-cookbook.xx.texi}
3594 manual to @code{info_TEXINFOS} in @file{doc/local.mk} and the generated
3595 @file{%D%/guix-cookbook.xx.texi} to @code{TRANSLATED_INFO} also
3596 in @file{doc/local.mk}.
3597@item New po files for the @code{website} component must be added to the
3598 @code{guix-artwork} repository, in @file{website/po/}.
3599 @file{website/po/LINGUAS} and @file{website/po/ietf-tags.scm} must
3600 be updated accordingly (see @file{website/i18n-howto.txt} for more
3601 information on the process).
3602@end itemize
3603
3604
3605@cindex infrastructure
3606@node Contributing to Guix's Infrastructure
3607@section Contributing to Guix's Infrastructure
3608
3609Since its inception, the Guix project has always valued its autonomy, and that
3610reflects in its infrastructure: our servers run Guix System and exclusively
3611free software, and are administered by volunteers.
3612
3613Of course this comes at a cost and this is why we need contributions. Our hope
3614is to make infrastructure-related activity more legible so that maybe you can
3615picture yourself helping in one of these areas.
3616
3617
3618@menu
3619* Coding::
3620* System Administration::
3621* Day-to-Day System Administration::
3622* On-Site Intervention::
3623* Hosting::
3624* Administrative Tasks::
3625@end menu
3626
3627@node Coding
3628@subsection Coding
3629
3630The project runs many Guix-specific services; this is all lovely Scheme code
3631but it tends to receive less attention than Guix itself:
3632
3633@itemize
3634@item
3635@url{https://git.cbaines.net/guix/bffe, Build Farm Front End}
3636@item
3637@url{https://codeberg.org/guix/cuirass/, Cuirass}
3638@item
3639@url{https://codeberg.org/guix/maintenance/src/branch/master/hydra/goggles.scm,
3640Goggles} (IRC logger)
3641@item
3642@url{https://codeberg.org/guix/build-coordinator, Guix Build Coordinator}
3643@item
3644@url{https://codeberg.org/guix/data-service, Guix Data Service}
3645@item
3646@url{https://codeberg.org/luis-felipe/guix-packages-website,
3647Guix Packages Website}
3648@item
3649@url{https://codeberg.org/guix/mumi, mumi}
3650@item
3651@url{https://codeberg.org/guix/nar-herder, Nar Herder}
3652@item
3653@url{https://codeberg.org/guix/qa-frontpage, QA Frontpage}
3654@end itemize
3655
3656There is no time constraint on this coding activity: any improvement is
3657welcome, whenever it comes. Most of these code bases are relatively small,
3658which should make it easier to get started.
3659
3660Prerequisites: Familiarity with Guile, HTTP, and databases.
3661
3662If you wish to get started, check out the README of the project of your choice
3663and get in touch with guix-devel and the primary developer(s) of the tool as
3664per @code{git shortlog -s | sort -k1 -n}.
3665
3666@node System Administration
3667@subsection System Administration
3668
3669Guix System configuration for all our systems is held in this repository:
3670
3671@url{https://codeberg.org/guix/maintenance.git/src/branch/master/hydra/}
3672
3673The two front-ends are @file{berlin.scm} (the machine behind ci.guix.gnu.org)
3674and @file{bayfront.scm} (the machine behind bordeaux.guix.gnu.org,
3675guix.gnu.org, hpc.guix.info, qa.guix.gnu.org, and more). Both connect to a
3676number of build machines and helpers.
3677
3678Without even having SSH access to the machine, you can help by posting patches
3679to improve the configuration (you can test it with @code{guix system vm}).
3680Here are ways you can help:
3681
3682@itemize
3683@item
3684Improve infra monitoring: set up a dashboard to monitor all the infrastructure,
3685and an out-of-band channel to communicate about downtime.
3686
3687@item
3688Implement web site redundancy: guix.gnu.org should be backed by several
3689machines on different sites. Get in touch with us and/or send a patch!
3690
3691@item
3692Implement substitute redundancy: likewise, bordeaux.guix.gnu.org and
3693ci.guix.gnu.org should be backed by several head nodes.
3694
3695@item
3696Improve backup: there's currently ad-hoc backup of selected pieces over rsync
3697between the two head nodes; we can improve on that, for example with a
3698dedicated backup site and proper testing of recoverability.
3699
3700@item
3701Support mirroring: We'd like to make it easy for others to mirror substitutes
3702from ci.guix and bordeaux.guix, perhaps by offering public rsync access.
3703
3704@item
3705Optimize our web services: Monitor the performance of our services and tweak
3706nginx config or whatever it takes to improve it.
3707
3708There is no time constraint on this activity: any improvement is welcome,
3709whenever you can work on it.
3710
3711Prerequisite: Familiarity with Guix System administration and ideally with the
3712infrastructure handbook:
3713
3714@url{https://codeberg.org/guix/maintenance.git/src/branch/master/doc/infra-handbook.org,
3715Infra-Handbook}
3716
3717@end itemize
3718
3719@node Day-to-Day System Administration
3720@subsection Day-to-Day System Administration
3721
3722We're also looking for people who'd be willing to have SSH access to some of
3723the infrastructure to help with day-to-day maintenance: restarting a build,
3724restarting the occasional service that has gone wild (that can happen),
3725reconfiguring/upgrading a machine, rebooting, etc.
3726
3727This day-to-day activity requires you to be available some of the time (during
3728office hours or not, during the week-end or not), whenever is convenient for
3729you, so you can react to issues reported on IRC, on the mailing list, or
3730elsewhere, and synchronize with other sysadmins.
3731
3732Prerequisite: Being a ``known'' member of the community, familiarity with Guix
3733System administration, with some of the services/web sites being run, and with
3734the infrastructure handbook:
3735
3736@url{https://codeberg.org/guix/maintenance.git/src/branch/master/doc/infra-handbook.org,
3737Infra-Handbook}
3738
3739@node On-Site Intervention
3740@subsection On-Site Intervention
3741
3742The first front-end is currently generously hosted by the Max Delbrück Center
3743(MDC), a research institute in Berlin, Germany. Only authorized personnel can
3744physically access it.
3745
3746The second one, bordeaux.guix.gnu.org, is hosted in Bordeaux, France, in a
3747professional data center shared with non-profit ISP Aquilenet. If you live in
3748the region of Bordeaux and would like to help out when we need to go on-site,
3749please make yourself known by emailing @email{guix-sysadmin@@gnu.org}.
3750
3751On-site interventions are rare, but they're usually in response to an
3752emergency.
3753
3754@node Hosting
3755@subsection Hosting
3756
3757We're looking for people who can host machines and help out whenever
3758physical access is needed. More specifically:
3759
3760@itemize
3761@item
3762We need hosting of ``small'' machines such as single-board computers (AArch64,
3763RISC-V) for use as build machines.
3764
3765@item
3766We need hosting for front-ends and x86_64 build machines in a data center where
3767they can be racked and where, ideally, several local Guix sysadmins can
3768physically access them.
3769@end itemize
3770
3771The machines should be accessible over Wireguard VPN most of the
3772time, so longer power or network interruptions should be the
3773exception.
3774
3775Prerequisites: Familiarity with installing and remotely administering Guix
3776System.
3777
3778@node Administrative Tasks
3779@subsection Administrative Tasks
3780
3781The infra remains up and running thanks to crucial administrative tasks, which
3782includes:
3783
3784@itemize
3785@item
3786Selecting and purchasing hardware, for example build machines.
3787@item
3788Renewing domain names.
3789
3790@item
3791Securing funding, in particular via the Guix Foundation:
3792@url{https://foundation.guix.info, Guix Foundation}
3793@end itemize
3794
3795Prerequisites: Familiarity with hardware, and/or DNS registrars,
3796and/or sponsorship, and/or crowdfunding.