gnu: protobuf: Unbundle googletest.
[jackhill/guix/guix.git] / doc / contributing.texi
CommitLineData
8c01b9d0
ML
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
c0087d33 6@code{#guix} on the Libera Chat IRC network. We welcome ideas, bug
8c01b9d0
ML
7reports, patches, and anything that may be helpful to the project. We
8particularly welcome help on packaging (@pxref{Packaging Guidelines}).
9
e15fcdd1
LC
10@cindex code of conduct, of contributors
11@cindex contributor covenant
dcb7119a
AS
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
478af028 15@url{https://contributor-covenant.org/}. You can find a local version in
dcb7119a 16the @file{CODE-OF-CONDUCT} file in the source tree.
e15fcdd1 17
dfcdd9c2
LC
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
8c01b9d0
ML
22@menu
23* Building from Git:: The latest and greatest.
24* Running Guix Before It Is Installed:: Hacker tricks.
25* The Perfect Setup:: The right tools.
afe7408e 26* Packaging Guidelines:: Growing the distribution.
8c01b9d0
ML
27* Coding Style:: Hygiene of the contributor.
28* Submitting Patches:: Share your work.
3c86372e 29* Tracking Bugs and Patches:: Keeping it all organized.
2d315cd4 30* Commit Access:: Pushing to the official repository.
5800d2aa 31* Updating the Guix Package:: Updating the Guix package definition.
e103d614 32* Writing Documentation:: Improving documentation in GNU Guix.
1897a6ef 33* Translating Guix:: Make Guix speak your native language.
8c01b9d0
ML
34@end menu
35
36@node Building from Git
37@section Building from Git
38
39If you want to hack Guix itself, it is recommended to use the latest
dbfcadfc
LC
40version from the Git repository:
41
42@example
43git clone https://git.savannah.gnu.org/git/guix.git
44@end example
45
b3011dbb
LC
46@cindex authentication, of a Guix checkout
47How do you ensure that you obtained a genuine copy of the repository?
3e9c6ee1 48To do that, run @command{guix git authenticate}, passing it the commit
63c799c1
LC
49and OpenPGP fingerprint of the @dfn{channel introduction}
50(@pxref{Invoking guix git authenticate}):
b3011dbb 51
63c799c1
LC
52@c The commit and fingerprint below must match those of the channel
53@c introduction in '%default-channels'.
b3011dbb 54@example
3e9c6ee1 55git fetch origin keyring:keyring
63c799c1
LC
56guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
57 "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
b3011dbb
LC
58@end example
59
60@noindent
63c799c1
LC
61This command completes with exit code zero on success; it prints an
62error message and exits with a non-zero code otherwise.
63
64As you can see, there is a chicken-and-egg problem: you first need to
65have Guix installed. Typically you would install Guix System
66(@pxref{System Installation}) or Guix on top of another distro
67(@pxref{Binary Installation}); in either case, you would verify the
68OpenPGP signature on the installation medium. This ``bootstraps'' the
69trust chain.
b3011dbb 70
5fb95cc5
LC
71The easiest way to set up a development environment for Guix is, of
72course, by using Guix! The following command starts a new shell where
73all the dependencies and appropriate environment variables are set up to
74hack on Guix:
8c01b9d0 75
5fb95cc5 76@example
80edb7df 77guix shell -D guix --pure
5fb95cc5
LC
78@end example
79
80edb7df 80@xref{Invoking guix shell}, for more information on that command.
0636742b
FP
81
82If you are unable to use Guix when building Guix from a checkout, the
83following are the required packages in addition to those mentioned in the
84installation instructions (@pxref{Requirements}).
85
86@itemize
21656ffa
VS
87@item @url{https://gnu.org/software/autoconf/, GNU Autoconf};
88@item @url{https://gnu.org/software/automake/, GNU Automake};
89@item @url{https://gnu.org/software/gettext/, GNU Gettext};
90@item @url{https://gnu.org/software/texinfo/, GNU Texinfo};
91@item @url{https://www.graphviz.org/, Graphviz};
92@item @url{https://www.gnu.org/software/help2man/, GNU Help2man (optional)}.
0636742b
FP
93@end itemize
94
95On Guix, extra dependencies can be added by instead running @command{guix
80edb7df 96shell}:
5fb95cc5
LC
97
98@example
80edb7df 99guix shell -D guix help2man git strace --pure
5fb95cc5
LC
100@end example
101
8d472e93
LC
102From there you can generate the build system infrastructure
103using Autoconf and Automake:
104
105@example
106./bootstrap
107@end example
108
109If you get an error like this one:
8c01b9d0
ML
110
111@example
112configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
113@end example
114
5fb95cc5 115@noindent
8c01b9d0 116it probably means that Autoconf couldn’t find @file{pkg.m4}, which is
5fb95cc5
LC
117provided by pkg-config. Make sure that @file{pkg.m4} is available. The
118same holds for the @file{guile.m4} set of macros provided by Guile. For
119instance, if you installed Automake in @file{/usr/local}, it wouldn’t
120look for @file{.m4} files in @file{/usr/share}. In that case, you have
121to invoke the following command:
8c01b9d0
ML
122
123@example
124export ACLOCAL_PATH=/usr/share/aclocal
125@end example
126
aabe6d38 127@xref{Macro Search Path,,, automake, The GNU Automake Manual}, for
8c01b9d0
ML
128more information.
129
8d472e93
LC
130Then, run:
131
132@example
133./configure --localstatedir=/var
134@end example
135
136@noindent
137... where @file{/var} is the normal @code{localstatedir} value
138(@pxref{The Store}, for information about this). Note that you will
139probably not run @command{make install} at the end (you don't have to)
140but it's still important to pass the right @code{localstatedir}.
141
142Finally, you can build Guix and, if you feel so inclined, run the tests
143(@pxref{Running the Test Suite}):
144
145@example
146make
147make check
148@end example
149
150@noindent
151If anything fails, take a look at installation instructions
152(@pxref{Installation}) or send a message to the
153@email{guix-devel@@gnu.org, mailing list}.
8c01b9d0 154
33391ee5
LC
155From there on, you can authenticate all the commits included in your
156checkout by running:
157
158@example
159make authenticate
160@end example
161
162The first run takes a couple of minutes, but subsequent runs are faster.
163
ef6596a2
MÁAV
164Or, when your configuration for your local Git repository doesn't match
165the default one, you can provide the reference for the @code{keyring}
166branch through the variable @code{GUIX_GIT_KEYRING}. The following
167example assumes that you have a Git remote called @samp{myremote}
168pointing to the official repository:
169
170@example
171make authenticate GUIX_GIT_KEYRING=myremote/keyring
172@end example
173
33391ee5
LC
174@quotation Note
175You are advised to run @command{make authenticate} after every
176@command{git pull} invocation. This ensures you keep receiving valid
177changes to the repository.
178@end quotation
179
087ad097
GT
180After updating the repository, @command{make} might fail with an error
181similar to the following example:
182
183@example
184error: failed to load 'gnu/packages/dunst.scm':
185ice-9/eval.scm:293:34: In procedure abi-check: #<record-type <origin>>: record ABI mismatch; recompilation needed
186@end example
187
188This means that one of the record types that Guix defines (in this
189example, the @code{origin} record) has changed, and all of guix needs
190to be recompiled to take that change into account. To do so, run
191@command{make clean-go} followed by @command{make}.
8c01b9d0
ML
192
193@node Running Guix Before It Is Installed
194@section Running Guix Before It Is Installed
195
196In order to keep a sane working environment, you will find it useful to
197test the changes made in your local source tree checkout without
198actually installing them. So that you can distinguish between your
199``end-user'' hat and your ``motley'' costume.
200
201To that end, all the command-line tools can be used even if you have not
ad911c83
RL
202run @code{make install}. To do that, you first need to have an
203environment with all the dependencies available (@pxref{Building from
204Git}), and then simply prefix each command with @command{./pre-inst-env}
205(the @file{pre-inst-env} script lives in the top build tree of Guix; it
206is generated by running @command{./bootstrap} followed by
207@command{./configure}). As an example, here is how you would build the
208@code{hello} package as defined in your working tree (this assumes
209@command{guix-daemon} is already running on your system; it's OK if it's
210a different version):
8c01b9d0
ML
211
212@example
8c01b9d0
ML
213$ ./pre-inst-env guix build hello
214@end example
215
216@noindent
0636742b 217Similarly, an example for a Guile session using the Guix modules:
8c01b9d0
ML
218
219@example
220$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
96856613
LC
221
222;;; ("x86_64-linux")
223@end example
224
225@noindent
226@cindex REPL
227@cindex read-eval-print loop
4ce7f1fb 228@dots{} and for a REPL (@pxref{Using Guix Interactively}):
96856613
LC
229
230@example
231$ ./pre-inst-env guile
232scheme@@(guile-user)> ,use(guix)
233scheme@@(guile-user)> ,use(gnu)
234scheme@@(guile-user)> (define snakes
235 (fold-packages
236 (lambda (package lst)
237 (if (string-prefix? "python"
238 (package-name package))
239 (cons package lst)
240 lst))
241 '()))
242scheme@@(guile-user)> (length snakes)
243$1 = 361
8c01b9d0
ML
244@end example
245
9022861d
LC
246If you are hacking on the daemon and its supporting code or if
247@command{guix-daemon} is not already running on your system, you can
248launch it straight from the build tree@footnote{The @option{-E} flag to
249@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set
250such that @command{guix-daemon} and the tools it uses can find the Guile
251modules they need.}:
252
253@example
254$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
255@end example
256
8c01b9d0
ML
257The @command{pre-inst-env} script sets up all the environment variables
258necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}.
259
ef54b61d 260Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
75e24d7b 261local source tree; it simply updates the @file{~/.config/guix/current}
ef54b61d 262symlink (@pxref{Invoking guix pull}). Run @command{git pull} instead if
75e24d7b 263you want to upgrade your local source tree.
ef54b61d 264
2f219318
GT
265Sometimes, especially if you have recently updated your repository,
266running @command{./pre-inst-env} will print a message similar to the
267following example:
268
269@example
270;;; note: source file /home/user/projects/guix/guix/progress.scm
271;;; newer than compiled /home/user/projects/guix/guix/progress.go
272@end example
273
274This is only a note and you can safely ignore it. You can get rid of
275the message by running @command{make -j4}. Until you do, Guile will run
276slightly slower because it will interpret the code instead of using
277prepared Guile object (@file{.go}) files.
278
279You can run @command{make} automatically as you work using
280@command{watchexec} from the @code{watchexec} package. For example,
969e8678
RS
281to build again each time you update a package file, run
282@samp{watchexec -w gnu/packages -- make -j4}.
8c01b9d0
ML
283
284@node The Perfect Setup
285@section The Perfect Setup
286
287The Perfect Setup to hack on Guix is basically the perfect setup used
288for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference
289Manual}). First, you need more than an editor, you need
21656ffa
VS
290@url{https://www.gnu.org/software/emacs, Emacs}, empowered by the
291wonderful @url{https://nongnu.org/geiser/, Geiser}. To set that up, run:
f73ab814
LC
292
293@example
4ce7f1fb 294guix install emacs guile emacs-geiser emacs-geiser-guile
f73ab814 295@end example
8c01b9d0
ML
296
297Geiser allows for interactive and incremental development from within
298Emacs: code compilation and evaluation from within buffers, access to
299on-line documentation (docstrings), context-sensitive completion,
300@kbd{M-.} to jump to an object definition, a REPL to try out your code,
301and more (@pxref{Introduction,,, geiser, Geiser User Manual}). For
302convenient Guix development, make sure to augment Guile’s load path so
303that it finds source files from your checkout:
304
305@lisp
306;; @r{Assuming the Guix checkout is in ~/src/guix.}
bb38ece4
AK
307(with-eval-after-load 'geiser-guile
308 (add-to-list 'geiser-guile-load-path "~/src/guix"))
8c01b9d0
ML
309@end lisp
310
311To actually edit the code, Emacs already has a neat Scheme mode. But in
312addition to that, you must not miss
c2c73f58 313@url{https://www.emacswiki.org/emacs/ParEdit, Paredit}. It provides
8c01b9d0
ML
314facilities to directly operate on the syntax tree, such as raising an
315s-expression or wrapping it, swallowing or rejecting the following
316s-expression, etc.
317
42cdcdff
RW
318@cindex code snippets
319@cindex templates
320@cindex reducing boilerplate
321We also provide templates for common git commit messages and package
322definitions in the @file{etc/snippets} directory. These templates can
c4acaf41
NG
323be used to expand short trigger strings to interactive text snippets. If
324you use @url{https://joaotavora.github.io/yasnippet/, YASnippet}, you
325may want to add the @file{etc/snippets/yas} snippets directory to the
326@var{yas-snippet-dirs} variable. If you use
327@url{https://github.com/minad/tempel/, Tempel}, you may want to add the
328@file{etc/snippets/tempel/*} path to the @var{tempel-path} variable in
42cdcdff
RW
329Emacs.
330
331@lisp
332;; @r{Assuming the Guix checkout is in ~/src/guix.}
c4acaf41 333;; @r{Yasnippet configuration}
42cdcdff 334(with-eval-after-load 'yasnippet
c4acaf41
NG
335 (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
336;; @r{Tempel configuration}
337(with-eval-after-load 'tempel
338 ;; Ensure tempel-path is a list -- it may also be a string.
339 (unless (listp 'tempel-path)
340 (setq tempel-path (list tempel-path)))
341 (add-to-list 'tempel-path "~/src/guix/etc/snippets/tempel/*"))
42cdcdff
RW
342@end lisp
343
344The commit message snippets depend on @url{https://magit.vc/, Magit} to
345display staged files. When editing a commit message type @code{add}
346followed by @kbd{TAB} to insert a commit message template for adding a
347package; type @code{update} followed by @kbd{TAB} to insert a template
9286c295
AI
348for updating a package; type @code{https} followed by @kbd{TAB} to
349insert a template for changing the home page URI of a package to HTTPS.
42cdcdff
RW
350
351The main snippet for @code{scheme-mode} is triggered by typing
352@code{package...} followed by @kbd{TAB}. This snippet also inserts the
353trigger string @code{origin...}, which can be expanded further. The
354@code{origin} snippet in turn may insert other trigger strings ending on
355@code{...}, which also can be expanded further.
356
9a397114
OP
357@cindex insert or update copyright
358@cindex @code{M-x guix-copyright}
359@cindex @code{M-x copyright-update}
4f4fb215 360We additionally provide insertion and automatic update of a copyright in
9a397114
OP
361@file{etc/copyright.el}. You may want to set your full name, mail, and
362load a file.
363
364@lisp
365(setq user-full-name "Alice Doe")
366(setq user-mail-address "alice@@mail.org")
367;; @r{Assuming the Guix checkout is in ~/src/guix.}
368(load-file "~/src/guix/etc/copyright.el")
369@end lisp
370
371To insert a copyright at the current line invoke @code{M-x guix-copyright}.
372
373To update a copyright you need to specify a @code{copyright-names-regexp}.
374
375@lisp
376(setq copyright-names-regexp
377 (format "%s <%s>" user-full-name user-mail-address))
378@end lisp
379
380You can check if your copyright is up to date by evaluating @code{M-x
381copyright-update}. If you want to do it automatically after each buffer
382save then add @code{(add-hook 'after-save-hook 'copyright-update)} in
383Emacs.
8c01b9d0 384
afe7408e
LC
385@node Packaging Guidelines
386@section Packaging Guidelines
387
388@cindex packages, creating
389The GNU distribution is nascent and may well lack some of your favorite
390packages. This section describes how you can help make the distribution
391grow.
392
393Free software packages are usually distributed in the form of
394@dfn{source code tarballs}---typically @file{tar.gz} files that contain
395all the source files. Adding a package to the distribution means
396essentially two things: adding a @dfn{recipe} that describes how to
397build the package, including a list of other packages required to build
398it, and adding @dfn{package metadata} along with that recipe, such as a
399description and licensing information.
400
401In Guix all this information is embodied in @dfn{package definitions}.
402Package definitions provide a high-level view of the package. They are
403written using the syntax of the Scheme programming language; in fact,
404for each package we define a variable bound to the package definition,
405and export that variable from a module (@pxref{Package Modules}).
406However, in-depth Scheme knowledge is @emph{not} a prerequisite for
407creating packages. For more information on package definitions,
408@pxref{Defining Packages}.
409
410Once a package definition is in place, stored in a file in the Guix
411source tree, it can be tested using the @command{guix build} command
412(@pxref{Invoking guix build}). For example, assuming the new package is
413called @code{gnew}, you may run this command from the Guix build tree
414(@pxref{Running Guix Before It Is Installed}):
415
416@example
417./pre-inst-env guix build gnew --keep-failed
418@end example
419
420Using @code{--keep-failed} makes it easier to debug build failures since
421it provides access to the failed build tree. Another useful
422command-line option when debugging is @code{--log-file}, to access the
423build log.
424
425If the package is unknown to the @command{guix} command, it may be that
426the source file contains a syntax error, or lacks a @code{define-public}
427clause to export the package variable. To figure it out, you may load
428the module from Guile to get more information about the actual error:
429
430@example
431./pre-inst-env guile -c '(use-modules (gnu packages gnew))'
432@end example
433
434Once your package builds correctly, please send us a patch
435(@pxref{Submitting Patches}). Well, if you need help, we will be happy to
436help you too. Once the patch is committed in the Guix repository, the
437new package automatically gets built on the supported platforms by
4985a427 438@url{https://@value{SUBSTITUTE-SERVER-1}, our continuous integration system}.
afe7408e
LC
439
440@cindex substituter
441Users can obtain the new package definition simply by running
442@command{guix pull} (@pxref{Invoking guix pull}). When
4985a427 443@code{@value{SUBSTITUTE-SERVER-1}} is done building the package, installing the
afe7408e
LC
444package automatically downloads binaries from there
445(@pxref{Substitutes}). The only place where human intervention is
446needed is to review and apply the patch.
447
448
449@menu
450* Software Freedom:: What may go into the distribution.
451* Package Naming:: What's in a name?
452* Version Numbers:: When the name is not enough.
453* Synopses and Descriptions:: Helping users find the right package.
71e746cc 454* Snippets versus Phases:: Whether to use a snippet, or a build phase.
15fba3b1 455* Emacs Packages:: Your Elisp fix.
afe7408e
LC
456* Python Modules:: A touch of British comedy.
457* Perl Modules:: Little pearls.
458* Java Packages:: Coffee break.
8d1b22b2 459* Rust Crates:: Beware of oxidation.
aefcfdd0 460* Elm Packages:: Trees of browser code
afe7408e
LC
461* Fonts:: Fond of fonts.
462@end menu
463
464@node Software Freedom
465@subsection Software Freedom
466
467@c Adapted from http://www.gnu.org/philosophy/philosophy.html.
468@cindex free software
469The GNU operating system has been developed so that users can have
470freedom in their computing. GNU is @dfn{free software}, meaning that
21656ffa 471users have the @url{https://www.gnu.org/philosophy/free-sw.html,four
afe7408e
LC
472essential freedoms}: to run the program, to study and change the program
473in source code form, to redistribute exact copies, and to distribute
474modified versions. Packages found in the GNU distribution provide only
475software that conveys these four freedoms.
476
477In addition, the GNU distribution follow the
21656ffa 478@url{https://www.gnu.org/distros/free-system-distribution-guidelines.html,free
afe7408e
LC
479software distribution guidelines}. Among other things, these guidelines
480reject non-free firmware, recommendations of non-free software, and
481discuss ways to deal with trademarks and patents.
482
483Some otherwise free upstream package sources contain a small and optional
484subset that violates the above guidelines, for instance because this subset
485is itself non-free code. When that happens, the offending items are removed
486with appropriate patches or code snippets in the @code{origin} form of the
487package (@pxref{Defining Packages}). This way, @code{guix
488build --source} returns the ``freed'' source rather than the unmodified
489upstream source.
490
491
492@node Package Naming
493@subsection Package Naming
494
495@cindex package name
1dfc08f7 496A package actually has two names associated with it.
afe7408e
LC
497First, there is the name of the @emph{Scheme variable}, the one following
498@code{define-public}. By this name, the package can be made known in the
499Scheme code, for instance as input to another package. Second, there is
500the string in the @code{name} field of a package definition. This name
501is used by package management commands such as
502@command{guix package} and @command{guix build}.
503
504Both are usually the same and correspond to the lowercase conversion of
505the project name chosen upstream, with underscores replaced with
506hyphens. For instance, GNUnet is available as @code{gnunet}, and
507SDL_net as @code{sdl-net}.
508
1b1a61f8
TGRBGG
509A noteworthy exception to this rule is when the project name is only a
510single character, or if an older maintained project with the same name
511already exists---regardless of whether it has already been packaged for
512Guix. Use common sense to make such names unambiguous and meaningful.
513For example, Guix's package for the shell called ``s'' upstream is
514@code{s-shell} and @emph{not} @code{s}. Feel free to ask your fellow
515hackers for inspiration.
516
afe7408e
LC
517We do not add @code{lib} prefixes for library packages, unless these are
518already part of the official project name. But @pxref{Python
519Modules} and @ref{Perl Modules} for special rules concerning modules for
520the Python and Perl languages.
521
522Font package names are handled differently, @pxref{Fonts}.
523
524
525@node Version Numbers
526@subsection Version Numbers
527
528@cindex package version
529We usually package only the latest version of a given free software
530project. But sometimes, for instance for incompatible library versions,
531two (or more) versions of the same package are needed. These require
532different Scheme variable names. We use the name as defined
533in @ref{Package Naming}
534for the most recent version; previous versions use the same name, suffixed
535by @code{-} and the smallest prefix of the version number that may
536distinguish the two versions.
537
538The name inside the package definition is the same for all versions of a
539package and does not contain any version number.
540
541For instance, the versions 2.24.20 and 3.9.12 of GTK+ may be packaged as follows:
542
8ba31e8b 543@lisp
afe7408e
LC
544(define-public gtk+
545 (package
546 (name "gtk+")
547 (version "3.9.12")
548 ...))
549(define-public gtk+-2
550 (package
551 (name "gtk+")
552 (version "2.24.20")
553 ...))
8ba31e8b 554@end lisp
afe7408e 555If we also wanted GTK+ 3.8.2, this would be packaged as
8ba31e8b 556@lisp
afe7408e
LC
557(define-public gtk+-3.8
558 (package
559 (name "gtk+")
560 (version "3.8.2")
561 ...))
8ba31e8b 562@end lisp
afe7408e
LC
563
564@c See <https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00425.html>,
565@c for a discussion of what follows.
566@cindex version number, for VCS snapshots
567Occasionally, we package snapshots of upstream's version control system
568(VCS) instead of formal releases. This should remain exceptional,
569because it is up to upstream developers to clarify what the stable
570release is. Yet, it is sometimes necessary. So, what should we put in
571the @code{version} field?
572
573Clearly, we need to make the commit identifier of the VCS snapshot
574visible in the version string, but we also need to make sure that the
575version string is monotonically increasing so that @command{guix package
576--upgrade} can determine which version is newer. Since commit
577identifiers, notably with Git, are not monotonically increasing, we add
578a revision number that we increase each time we upgrade to a newer
579snapshot. The resulting version string looks like this:
580
581@example
5822.0.11-3.cabba9e
583 ^ ^ ^
584 | | `-- upstream commit ID
585 | |
586 | `--- Guix package revision
587 |
588latest upstream version
589@end example
590
591It is a good idea to strip commit identifiers in the @code{version}
592field to, say, 7 digits. It avoids an aesthetic annoyance (assuming
593aesthetics have a role to play here) as well as problems related to OS
594limits such as the maximum shebang length (127 bytes for the Linux
b8baebae
XC
595kernel). There are helper functions for doing this for packages using
596@code{git-fetch} or @code{hg-fetch} (see below). It is best to use the
597full commit identifiers in @code{origin}s, though, to avoid ambiguities.
598A typical package definition may look like this:
599
afe7408e 600
8ba31e8b 601@lisp
afe7408e
LC
602(define my-package
603 (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
604 (revision "1")) ;Guix package revision
605 (package
606 (version (git-version "0.9" revision commit))
607 (source (origin
608 (method git-fetch)
609 (uri (git-reference
610 (url "git://example.org/my-package.git")
611 (commit commit)))
612 (sha256 (base32 "1mbikn@dots{}"))
613 (file-name (git-file-name name version))))
614 ;; @dots{}
615 )))
8ba31e8b 616@end lisp
afe7408e 617
b8baebae
XC
618@deffn {Scheme Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT}
619Return the version string for packages using @code{git-fetch}.
620
621@lisp
622(git-version "0.2.3" "0" "93818c936ee7e2f1ba1b315578bde363a7d43d05")
623@result{} "0.2.3-0.93818c9"
624@end lisp
625@end deffn
626
627@deffn {Scheme Procedure} hg-version @var{VERSION} @var{REVISION} @var{CHANGESET}
628Return the version string for packages using @code{hg-fetch}. It works
629in the same way as @code{git-version}.
630@end deffn
631
afe7408e
LC
632@node Synopses and Descriptions
633@subsection Synopses and Descriptions
634
635@cindex package description
636@cindex package synopsis
637As we have seen before, each package in GNU@tie{}Guix includes a
638synopsis and a description (@pxref{Defining Packages}). Synopses and
639descriptions are important: They are what @command{guix package
640--search} searches, and a crucial piece of information to help users
641determine whether a given package suits their needs. Consequently,
642packagers should pay attention to what goes into them.
643
644Synopses must start with a capital letter and must not end with a
645period. They must not start with ``a'' or ``the'', which usually does
646not bring anything; for instance, prefer ``File-frobbing tool'' over ``A
647tool that frobs files''. The synopsis should say what the package
648is---e.g., ``Core GNU utilities (file, text, shell)''---or what it is
649used for---e.g., the synopsis for GNU@tie{}grep is ``Print lines
650matching a pattern''.
651
652Keep in mind that the synopsis must be meaningful for a very wide
653audience. For example, ``Manipulate alignments in the SAM format''
654might make sense for a seasoned bioinformatics researcher, but might be
655fairly unhelpful or even misleading to a non-specialized audience. It
656is a good idea to come up with a synopsis that gives an idea of the
657application domain of the package. In this example, this might give
658something like ``Manipulate nucleotide sequence alignments'', which
659hopefully gives the user a better idea of whether this is what they are
660looking for.
661
662Descriptions should take between five and ten lines. Use full
663sentences, and avoid using acronyms without first introducing them.
664Please avoid marketing phrases such as ``world-leading'',
665``industrial-strength'', and ``next-generation'', and avoid superlatives
666like ``the most advanced''---they are not helpful to users looking for a
667package and may even sound suspicious. Instead, try to be factual,
668mentioning use cases and features.
669
670@cindex Texinfo markup, in package descriptions
671Descriptions can include Texinfo markup, which is useful to introduce
672ornaments such as @code{@@code} or @code{@@dfn}, bullet lists, or
673hyperlinks (@pxref{Overview,,, texinfo, GNU Texinfo}). However you
674should be careful when using some characters for example @samp{@@} and
675curly braces which are the basic special characters in Texinfo
676(@pxref{Special Characters,,, texinfo, GNU Texinfo}). User interfaces
6cd67532 677such as @command{guix show} take care of rendering it
afe7408e
LC
678appropriately.
679
680Synopses and descriptions are translated by volunteers
2a9784ff
JL
681@uref{https://translate.fedoraproject.org/projects/guix/packages, at
682Weblate} so that as many users as possible can read them in
afe7408e
LC
683their native language. User interfaces search them and display them in
684the language specified by the current locale.
685
686To allow @command{xgettext} to extract them as translatable strings,
687synopses and descriptions @emph{must be literal strings}. This means
688that you cannot use @code{string-append} or @code{format} to construct
689these strings:
690
691@lisp
692(package
693 ;; @dots{}
694 (synopsis "This is translatable")
695 (description (string-append "This is " "*not*" " translatable.")))
696@end lisp
697
698Translation is a lot of work so, as a packager, please pay even more
699attention to your synopses and descriptions as every change may entail
700additional work for translators. In order to help them, it is possible
701to make recommendations or instructions visible to them by inserting
702special comments like this (@pxref{xgettext Invocation,,, gettext, GNU
703Gettext}):
704
93c25181 705@lisp
afe7408e
LC
706;; TRANSLATORS: "X11 resize-and-rotate" should not be translated.
707(description "ARandR is designed to provide a simple visual front end
708for the X11 resize-and-rotate (RandR) extension. @dots{}")
93c25181 709@end lisp
afe7408e 710
71e746cc
MC
711@node Snippets versus Phases
712@subsection Snippets versus Phases
713
714@cindex snippets, when to use
715The boundary between using an origin snippet versus a build phase to
716modify the sources of a package can be elusive. Origin snippets are
717typically used to remove unwanted files such as bundled libraries,
718nonfree sources, or to apply simple substitutions. The source derived
719from an origin should produce a source that can be used to build the
720package on any system that the upstream package supports (i.e., act as
721the corresponding source). In particular, origin snippets must not
722embed store items in the sources; such patching should rather be done
723using build phases. Refer to the @code{origin} record documentation for
724more information (@pxref{origin Reference}).
afe7408e 725
15fba3b1
MC
726@node Emacs Packages
727@subsection Emacs Packages
728
729@cindex emacs, packaging
730@cindex elisp, packaging
731Emacs packages should preferably use the Emacs build system
732(@pxref{emacs-build-system}), for uniformity and the benefits provided
733by its build phases, such as the auto-generation of the autoloads file
eea7cc31 734and the byte compilation of the sources. Because there is no
15fba3b1
MC
735standardized way to run a test suite for Emacs packages, tests are
736disabled by default. When a test suite is available, it should be
eea7cc31 737enabled by setting the @code{#:tests?} argument to @code{#true}. By
15fba3b1
MC
738default, the command to run the test is @command{make check}, but any
739command can be specified via the @code{#:test-command} argument. The
740@code{#:test-command} argument expects a list containing a command and
eea7cc31 741its arguments, to be invoked during the @code{check} phase.
15fba3b1
MC
742
743The Elisp dependencies of Emacs packages are typically provided as
744@code{propagated-inputs} when required at run time. As for other
745packages, build or test dependencies should be specified as
746@code{native-inputs}.
747
748Emacs packages sometimes depend on resources directories that should be
749installed along the Elisp files. The @code{#:include} argument can be
750used for that purpose, by specifying a list of regexps to match. The
751best practice when using the @code{#:include} argument is to extend
752rather than override its default value (accessible via the
753@code{%default-include} variable). As an example, a yasnippet extension
754package typically include a @file{snippets} directory, which could be
755copied to the installation directory using:
756
757@lisp
2c469f04 758#:include (cons "^snippets/" %default-include)
15fba3b1
MC
759@end lisp
760
761When encountering problems, it is wise to check for the presence of the
762@code{Package-Requires} extension header in the package main source
763file, and whether any dependencies and their versions listed therein are
764satisfied.
765
afe7408e
LC
766@node Python Modules
767@subsection Python Modules
768
769@cindex python
770We currently package Python 2 and Python 3, under the Scheme variable names
771@code{python-2} and @code{python} as explained in @ref{Version Numbers}.
772To avoid confusion and naming clashes with other programming languages, it
773seems desirable that the name of a package for a Python module contains
774the word @code{python}.
775
39356057
LF
776Some modules are compatible with only one version of Python, others with
777both. If the package Foo is compiled with Python 3, we name it
778@code{python-foo}. If it is compiled with Python 2, we name it
779@code{python2-foo}. Packages should be added when they are necessary;
780we don't add Python 2 variants of the package unless we are going to use
781them.
afe7408e
LC
782
783If a project already contains the word @code{python}, we drop this;
784for instance, the module python-dateutil is packaged under the names
785@code{python-dateutil} and @code{python2-dateutil}. If the project name
786starts with @code{py} (e.g.@: @code{pytz}), we keep it and prefix it as
787described above.
788
400a7a4c
LDB
789@quotation Note
790Currently there are two different build systems for Python packages in Guix:
791@var{python-build-system} and @var{pyproject-build-system}. For the
792longest time, Python packages were built from an informally specified
793@file{setup.py} file. That worked amazingly well, considering Python's
794success, but was difficult to build tooling around. As a result, a host
795of alternative build systems emerged and the community eventually settled on a
796@url{https://peps.python.org/pep-0517/, formal standard} for specifying build
797requirements. @var{pyproject-build-system} is Guix's implementation of this
798standard. It is considered ``experimental'' in that it does not yet support
799all the various PEP-517 @emph{build backends}, but you are encouraged to try
800it for new Python packages and report any problems. It will eventually be
801deprecated and merged into @var{python-build-system}.
802@end quotation
803
afe7408e
LC
804@subsubsection Specifying Dependencies
805@cindex inputs, for Python packages
806
807Dependency information for Python packages is usually available in the
808package source tree, with varying degrees of accuracy: in the
400a7a4c
LDB
809@file{pyproject.toml} file, the @file{setup.py} file, in
810@file{requirements.txt}, or in @file{tox.ini} (the latter mostly for
811test dependencies).
afe7408e
LC
812
813Your mission, when writing a recipe for a Python package, is to map
814these dependencies to the appropriate type of ``input'' (@pxref{package
815Reference, inputs}). Although the @code{pypi} importer normally does a
816good job (@pxref{Invoking guix import}), you may want to check the
817following check list to determine which dependency goes where.
818
819@itemize
820
821@item
400a7a4c
LDB
822We currently package Python with @code{setuptools} and @code{pip}
823installed per default. This is about to change, and users are encouraged
824to use @code{python-toolchain} if they want a build environment for Python.
825
826@command{guix lint} will warn if @code{setuptools} or @code{pip} are
827added as native-inputs because they are generally not necessary.
afe7408e
LC
828
829@item
830Python dependencies required at run time go into
831@code{propagated-inputs}. They are typically defined with the
832@code{install_requires} keyword in @file{setup.py}, or in the
833@file{requirements.txt} file.
834
835@item
400a7a4c
LDB
836Python packages required only at build time---e.g., those listed under
837@code{build-system.requires} in @file{pyproject.toml} or with the
838@code{setup_requires} keyword in @file{setup.py}---or dependencies only
839for testing---e.g., those in @code{tests_require} or @file{tox.ini}---go into
afe7408e
LC
840@code{native-inputs}. The rationale is that (1) they do not need to be
841propagated because they are not needed at run time, and (2) in a
842cross-compilation context, it's the ``native'' input that we'd want.
843
844Examples are the @code{pytest}, @code{mock}, and @code{nose} test
845frameworks. Of course if any of these packages is also required at
846run-time, it needs to go to @code{propagated-inputs}.
847
848@item
849Anything that does not fall in the previous categories goes to
850@code{inputs}, for example programs or C libraries required for building
851Python packages containing C extensions.
852
853@item
854If a Python package has optional dependencies (@code{extras_require}),
855it is up to you to decide whether to add them or not, based on their
856usefulness/overhead ratio (@pxref{Submitting Patches, @command{guix
857size}}).
858
859@end itemize
860
861
862@node Perl Modules
863@subsection Perl Modules
864
865@cindex perl
866Perl programs standing for themselves are named as any other package,
867using the lowercase upstream name.
868For Perl packages containing a single class, we use the lowercase class name,
869replace all occurrences of @code{::} by dashes and prepend the prefix
870@code{perl-}.
871So the class @code{XML::Parser} becomes @code{perl-xml-parser}.
872Modules containing several classes keep their lowercase upstream name and
873are also prepended by @code{perl-}. Such modules tend to have the word
874@code{perl} somewhere in their name, which gets dropped in favor of the
875prefix. For instance, @code{libwww-perl} becomes @code{perl-libwww}.
876
877
878@node Java Packages
879@subsection Java Packages
880
881@cindex java
882Java programs standing for themselves are named as any other package,
883using the lowercase upstream name.
884
885To avoid confusion and naming clashes with other programming languages,
886it is desirable that the name of a package for a Java package is
887prefixed with @code{java-}. If a project already contains the word
888@code{java}, we drop this; for instance, the package @code{ngsjava} is
889packaged under the name @code{java-ngs}.
890
891For Java packages containing a single class or a small class hierarchy,
892we use the lowercase class name, replace all occurrences of @code{.} by
893dashes and prepend the prefix @code{java-}. So the class
894@code{apache.commons.cli} becomes package
895@code{java-apache-commons-cli}.
896
897
8d1b22b2
EF
898@node Rust Crates
899@subsection Rust Crates
900
901@cindex rust
902Rust programs standing for themselves are named as any other package, using the
903lowercase upstream name.
904
905To prevent namespace collisions we prefix all other Rust packages with the
906@code{rust-} prefix. The name should be changed to lowercase as appropriate and
907dashes should remain in place.
908
909In the rust ecosystem it is common for multiple incompatible versions of a
784048c2
HG
910package to be used at any given time, so all package definitions should have a
911versioned suffix. The versioned suffix is the left-most non-zero digit (and
912any leading zeros, of course). This follows the ``caret'' version scheme
913intended by Cargo. Examples@: @code{rust-clap-2}, @code{rust-rand-0.6}.
8d1b22b2
EF
914
915Because of the difficulty in reusing rust packages as pre-compiled inputs for
916other packages the Cargo build system (@pxref{Build Systems,
917@code{cargo-build-system}}) presents the @code{#:cargo-inputs} and
918@code{cargo-development-inputs} keywords as build system arguments. It would be
919helpful to think of these as similar to @code{propagated-inputs} and
920@code{native-inputs}. Rust @code{dependencies} and @code{build-dependencies}
921should go in @code{#:cargo-inputs}, and @code{dev-dependencies} should go in
922@code{#:cargo-development-inputs}. If a Rust package links to other libraries
923then the standard placement in @code{inputs} and the like should be used.
924
925Care should be taken to ensure the correct version of dependencies are used; to
926this end we try to refrain from skipping the tests or using @code{#:skip-build?}
927when possible. Of course this is not always possible, as the package may be
928developed for a different Operating System, depend on features from the Nightly
929Rust compiler, or the test suite may have atrophied since it was released.
930
931
aefcfdd0
PM
932@node Elm Packages
933@subsection Elm Packages
934
935@cindex Elm
936Elm applications can be named like other software: their names need not
937mention Elm.
938
939Packages in the Elm sense (see @code{elm-build-system} under @ref{Build
940Systems}) are required use names of the format
941@var{author}@code{/}@var{project}, where both the @var{author} and the
942@var{project} may contain hyphens internally, and the @var{author} sometimes
943contains uppercase letters.
944
945To form the Guix package name from the upstream name, we follow a convention
946similar to Python packages (@pxref{Python Modules}), adding an @code{elm-}
947prefix unless the name would already begin with @code{elm-}.
948
949In many cases we can reconstruct an Elm package's upstream name heuristically,
950but, since conversion to a Guix-style name involves a loss of information,
951this is not always possible. Care should be taken to add the
903c8258
PM
952@code{'upstream-name} property when necessary so that @samp{guix import elm}
953will work correctly (@pxref{Invoking guix import}). The most notable scenarios
aefcfdd0
PM
954when explicitly specifying the upstream name is necessary are:
955
956@enumerate
957@item
958When the @var{author} is @code{elm} and the @var{project} contains one or more
959hyphens, as with @code{elm/virtual-dom}; and
960
961@item
962When the @var{author} contains hyphens or uppercase letters, as with
963@code{Elm-Canvas/raster-shapes}---unless the @var{author} is
964@code{elm-explorations}, which is handled as a special case, so packages like
965@code{elm-explorations/markdown} do @emph{not} need to use the
966@code{'upstream-name} property.
967@end enumerate
968
969The module @code{(guix build-system elm)} provides the following utilities for
970working with names and related conventions:
971
972@deffn {Scheme procedure} elm-package-origin @var{elm-name} @var{version} @
973 @var{hash}
974Returns a Git origin using the repository naming and tagging regime required
975for a published Elm package with the upstream name @var{elm-name} at version
976@var{version} with sha256 checksum @var{hash}.
977
978For example:
979@lisp
980(package
981 (name "elm-html")
982 (version "1.0.0")
983 (source
984 (elm-package-origin
985 "elm/html"
986 version
987 (base32 "15k1679ja57vvlpinpv06znmrxy09lbhzfkzdc89i01qa8c4gb4a")))
988 ...)
989@end lisp
990@end deffn
991
992@deffn {Scheme procedure} elm->package-name @var{elm-name}
993Returns the Guix-style package name for an Elm package with upstream name
994@var{elm-name}.
995
996Note that there is more than one possible @var{elm-name} for which
997@code{elm->package-name} will produce a given result.
998@end deffn
999
1000@deffn {Scheme procedure} guix-package->elm-name @var{package}
1001Given an Elm @var{package}, returns the possibly-inferred upstream name, or
1002@code{#f} the upstream name is not specified via the @code{'upstream-name}
1003property and can not be inferred by @code{infer-elm-package-name}.
1004@end deffn
1005
1006@deffn {Scheme procedure} infer-elm-package-name @var{guix-name}
1007Given the @var{guix-name} of an Elm package, returns the inferred upstream
1008name, or @code{#f} if the upstream name can't be inferred. If the result is
1009not @code{#f}, supplying it to @code{elm->package-name} would produce
1010@var{guix-name}.
1011@end deffn
1012
afe7408e
LC
1013@node Fonts
1014@subsection Fonts
1015
1016@cindex fonts
1017For fonts that are in general not installed by a user for typesetting
1018purposes, or that are distributed as part of a larger software package,
1019we rely on the general packaging rules for software; for instance, this
1020applies to the fonts delivered as part of the X.Org system or fonts that
1021are part of TeX Live.
1022
1023To make it easier for a user to search for fonts, names for other packages
1024containing only fonts are constructed as follows, independently of the
1025upstream package name.
1026
1027The name of a package containing only one font family starts with
1028@code{font-}; it is followed by the foundry name and a dash @code{-}
1029if the foundry is known, and the font family name, in which spaces are
1030replaced by dashes (and as usual, all upper case letters are transformed
1031to lower case).
1032For example, the Gentium font family by SIL is packaged under the name
1033@code{font-sil-gentium}.
1034
1035For a package containing several font families, the name of the collection
1036is used in the place of the font family name.
1037For instance, the Liberation fonts consist of three families,
1038Liberation Sans, Liberation Serif and Liberation Mono.
1039These could be packaged separately under the names
1040@code{font-liberation-sans} and so on; but as they are distributed together
1041under a common name, we prefer to package them together as
1042@code{font-liberation}.
1043
1044In the case where several formats of the same font family or font collection
1045are packaged separately, a short form of the format, prepended by a dash,
1046is added to the package name. We use @code{-ttf} for TrueType fonts,
1047@code{-otf} for OpenType fonts and @code{-type1} for PostScript Type 1
1048fonts.
1049
1050
8c01b9d0
ML
1051@node Coding Style
1052@section Coding Style
1053
1054In general our code follows the GNU Coding Standards (@pxref{Top,,,
1055standards, GNU Coding Standards}). However, they do not say much about
1056Scheme, so here are some additional rules.
1057
1058@menu
1059* Programming Paradigm:: How to compose your elements.
1060* Modules:: Where to store your code?
1061* Data Types and Pattern Matching:: Implementing data structures.
1062* Formatting Code:: Writing conventions.
1063@end menu
1064
1065@node Programming Paradigm
1066@subsection Programming Paradigm
1067
1068Scheme code in Guix is written in a purely functional style. One
1069exception is code that involves input/output, and procedures that
1070implement low-level concepts, such as the @code{memoize} procedure.
1071
1072@node Modules
1073@subsection Modules
1074
1075Guile modules that are meant to be used on the builder side must live in
1076the @code{(guix build @dots{})} name space. They must not refer to
1077other Guix or GNU modules. However, it is OK for a ``host-side'' module
1078to use a build-side module.
1079
1080Modules that deal with the broader GNU system should be in the
1081@code{(gnu @dots{})} name space rather than @code{(guix @dots{})}.
1082
1083@node Data Types and Pattern Matching
1084@subsection Data Types and Pattern Matching
1085
1086The tendency in classical Lisp is to use lists to represent everything,
1087and then to browse them ``by hand'' using @code{car}, @code{cdr},
1088@code{cadr}, and co. There are several problems with that style,
1089notably the fact that it is hard to read, error-prone, and a hindrance
1090to proper type error reports.
1091
1092Guix code should define appropriate data types (for instance, using
1093@code{define-record-type*}) rather than abuse lists. In addition, it
1094should use pattern matching, via Guile’s @code{(ice-9 match)} module,
f06f569a
LC
1095especially when matching lists (@pxref{Pattern Matching,,, guile, GNU
1096Guile Reference Manual}).
8c01b9d0
ML
1097
1098@node Formatting Code
1099@subsection Formatting Code
1100
7bb2b10c
LC
1101@cindex formatting code
1102@cindex coding style
8c01b9d0
ML
1103When writing Scheme code, we follow common wisdom among Scheme
1104programmers. In general, we follow the
21656ffa 1105@url{https://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
8c01b9d0
ML
1106Style Rules}. This document happens to describe the conventions mostly
1107used in Guile’s code too. It is very thoughtful and well written, so
1108please do read it.
1109
1110Some special forms introduced in Guix, such as the @code{substitute*}
1111macro, have special indentation rules. These are defined in the
8ca0c88a
AK
1112@file{.dir-locals.el} file, which Emacs automatically uses. Also note
1113that Emacs-Guix provides @code{guix-devel-mode} mode that indents and
1114highlights Guix code properly (@pxref{Development,,, emacs-guix, The
1115Emacs-Guix Reference Manual}).
7bb2b10c
LC
1116
1117@cindex indentation, of code
1118@cindex formatting, of code
1119If you do not use Emacs, please make sure to let your editor knows these
1120rules. To automatically indent a package definition, you can also run:
1121
1122@example
c4fe13c2 1123./pre-inst-env guix style @var{package}
7bb2b10c
LC
1124@end example
1125
1126@noindent
c4fe13c2 1127@xref{Invoking guix style}, for more information.
8c01b9d0 1128
60912a88
LC
1129@cindex Vim, Scheme code editing
1130If you are editing code with Vim, we recommend that you run @code{:set
1131autoindent} so that your code is automatically indented as you type.
1132Additionally,
1133@uref{https://www.vim.org/scripts/script.php?script_id=3998,
1134@code{paredit.vim}} may help you deal with all these parentheses.
1135
8c01b9d0
ML
1136We require all top-level procedures to carry a docstring. This
1137requirement can be relaxed for simple private procedures in the
1138@code{(guix build @dots{})} name space, though.
1139
1140Procedures should not have more than four positional parameters. Use
1141keyword parameters for procedures that take more than four parameters.
1142
1143
1144@node Submitting Patches
1145@section Submitting Patches
1146
1147Development is done using the Git distributed version control system.
1148Thus, access to the repository is not strictly necessary. We welcome
1149contributions in the form of patches as produced by @code{git
9fc8ae41 1150format-patch} sent to the @email{guix-patches@@gnu.org} mailing list
5ecbf5b1
MC
1151(@pxref{Submitting patches to a project,,, git, Git User Manual}).
1152Contributors are encouraged to take a moment to set some Git repository
1153options (@pxref{Configuring Git}) first, which can improve the
1154readability of patches. Seasoned Guix developers may also want to look
1155at the section on commit access (@pxref{Commit Access}).
230efa87 1156
a7bde77d
LC
1157This mailing list is backed by a Debbugs instance, which allows us to
1158keep track of submissions (@pxref{Tracking Bugs and Patches}). Each
1159message sent to that mailing list gets a new tracking number assigned;
1160people can then follow up on the submission by sending email to
8fed831e 1161@code{@var{ISSUE_NUMBER}@@debbugs.gnu.org}, where @var{ISSUE_NUMBER} is
1162the tracking number (@pxref{Sending a Patch Series}).
230efa87 1163
8c01b9d0
ML
1164Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
1165standards, GNU Coding Standards}); you can check the commit history for
1166examples.
1167
1168Before submitting a patch that adds or modifies a package definition,
fcc58db6
LC
1169please run through this check list:
1170
1171@enumerate
308c08d3
RW
1172@item
1173If the authors of the packaged software provide a cryptographic
1174signature for the release tarball, make an effort to verify the
1175authenticity of the archive. For a detached GPG signature file this
1176would be done with the @code{gpg --verify} command.
1177
cbd02397
LC
1178@item
1179Take some time to provide an adequate synopsis and description for the
1180package. @xref{Synopses and Descriptions}, for some guidelines.
1181
fcc58db6
LC
1182@item
1183Run @code{guix lint @var{package}}, where @var{package} is the
8c01b9d0 1184name of the new or modified package, and fix any errors it reports
fcc58db6
LC
1185(@pxref{Invoking guix lint}).
1186
c4fe13c2
LC
1187@item
1188Run @code{guix style @var{package}} to format the new package definition
1189according to the project's conventions (@pxref{Invoking guix style}).
1190
fcc58db6
LC
1191@item
1192Make sure the package builds on your platform, using @code{guix build
1193@var{package}}.
1194
89339a35
DM
1195@item
1196We recommend you also try building the package on other supported
1197platforms. As you may not have access to actual hardware platforms, we
1198recommend using the @code{qemu-binfmt-service-type} to emulate them. In
a9afff4b
SR
1199order to enable it, add the @code{virtualization} service module and the
1200following service to the list of services in your @code{operating-system}
1201configuration:
89339a35 1202
8ba31e8b 1203@lisp
89339a35
DM
1204(service qemu-binfmt-service-type
1205 (qemu-binfmt-configuration
a9afff4b 1206 (platforms (lookup-qemu-platforms "arm" "aarch64"))))
8ba31e8b 1207@end lisp
89339a35
DM
1208
1209Then reconfigure your system.
1210
1211You can then build packages for different platforms by specifying the
1212@code{--system} option. For example, to build the "hello" package for
de393bd0 1213the armhf or aarch64 architectures, you would run the following
b28e4e3c 1214commands, respectively:
89339a35
DM
1215@example
1216guix build --system=armhf-linux --rounds=2 hello
1217guix build --system=aarch64-linux --rounds=2 hello
89339a35
DM
1218@end example
1219
d222522e
LC
1220@item
1221@cindex bundling
1222Make sure the package does not use bundled copies of software already
1223available as separate packages.
1224
1225Sometimes, packages include copies of the source code of their
1226dependencies as a convenience for users. However, as a distribution, we
1227want to make sure that such packages end up using the copy we already
1228have in the distribution, if there is one. This improves resource usage
1229(the dependency is built and stored only once), and allows the
1230distribution to make transverse changes such as applying security
1231updates for a given software package in a single place and have them
1232affect the whole system---something that bundled copies prevent.
1233
fcc58db6
LC
1234@item
1235Take a look at the profile reported by @command{guix size}
1236(@pxref{Invoking guix size}). This will allow you to notice references
1237to other packages unwillingly retained. It may also help determine
1238whether to split the package (@pxref{Packages with Multiple Outputs}),
024e358c 1239and which optional dependencies should be used. In particular, avoid adding
0afeb746 1240@code{texlive} as a dependency: because of its extreme size, use
48cccf06 1241the @code{texlive-tiny} package or @code{texlive-union} procedure instead.
fcc58db6
LC
1242
1243@item
f7331f06 1244For important changes, check that dependent packages (if applicable) are
fcc58db6 1245not affected by the change; @code{guix refresh --list-dependent
8c01b9d0
ML
1246@var{package}} will help you do that (@pxref{Invoking guix refresh}).
1247
916b5eba
LC
1248@c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
1249@cindex branching strategy
1250@cindex rebuild scheduling strategy
1251Depending on the number of dependent packages and thus the amount of
1252rebuilding induced, commits go to different branches, along these lines:
1253
1254@table @asis
1255@item 300 dependent packages or less
1256@code{master} branch (non-disruptive changes).
1257
bb9a99e6 1258@item between 300 and 1,800 dependent packages
916b5eba 1259@code{staging} branch (non-disruptive changes). This branch is intended
bb9a99e6 1260to be merged in @code{master} every 6 weeks or so. Topical changes
916b5eba 1261(e.g., an update of the GNOME stack) can instead go to a specific branch
4de68873
LF
1262(say, @code{gnome-updates}). This branch is not expected to be
1263buildable or usable until late in its development process.
916b5eba 1264
bb9a99e6 1265@item more than 1,800 dependent packages
916b5eba
LC
1266@code{core-updates} branch (may include major and potentially disruptive
1267changes). This branch is intended to be merged in @code{master} every
4de68873
LF
12686 months or so. This branch is not expected to be buildable or usable
1269until late in its development process.
916b5eba
LC
1270@end table
1271
4985a427 1272All these branches are @uref{https://@value{SUBSTITUTE-SERVER-1},
38ab778f 1273tracked by our build farm} and merged into @code{master} once
189b1543
LC
1274everything has been successfully built. This allows us to fix issues
1275before they hit users, and to reduce the window during which pre-built
1276binaries are not available.
1277
175bea0c 1278When we decide to start building the @code{staging} or
58853df8
LF
1279@code{core-updates} branches, they will be forked and renamed with the
1280suffix @code{-frozen}, at which time only bug fixes may be pushed to the
1281frozen branches. The @code{core-updates} and @code{staging} branches
1282will remain open to accept patches for the next cycle. Please ask on
1283the mailing list or IRC if unsure where to place a patch.
38ab778f
MB
1284@c TODO: It would be good with badges on the website that tracks these
1285@c branches. Or maybe even a status page.
1286
d23c20f1 1287@item
5b74fe06
LC
1288@cindex determinism, of build processes
1289@cindex reproducible builds, checking
d23c20f1
LC
1290Check whether the package's build process is deterministic. This
1291typically means checking whether an independent build of the package
1292yields the exact same result that you obtained, bit for bit.
1293
5b74fe06
LC
1294A simple way to do that is by building the same package several times in
1295a row on your machine (@pxref{Invoking guix build}):
1296
1297@example
1298guix build --rounds=2 my-package
1299@end example
1300
1301This is enough to catch a class of common non-determinism issues, such
1302as timestamps or randomly-generated output in the build result.
1303
1304Another option is to use @command{guix challenge} (@pxref{Invoking guix
1305challenge}). You may run it once the package has been committed and
4985a427 1306built by @code{@value{SUBSTITUTE-SERVER-1}} to check whether it obtains the same
5b74fe06
LC
1307result as you did. Better yet: Find another machine that can build it
1308and run @command{guix publish}. Since the remote build machine is
1309likely different from yours, this can catch non-determinism issues
1310related to the hardware---e.g., use of different instruction set
1311extensions---or to the operating system kernel---e.g., reliance on
1312@code{uname} or @file{/proc} files.
d23c20f1 1313
3c2d03a2
LC
1314@item
1315When writing documentation, please use gender-neutral wording when
1316referring to people, such as
1317@uref{https://en.wikipedia.org/wiki/Singular_they, singular
1318``they''@comma{} ``their''@comma{} ``them''}, and so forth.
1319
3a78fab8 1320@item
1321Verify that your patch contains only one set of related changes.
1322Bundling unrelated changes together makes reviewing harder and slower.
1323
1324Examples of unrelated changes include the addition of several packages,
1325or a package update along with fixes to that package.
1326
7bb2b10c 1327@item
c4fe13c2
LC
1328Please follow our code formatting rules, possibly running
1329@command{guix style} script to do that automatically for you
7bb2b10c
LC
1330(@pxref{Formatting Code}).
1331
4feb589b
PN
1332@item
1333When possible, use mirrors in the source URL (@pxref{Invoking guix download}).
1334Use reliable URLs, not generated ones. For instance, GitHub archives are not
1335necessarily identical from one generation to the next, so in this case it's
1336often better to clone the repository. Don't use the @command{name} field in
1337the URL: it is not very useful and if the name changes, the URL will probably
1338be wrong.
1339
bf99d7e0 1340@item
da31e7d9
PN
1341Check if Guix builds (@pxref{Building from Git}) and address the
1342warnings, especially those about use of undefined symbols.
bf99d7e0 1343
9fcf2820
PN
1344@item
1345Make sure your changes do not break Guix and simulate a @code{guix pull} with:
1346@example
1347guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master
1348@end example
1349
fcc58db6
LC
1350@end enumerate
1351
a40424bd 1352When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as
a1891cbf
BW
1353a subject, if your patch is to be applied on a branch other than
1354@code{master}, say @code{core-updates}, specify it in the subject like
f9694a04
MC
1355@samp{[PATCH core-updates] @dots{}}.
1356
f9694a04
MC
1357You may use your email client or the @command{git send-email} command
1358(@pxref{Sending a Patch Series}). We prefer to get patches in plain
1359text messages, either inline or as MIME attachments. You are advised to
1360pay attention if your email client changes anything like line breaks or
1361indentation which could potentially break the patches.
5a183a1e 1362
c8d6fa77
FL
1363Expect some delay when you submit your very first patch to
1364@email{guix-patches@@gnu.org}. You have to wait until you get an
4b08aad5 1365acknowledgement with the assigned tracking number. Future acknowledgements
c8d6fa77
FL
1366should not be delayed.
1367
4619b59c 1368When a bug is resolved, please close the thread by sending an email to
8fed831e 1369@email{@var{ISSUE_NUMBER}-done@@debbugs.gnu.org}.
4619b59c 1370
9fc8ae41
SM
1371@node Configuring Git
1372@subsection Configuring Git
1373@cindex git configuration
1374@cindex @code{git format-patch}
1375@cindex @code{git send-email}
1376
1377If you have not done so already, you may wish to set a name and email
1378that will be associated with your commits (@pxref{telling git your name,
1379, Telling Git your name, git, Git User Manual}). If you wish to use a
5fafb6e7 1380different name or email just for commits in this repository, you can
9fc8ae41
SM
1381use @command{git config --local}, or edit @file{.git/config} in the
1382repository instead of @file{~/.gitconfig}.
1383
1384We provide some default settings in @file{etc/git/gitconfig} which
1385modify how patches are generated, making them easier to read and apply.
1386These settings can be applied by manually copying them to
1387@file{.git/config} in your checkout, or by telling Git to include the
1388whole file:
1389
1390@example
1391git config --local include.path ../etc/git/gitconfig
1392@end example
1393
1394From then on, any changes to @file{etc/git/gitconfig} would
1395automatically take effect.
1396
1397Since the first patch in a series must be sent separately
1398(@pxref{Sending a Patch Series}), it can also be helpful to tell
1399@command{git format-patch} to handle the e-mail threading instead of
1400@command{git send-email}:
1401
1402@example
1403git config --local format.thread shallow
1404git config --local sendemail.thread no
1405@end example
1406
807bfe55 1407@node Sending a Patch Series
1408@subsection Sending a Patch Series
5a183a1e
JN
1409@cindex patch series
1410@cindex @code{git send-email}
8fed831e 1411@cindex @code{git format-patch}
1412
1413@unnumberedsubsubsec Single Patches
1414@anchor{Single Patches}
1415The @command{git send-email} command is the best way to send both single
1416patches and patch series (@pxref{Multiple Patches}) to the Guix mailing
1417list. Sending patches as email attachments may make them difficult to
1418review in some mail clients, and @command{git diff} does not store commit
1419metadata.
1420
1421@quotation Note
1422The @command{git send-email} command is provided by the @code{send-email}
1423output of the @code{git} package, i.e. @code{git:send-email}.
1424@end quotation
1425
1426The following command will create a patch email from the latest commit,
1427open it in your @var{EDITOR} or @var{VISUAL} for editing, and send it to
1428the Guix mailing list to be reviewed and merged:
1429
1430@example
1431$ git send-email -1 -a --base=auto --to=guix-patches@@gnu.org
1432@end example
1433
1434@quotation Tip
1435To add a prefix to the subject of your patch, you may use the
1436@option{--subject-prefix} option. The Guix project uses this to
1437specify that the patch is intended for a branch or repository
1438other than the @code{master} branch of
1439@url{https://git.savannah.gnu.org/cgit/guix.git}.
1440
1441@example
1442git send-email -1 -a --base=auto \
1443 --subject-prefix='PATCH core-updates' \
1444 --to=guix-patches@@gnu.org
1445@end example
1446@end quotation
5a183a1e 1447
8fed831e 1448The patch email contains a three-dash separator line after the commit
1449message. You may ``annotate'' the patch with explanatory text by adding
1450it under this line. If you do not wish to annotate the email, you may
1451drop the @option{-a} flag (which is short for @option{--annotate}).
1452
1453The @option{--base=auto} flag automatically adds a note at the bottom
1454of the patch of the commit it was based on, making it easier for
1455maintainers to rebase and merge your patch.
1456
1457If you need to send a revised patch, don't resend it like this or send
1458a ``fix'' patch to be applied on top of the last one; instead, use
1459@command{git commit -a} or @url{https://git-rebase.io, @command{git rebase}}
1460to modify the commit, and use the @email{@var{ISSUE_NUMBER}@@debbugs.gnu.org}
1461address and the @option{-v} flag with @command{git send-email}.
1462
1463@example
1464$ git commit -a
1465$ git send-email -1 -a --base=auto -v @var{REVISION} \
1466 --to=@var{ISSUE_NUMBER}@@debbugs.gnu.org
1467@end example
1468
1469You can find out @var{ISSUE_NUMBER} either by searching on the mumi
1470interface at @url{issues.guix.gnu.org} for the name of your patch or
1471reading the acknowledgement email sent automatically by Debbugs in
1472reply to incoming bugs and patches, which contains the bug number.
1473
1474@unnumberedsubsubsec Notifying Teams
1475@anchor{Notifying Teams}
1476@cindex teams
1477The @file{etc/teams.scm} script may be used to notify all those who
1478may be interested in your patch of its existence (@pxref{Teams}).
1479Use @command{etc/teams.scm list-teams} to display all the teams,
1480decide which team(s) your patch relates to, and use
1481@command{etc/teams.scm cc} to output various @command{git send-email}
1482flags which will notify the appropriate team members, or use
1483@command{etc/teams.scm cc-members} to detect the appropriate teams
1484automatically.
1485
1486@unnumberedsubsubsec Multiple Patches
1487@anchor{Multiple Patches}
1488@cindex cover letter
1489While @command{git send-email} alone will suffice for a single
1490patch, an unfortunate flaw in Debbugs means you need to be more
1491careful when sending multiple patches: if you send them all to the
1492@email{guix-patches@@gnu.org} address, a new issue will be created
1493for each patch!
1494
1495When sending a series of patches, it's best to send a Git ``cover
1496letter'' first, to give reviewers an overview of the patch series.
1497We can create a directory called @file{outgoing} containing both
1498our patch series and a cover letter called @file{0000-cover-letter.patch}
1499with @command{git format-patch}.
1500
1501@example
1502$ git format-patch -@var{NUMBER_COMMITS} -o outgoing \
1503 --cover-letter --base=auto
1504@end example
1505
1506We can now send @emph{just} the cover letter to the
1507@email{guix-patches@@gnu.org} address, which will create an issue
1508that we can send the rest of the patches to.
1509
1510@example
1511$ git send-email outgoing/0000-cover-letter.patch -a \
1512 --to=guix-patches@@debbugs.gnu.org \
1513 $(etc/teams.scm cc-members ...)
1514$ rm outgoing/0000-cover-letter.patch # we don't want to resend it!
1515@end example
1516
1517Ensure you edit the email to add an appropriate subject line and
1518blurb before sending it. Note the automatically generated shortlog
1519and diffstat below the blurb.
1520
1521Once the Debbugs mailer has replied to your cover letter email, you
1522can send the actual patches to the newly-created issue address.
1523
1524@example
1525$ git send-email outgoing/*.patch \
1526 --to=@var{ISSUE_NUMBER}@@debbugs.gnu.org \
1527 $(etc/teams.scm cc-members ...)
1528$ rm -rf outgoing # we don't need these anymore
1529@end example
1530
1531Thankfully, this @command{git format-patch} dance is not necessary
1532to send an amended patch series, since an issue already exists for
1533the patchset.
1534
1535@example
1536$ git send-email -@var{NUMBER_COMMITS} \
1537 -v@var{REVISION} --base=auto \
1538 --to @var{ISSUE_NUMBER}@@debbugs.gnu.org
1539@end example
a7bde77d 1540
8fed831e 1541If need be, you may use @option{--cover-letter -a} to send another cover
1542letter, e.g. for explaining what's changed since the last revision, and
1543these changes are necessary.
2a663045 1544
807bfe55 1545@node Teams
1546@subsection Teams
2a663045
MO
1547@cindex teams
1548
1549There are several teams mentoring different parts of the Guix source
1550code. To list all those teams, you can run from a Guix checkout:
1551
1552@example
1553$ ./etc/teams.scm list-teams
1554id: mentors
1555name: Mentors
1556description: A group of mentors who chaperone contributions by newcomers.
1557members:
1558+ Christopher Baines <mail@@cbaines.net>
1559+ Ricardo Wurmus <rekado@@elephly.net>
1560+ Mathieu Othacehe <othacehe@@gnu.org>
1561+ jgart <jgart@@dismail.de>
1562+ Ludovic Courtès <ludo@@gnu.org>
1563@dots{}
1564@end example
1565
1566You can run the following command to have the @code{Mentors} team put in
1567CC of a patch series:
1568
1569@example
8fed831e 1570$ git send-email --to @var{ISSUE_NUMBER}@@debbugs.gnu.org $(./etc/teams.scm cc mentors) *.patch
2a663045
MO
1571@end example
1572
1573The appropriate team or teams can also be inferred from the modified
1574files. For instance, if you want to send the two latest commits of the
1575current Git repository to review, you can run:
1576
1577@example
1578$ guix shell -D guix
8fed831e 1579[env]$ git send-email --to @var{ISSUE_NUMBER}@@debbugs.gnu.org $(./etc/teams.scm cc-members HEAD~2 HEAD) *.patch
2a663045
MO
1580@end example
1581
a7bde77d
LC
1582@node Tracking Bugs and Patches
1583@section Tracking Bugs and Patches
1584
3c86372e
CM
1585This section describes how the Guix project tracks its bug reports and
1586patch submissions.
1587
1588@menu
1589* The Issue Tracker:: The official bug and patch tracker.
1590* Debbugs User Interfaces:: Ways to interact with Debbugs.
1591* Debbugs Usertags:: Tag reports with custom labels.
1592@end menu
1593
1594@node The Issue Tracker
1595@subsection The Issue Tracker
1596
a7bde77d
LC
1597@cindex bug reports, tracking
1598@cindex patch submissions, tracking
1599@cindex issue tracking
1600@cindex Debbugs, issue tracking system
1601Bug reports and patch submissions are currently tracked using the
1602Debbugs instance at @uref{https://bugs.gnu.org}. Bug reports are filed
1603against the @code{guix} ``package'' (in Debbugs parlance), by sending
1604email to @email{bug-guix@@gnu.org}, while patch submissions are filed
1605against the @code{guix-patches} package by sending email to
1606@email{guix-patches@@gnu.org} (@pxref{Submitting Patches}).
1607
3c86372e
CM
1608@node Debbugs User Interfaces
1609@subsection Debbugs User Interfaces
1610
a7bde77d
LC
1611A web interface (actually @emph{two} web interfaces!) are available to
1612browse issues:
1613
1614@itemize
1615@item
cdea5265
LC
1616@url{https://issues.guix.gnu.org} provides a pleasant
1617interface@footnote{The web interface at
1618@url{https://issues.guix.gnu.org} is powered by Mumi, a nice piece of
1619software written in Guile, and you can help! See
1620@url{https://git.elephly.net/gitweb.cgi?p=software/mumi.git}.} to browse
1621bug reports and patches, and to participate in discussions;
1622@item
a7bde77d
LC
1623@url{https://bugs.gnu.org/guix} lists bug reports;
1624@item
1625@url{https://bugs.gnu.org/guix-patches} lists patch submissions.
1626@end itemize
1627
cdea5265
LC
1628To view discussions related to issue number @var{n}, go to
1629@indicateurl{https://issues.guix.gnu.org/@var{n}} or
a7bde77d
LC
1630@indicateurl{https://bugs.gnu.org/@var{n}}.
1631
1632If you use Emacs, you may find it more convenient to interact with
1633issues using @file{debbugs.el}, which you can install with:
1634
1635@example
1636guix install emacs-debbugs
1637@end example
1638
1639For example, to list all open issues on @code{guix-patches}, hit:
1640
1641@example
1642@kbd{C-u} @kbd{M-x} debbugs-gnu @kbd{RET} @kbd{RET} guix-patches @kbd{RET} n y
1643@end example
1644
1645@xref{Top,,, debbugs-ug, Debbugs User Guide}, for more information on
1646this nifty tool!
2d315cd4 1647
3c86372e
CM
1648@node Debbugs Usertags
1649@subsection Debbugs Usertags
1650
1651@cindex usertags, for debbugs
1652@cindex Debbugs usertags
1653Debbugs provides a feature called @dfn{usertags} that allows any user to
1654tag any bug with an arbitrary label. Bugs can be searched by usertag,
1655so this is a handy way to organize bugs@footnote{The list of usertags is
1656public information, and anyone can modify any user's list of usertags,
1657so keep that in mind if you choose to use this feature.}.
1658
1659For example, to view all the bug reports (or patches, in the case of
1660@code{guix-patches}) tagged with the usertag @code{powerpc64le-linux}
586136d1
CM
1661for the user @code{guix}, open a URL like the following in a web
1662browser:
1663@url{https://debbugs.gnu.org/cgi-bin/pkgreport.cgi?tag=powerpc64le-linux;users=guix}.
3c86372e
CM
1664
1665For more information on how to use usertags, please refer to the
1666documentation for Debbugs or the documentation for whatever tool you use
1667to interact with Debbugs.
1668
1669In Guix, we are experimenting with usertags to keep track of
1670architecture-specific issues. To facilitate collaboration, all our
586136d1
CM
1671usertags are associated with the single user @code{guix}. The following
1672usertags currently exist for that user:
3c86372e
CM
1673
1674@table @code
1675
1676@item powerpc64le-linux
1677The purpose of this usertag is to make it easy to find the issues that
1678matter most for the @code{powerpc64le-linux} system type. Please assign
1679this usertag to bugs or patches that affect @code{powerpc64le-linux} but
1680not other system types. In addition, you may use it to identify issues
1681that for some reason are particularly important for the
1682@code{powerpc64le-linux} system type, even if the issue affects other
1683system types, too.
1684
1685@item reproducibility
1686For issues related to reproducibility. For example, it would be
1687appropriate to assign this usertag to a bug report for a package that
1688fails to build reproducibly.
1689
1690@end table
1691
1692If you're a committer and you want to add a usertag, just start using it
586136d1
CM
1693with the @code{guix} user. If the usertag proves useful to you,
1694consider updating this section of the manual so that others will know
1695what your usertag means.
3c86372e 1696
2d315cd4
LC
1697@node Commit Access
1698@section Commit Access
1699
1700@cindex commit access, for developers
aaf4a009
LC
1701Everyone can contribute to Guix without having commit access
1702(@pxref{Submitting Patches}). However, for frequent contributors,
c1043fd6
MC
1703having write access to the repository can be convenient. As a rule of
1704thumb, a contributor should have accumulated fifty (50) reviewed commits
1705to be considered as a committer and have sustained their activity in the
1706project for at least 6 months. This ensures enough interactions with
1707the contributor, which is essential for mentoring and assessing whether
1708they are ready to become a committer. Commit access should not be
1709thought of as a ``badge of honor'' but rather as a responsibility a
1710contributor is willing to take to help the project.
aaf4a009
LC
1711
1712The following sections explain how to get commit access, how to be ready
1713to push commits, and the policies and community expectations for commits
1714pushed upstream.
1715
1716@subsection Applying for Commit Access
1717
1718When you deem it necessary, consider applying for commit
ef09cb86
LC
1719access by following these steps:
1720
1721@enumerate
1722@item
1723Find three committers who would vouch for you. You can view the list of
1724committers at
1725@url{https://savannah.gnu.org/project/memberlist.php?group=guix}. Each
1726of them should email a statement to @email{guix-maintainers@@gnu.org} (a
1727private alias for the collective of maintainers), signed with their
1728OpenPGP key.
1729
1730Committers are expected to have had some interactions with you as a
1731contributor and to be able to judge whether you are sufficiently
1732familiar with the project's practices. It is @emph{not} a judgment on
1733the value of your work, so a refusal should rather be interpreted as
1734``let's try again later''.
1735
1736@item
1737Send @email{guix-maintainers@@gnu.org} a message stating your intent,
1738listing the three committers who support your application, signed with
1739the OpenPGP key you will use to sign commits, and giving its fingerprint
1740(see below). See @uref{https://emailselfdefense.fsf.org/en/}, for an
1741introduction to public-key cryptography with GnuPG.
1742
4a84deda
LC
1743@c See <https://sha-mbles.github.io/>.
1744Set up GnuPG such that it never uses the SHA1 hash algorithm for digital
1745signatures, which is known to be unsafe since 2019, for instance by
1746adding the following line to @file{~/.gnupg/gpg.conf} (@pxref{GPG
1747Esoteric Options,,, gnupg, The GNU Privacy Guard Manual}):
1748
1749@example
1750digest-algo sha512
1751@end example
1752
ef09cb86
LC
1753@item
1754Maintainers ultimately decide whether to grant you commit access,
1755usually following your referrals' recommendation.
1756
1757@item
84133320 1758@cindex OpenPGP, signed commits
ef09cb86
LC
1759If and once you've been given access, please send a message to
1760@email{guix-devel@@gnu.org} to say so, again signed with the OpenPGP key
1761you will use to sign commits (do that before pushing your first commit).
1762That way, everyone can notice and ensure you control that OpenPGP key.
1763
84133320
LC
1764@quotation Important
1765Before you can push for the first time, maintainers must:
1766
1767@enumerate
1768@item
1769add your OpenPGP key to the @code{keyring} branch;
1770@item
1771add your OpenPGP fingerprint to the @file{.guix-authorizations} file of
1772the branch(es) you will commit to.
1773@end enumerate
1774@end quotation
ef09cb86
LC
1775
1776@item
1777Make sure to read the rest of this section and... profit!
1778@end enumerate
1779
1780@quotation Note
1781Maintainers are happy to give commit access to people who have been
1782contributing for some time and have a track record---don't be shy and
1783don't underestimate your work!
1784
1785However, note that the project is working towards a more automated patch
1786review and merging system, which, as a consequence, may lead us to have
1787fewer people with commit access to the main repository. Stay tuned!
1788@end quotation
1789
2d315cd4
LC
1790All commits that are pushed to the central repository on Savannah must
1791be signed with an OpenPGP key, and the public key should be uploaded to
1792your user account on Savannah and to public key servers, such as
1793@code{keys.openpgp.org}. To configure Git to automatically sign
1794commits, run:
1795
1796@example
1797git config commit.gpgsign true
b5b9266e
LC
1798
1799# Substitute the fingerprint of your public PGP key.
2d315cd4
LC
1800git config user.signingkey CABBA6EA1DC0FF33
1801@end example
1802
a278f632
AT
1803To check that commits are signed with correct key, use:
1804
1805@example
1806make authenticate
1807@end example
1808
1809You can prevent yourself from accidentally pushing unsigned or signed
1810with the wrong key commits to Savannah by using the pre-push Git hook
1811located at @file{etc/git/pre-push}:
2d315cd4
LC
1812
1813@example
1814cp etc/git/pre-push .git/hooks/pre-push
1815@end example
1816
a278f632
AT
1817It additionally calls @code{make check-channel-news} to be sure
1818@file{news.scm} file is correct.
1819
aaf4a009
LC
1820@subsection Commit Policy
1821
1822If you get commit access, please make sure to follow
1823the policy below (discussions of the policy can take place on
1824@email{guix-devel@@gnu.org}).
1825
1826Non-trivial patches should always be posted to
1827@email{guix-patches@@gnu.org} (trivial patches include fixing typos,
1828etc.). This mailing list fills the patch-tracking database
1829(@pxref{Tracking Bugs and Patches}).
1830
1831For patches that just add a new package, and a simple one, it's OK to
1832commit, if you're confident (which means you successfully built it in a
1833chroot setup, and have done a reasonable copyright and license
1834auditing). Likewise for package upgrades, except upgrades that trigger
1835a lot of rebuilds (for example, upgrading GnuTLS or GLib). We have a
1836mailing list for commit notifications (@email{guix-commits@@gnu.org}),
1837so people can notice. Before pushing your changes, make sure to run
1838@code{git pull --rebase}.
1839
2d315cd4
LC
1840When pushing a commit on behalf of somebody else, please add a
1841@code{Signed-off-by} line at the end of the commit log message---e.g.,
1842with @command{git am --signoff}. This improves tracking of who did
1843what.
1844
1ad5209d
LC
1845When adding channel news entries (@pxref{Channels, Writing Channel
1846News}), make sure they are well-formed by running the following command
1847right before pushing:
1848
1849@example
1850make check-channel-news
1851@end example
1852
2d315cd4
LC
1853For anything else, please post to @email{guix-patches@@gnu.org} and
1854leave time for a review, without committing anything (@pxref{Submitting
1855Patches}). If you didn’t receive any reply after two weeks, and if
1856you're confident, it's OK to commit.
1857
1858That last part is subject to being adjusted, allowing individuals to commit
1859directly on non-controversial changes on parts they’re familiar with.
98ebcf1c 1860
d4751342
LC
1861@subsection Addressing Issues
1862
1863Peer review (@pxref{Submitting Patches}) and tools such as
1864@command{guix lint} (@pxref{Invoking guix lint}) and the test suite
1865(@pxref{Running the Test Suite}) should catch issues before they are
1866pushed. Yet, commits that ``break'' functionality might occasionally
1867go through. When that happens, there are two priorities: mitigating
1868the impact, and understanding what happened to reduce the chance of
1869similar incidents in the future. The responsibility for both these
1870things primarily lies with those involved, but like everything this is
1871a group effort.
1872
1873Some issues can directly affect all users---for instance because they
1874make @command{guix pull} fail or break core functionality, because they
1875break major packages (at build time or run time), or because they
1876introduce known security vulnerabilities.
1877
1878@cindex reverting commits
1879The people involved in authoring, reviewing, and pushing such
1880commit(s) should be at the forefront to mitigate their impact in a
1881timely fashion: by pushing a followup commit to fix it (if possible),
1882or by reverting it to leave time to come up with a proper fix, and by
1883communicating with other developers about the problem.
1884
1885If these persons are unavailable to address the issue in time, other
1886committers are entitled to revert the commit(s), explaining in the
1887commit log and on the mailing list what the problem was, with the goal
1888of leaving time to the original committer, reviewer(s), and author(s)
1889to propose a way forward.
1890
1891Once the problem has been dealt with, it is the responsibility of
1892those involved to make sure the situation is understood. If you are
1893working to understand what happened, focus on gathering information
1894and avoid assigning any blame. Do ask those involved to describe what
1895happened, do not ask them to explain the situation---this would
1896implicitly blame them, which is unhelpful. Accountability comes from
1897a consensus about the problem, learning from it and improving
1898processes so that it's less likely to reoccur.
1899
aaf4a009
LC
1900@subsection Commit Revocation
1901
9ade2b72
LF
1902In order to reduce the possibility of mistakes, committers will have
1903their Savannah account removed from the Guix Savannah project and their
1904key removed from @file{.guix-authorizations} after 12 months of
1905inactivity; they can ask to regain commit access by emailing the
1906maintainers, without going through the vouching process.
1907
d3d6d1c6
LC
1908Maintainers@footnote{See @uref{https://guix.gnu.org/en/about} for the
1909current list of maintainers. You can email them privately at
1910@email{guix-maintainers@@gnu.org}.} may also revoke an individual's
1911commit rights, as a last resort, if cooperation with the rest of the
1912community has caused too much friction---even within the bounds of the
1913project's code of conduct (@pxref{Contributing}). They would only do so
1914after public or private discussion with the individual and a clear
1915notice. Examples of behavior that hinders cooperation and could lead to
1916such a decision include:
1917
1918@itemize
1919@item repeated violation of the commit policy stated above;
1920@item repeated failure to take peer criticism into account;
1921@item breaching trust through a series of grave incidents.
1922@end itemize
1923
1924When maintainers resort to such a decision, they notify developers on
1925@email{guix-devel@@gnu.org}; inquiries may be sent to
1926@email{guix-maintainers@@gnu.org}. Depending on the situation, the
1927individual may still be welcome to contribute.
1928
aaf4a009
LC
1929@subsection Helping Out
1930
98ebcf1c
LC
1931One last thing: the project keeps moving forward because committers not
1932only push their own awesome changes, but also offer some of their time
1933@emph{reviewing} and pushing other people's changes. As a committer,
1934you're welcome to use your expertise and commit rights to help other
1935contributors, too!
5800d2aa
MC
1936
1937@node Updating the Guix Package
1938@section Updating the Guix Package
1939
1940@cindex update-guix-package, updating the guix package
1941It is sometimes desirable to update the @code{guix} package itself (the
1942package defined in @code{(gnu packages package-management)}), for
1943example to make new daemon features available for use by the
1944@code{guix-service-type} service type. In order to simplify this task,
1945the following command can be used:
1946
1947@example
1948make update-guix-package
1949@end example
1950
1951The @code{update-guix-package} make target will use the last known
1952@emph{commit} corresponding to @code{HEAD} in your Guix checkout,
1953compute the hash of the Guix sources corresponding to that commit and
1954update the @code{commit}, @code{revision} and hash of the @code{guix}
1955package definition.
1956
1957To validate that the updated @code{guix} package hashes are correct and
1958that it can be built successfully, the following command can be run from
1959the directory of your Guix checkout:
1960
1961@example
1962./pre-inst-env guix build guix
1963@end example
1964
1965To guard against accidentally updating the @code{guix} package to a
1966commit that others can't refer to, a check is made that the commit used
1967has already been pushed to the Savannah-hosted Guix git repository.
1968
1969This check can be disabled, @emph{at your own peril}, by setting the
3de898b4
MC
1970@code{GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT} environment variable. When
1971this variable is set, the updated package source is also added to the
1972store. This is used as part of the release process of Guix.
1897a6ef 1973
e103d614 1974@cindex documentation
1975@node Writing Documentation
1976@section Writing Documentation
1977
1978Guix is documented using the Texinfo system. If you are not yet
1979familiar with it, we accept contributions for documentation in most
1980formats. That includes plain text, Markdown, Org, etc.
1981
1982Documentation contributions can be sent to
1983@email{guix-patches@@gnu.org}. Prepend @samp{[DOCUMENTATION]} to the
1984subject.
1985
1986When you need to make more than a simple addition to the documentation,
1987we prefer that you send a proper patch as opposed to sending an email
1988as described above. @xref{Submitting Patches} for more information on
1989how to send your patches.
1990
1991To modify the documentation, you need to edit @file{doc/guix.texi} and
1992@file{doc/contributing.texi} (which contains this documentation
1993section), or @file{doc/guix-cookbook.texi} for the cookbook. If
1994you compiled the Guix repository before, you will have
1995many more @file{.texi} files that are translations of these
1996documents. Do not modify them, the translation is managed through
1997@uref{https://translate.fedoraproject.org/projects/guix, Weblate}.
1998@xref{Translating Guix} for more information.
1999
2000To render documentation, you must first make sure that you ran
2001@command{./configure} in your source tree (@pxref{Running Guix Before
2002It Is Installed}). After that you can run one of the following
2003commands:
2004
2005@itemize
2006@item @samp{make doc/guix.info} to compile the Info manual.
2007 You can check it with @command{info doc/guix.info}.
2008@item @samp{make doc/guix.html} to compile the HTML version.
2009 You can point your browser to the relevant file in the
2010 @file{doc/guix.html} directory.
2011@item @samp{make doc/guix-cookbook.info} for the cookbook Info manual.
2012@item @samp{make doc/guix-cookbook.html} for the cookbook HTML version.
2013@end itemize
2014
1897a6ef
JL
2015@cindex translation
2016@cindex l10n
2017@cindex i18n
2018@cindex native language support
2019@node Translating Guix
2020@section Translating Guix
2021
2022Writing code and packages is not the only way to provide a meaningful
2023contribution to Guix. Translating to a language you speak is another
2024example of a valuable contribution you can make. This section is designed
2025to describe the translation process. It gives you advice on how you can
2026get involved, what can be translated, what mistakes you should avoid and
2027what we can do to help you!
2028
2029Guix is a big project that has multiple components that can be translated.
2030We coordinate the translation effort on a
2031@uref{https://translate.fedoraproject.org/projects/guix/,Weblate instance}
2032hosted by our friends at Fedora. You will need an account to submit
2033translations.
2034
2035Some of the software packaged in Guix also contain translations. We do not
2036host a translation platform for them. If you want to translate a package
ef7275cd 2037provided by Guix, you should contact their developers or find the information
1897a6ef
JL
2038on their website. As an example, you can find the homepage of the
2039@code{hello} package by typing @code{guix show hello}. On the ``homepage''
2040line, you will see @url{https://www.gnu.org/software/hello/} as the homepage.
2041
2042Many GNU and non-GNU packages can be translated on the
2043@uref{https://translationproject.org,Translation Project}. Some projects
2044with multiple components have their own platform. For instance, GNOME has
2045its own platform, @uref{https://l10n.gnome.org/,Damned Lies}.
2046
2047Guix has five components hosted on Weblate.
2048
2049@itemize
2050@item @code{guix} contains all the strings from the Guix software (the
2051 guided system installer, the package manager, etc), excluding packages.
2052@item @code{packages} contains the synopsis (single-sentence description
2053 of a package) and description (longer description) of packages in Guix.
2054@item @code{website} contains the official Guix website, except for
2055 blog posts and multimedia content.
2056@item @code{documentation-manual} corresponds to this manual.
2057@item @code{documentation-cookbook} is the component for the cookbook.
2058@end itemize
2059
2060@subsubheading General Directions
2061
2062Once you get an account, you should be able to select a component from
2063@uref{https://translate.fedoraproject.org/projects/guix/,the guix project},
2064and select a language. If your language does not appear in the list, go
2065to the bottom and click on the ``Start new translation'' button. Select
2066the language you want to translate to from the list, to start your new
2067translation.
2068
2069Like lots of other free software packages, Guix uses
2070@uref{https://www.gnu.org/software/gettext,GNU Gettext} for its translations,
2071with which translatable strings are extracted from the source code to so-called
2072PO files.
2073
2074Even though PO files are text files, changes should not be made with a text
2075editor but with PO editing software. Weblate integrates PO editing
2076functionality. Alternatively, translators can use any of various
2077free-software tools for filling in translations, of which
2078@uref{https://poedit.net/,Poedit} is one example, and (after logging in)
2079@uref{https://docs.weblate.org/en/latest/user/files.html,upload} the changed
2080file. There is also a special
2081@uref{https://www.emacswiki.org/emacs/PoMode,PO editing mode} for users of GNU
2082Emacs. Over time translators find out what software they are happy with and
2083what features they need.
2084
2085On Weblate, you will find various links to the editor, that will show various
2086subsets (or all) of the strings. Have a look around and at the
2087@uref{https://docs.weblate.org/en/latest/,documentation} to familiarize
2088yourself with the platform.
2089
2090@subsubheading Translation Components
2091
2092In this section, we provide more detailed guidance on the translation
2093process, as well as details on what you should or should not do. When in
2094doubt, please contact us, we will be happy to help!
2095
2096@table @asis
2097@item guix
2098Guix is written in the Guile programming language, and some strings contain
d127fdd0 2099special formatting that is interpreted by Guile. These special formatting
1897a6ef
JL
2100should be highlighted by Weblate. They start with @code{~} followed by one
2101or more characters.
2102
d127fdd0 2103When printing the string, Guile replaces the special formatting symbols with
1897a6ef
JL
2104actual values. For instance, the string @samp{ambiguous package specification
2105`~a'} would be substituted to contain said package specification instead of
d127fdd0 2106@code{~a}. To properly translate this string, you must keep the formatting
1897a6ef
JL
2107code in your translation, although you can place it where it makes sense in
2108your language. For instance, the French translation says @samp{spécification
2109du paquet « ~a » ambiguë} because the adjective needs to be placed in the
2110end of the sentence.
2111
d127fdd0 2112If there are multiple formatting symbols, make sure to respect the order.
1897a6ef
JL
2113Guile does not know in which order you intended the string to be read, so it
2114will substitute the symbols in the same order as the English sentence.
2115
2116As an example, you cannot translate @samp{package '~a' has been superseded by
2117'~a'} by @samp{'~a' superseeds package '~a'}, because the meaning would be
ef7275cd 2118reversed. If @var{foo} is superseded by @var{bar}, the translation would read
1897a6ef 2119@samp{'foo' superseeds package 'bar'}. To work around this problem, it
d127fdd0 2120is possible to use more advanced formatting to select a given piece of data,
1897a6ef 2121instead of following the default English order. @xref{Formatted Output,,,
d127fdd0 2122guile, GNU Guile Reference Manual}, for more information on formatting in Guile.
1897a6ef
JL
2123
2124@item packages
2125
2126Package descriptions occasionally contain Texinfo markup (@pxref{Synopses
2127and Descriptions}). Texinfo markup looks like @samp{@@code@{rm -rf@}},
2128@samp{@@emph@{important@}}, etc. When translating, please leave markup as is.
2129
2130The characters after ``@@'' form the name of the markup, and the text between
2131``@{'' and ``@}'' is its content. In general, you should not translate the
2132content of markup like @code{@@code}, as it contains literal code that do not
d127fdd0 2133change with language. You can translate the content of formatting markup such
1897a6ef
JL
2134as @code{@@emph}, @code{@@i}, @code{@@itemize}, @code{@@item}. However, do
2135not translate the name of the markup, or it will not be recognized. Do
2136not translate the word after @code{@@end}, it is the name of the markup that
2137is closed at this position (e.g.@: @code{@@itemize ... @@end itemize}).
2138
2139@item documentation-manual and documentation-cookbook
2140
2141The first step to ensure a successful translation of the manual is to find
2142and translate the following strings @emph{first}:
2143
2144@itemize
2145@item @code{version.texi}: Translate this string as @code{version-xx.texi},
2146 where @code{xx} is your language code (the one shown in the URL on
2147 weblate).
2148@item @code{contributing.texi}: Translate this string as
2149 @code{contributing.xx.texi}, where @code{xx} is the same language code.
2150@item @code{Top}: Do not translate this string, it is important for Texinfo.
2151 If you translate it, the document will be empty (missing a Top node).
2152 Please look for it, and register @code{Top} as its translation.
2153@end itemize
2154
2155Translating these strings first ensure we can include your translation in
2156the guix repository without breaking the make process or the
2157@command{guix pull} machinery.
2158
2159The manual and the cookbook both use Texinfo. As for @code{packages}, please
2160keep Texinfo markup as is. There are more possible markup types in the manual
2161than in the package descriptions. In general, do not translate the content
2162of @code{@@code}, @code{@@file}, @code{@@var}, @code{@@value}, etc. You
d127fdd0 2163should translate the content of formatting markup such as @code{@@emph},
1897a6ef
JL
2164@code{@@i}, etc.
2165
d127fdd0 2166The manual contains sections that can be referred to by name by @code{@@ref},
1897a6ef
JL
2167@code{@@xref} and @code{@@pxref}. We have a mechanism in place so you do
2168not have to translate their content. If you keep the English title, we will
2169automatically replace it with your translation of that title. This ensures
2170that Texinfo will always be able to find the node. If you decide to change
2171the translation of the title, the references will automatically be updated
2172and you will not have to update them all yourself.
2173
2174When translating references from the cookbook to the manual, you need to
2175replace the name of the manual and the name of the section. For instance,
2176to translate @code{@@pxref@{Defining Packages,,, guix, GNU Guix Reference
2177Manual@}}, you would replace @code{Defining Packages} with the title of that
2178section in the translated manual @emph{only} if that title is translated.
2179If the title is not translated in your language yet, do not translate it here,
2180or the link will be broken. Replace @code{guix} with @code{guix.xx} where
2181@code{xx} is your language code. @code{GNU Guix Reference Manual} is the
2182text of the link. You can translate it however you wish.
2183
2184@item website
2185
2186The website pages are written using SXML, an s-expression version of HTML,
2187the basic language of the web. We have a process to extract translatable
2188strings from the source, and replace complex s-expressions with a more familiar
2189XML markup, where each markup is numbered. Translators can arbitrarily change
2190the ordering, as in the following example.
2191
2192@example
2193#. TRANSLATORS: Defining Packages is a section name
2194#. in the English (en) manual.
2195#: apps/base/templates/about.scm:64
2196msgid "Packages are <1>defined<1.1>en</1.1><1.2>Defining-Packages.html</1.2></1> as native <2>Guile</2> modules."
2197msgstr "Pakete werden als reine <2>Guile</2>-Module <1>definiert<1.1>de</1.1><1.2>Pakete-definieren.html</1.2></1>."
2198@end example
2199
2200Note that you need to include the same markups. You cannot skip any.
2201@end table
2202
2203In case you make a mistake, the component might fail to build properly with your
2204language, or even make guix pull fail. To prevent that, we have a process
2205in place to check the content of the files before pushing to our repository.
2206We will not be able to update the translation for your language in Guix, so
2207we will notify you (through weblate and/or by email) so you get a chance to
2208fix the issue.
2209
2210@subsubheading Outside of Weblate
2211
2212Currently, some parts of Guix cannot be translated on Weblate, help wanted!
2213
2214@itemize
2215@item @command{guix pull} news can be translated in @file{news.scm}, but is not
2216 available from Weblate. If you want to provide a translation, you
2217 can prepare a patch as described above, or simply send us your
2218 translation with the name of the news entry you translated and your
2219 language. @xref{Writing Channel News}, for more information about
2220 channel news.
2221@item Guix blog posts cannot currently be translated.
2222@item The installer script (for foreign distributions) is entirely in English.
2223@item Some of the libraries Guix uses cannot be translated or are translated
2224 outside of the Guix project. Guile itself is not internationalized.
2225@item Other manuals linked from this manual or the cookbook might not be
2226 translated.
2227@end itemize
2228
6386c011
JL
2229@subsubheading Conditions for Inclusion
2230
2231There are no conditions for adding new translations of the @code{guix} and
2232@code{guix-packages} components, other than they need at least one translated
2233string. New languages will be added to Guix as soon as possible. The
2234files may be removed if they fall out of sync and have no more translated
2235strings.
2236
2237Given that the web site is dedicated to new users, we want its translation
2238to be as complete as possible before we include it in the language menu.
2239For a new language to be included, it needs to reach at least 80% completion.
2240When a language is included, it may be removed in the future if it stays
2241out of sync and falls below 60% completion.
2242
2243The manual and cookbook are automatically added in the default compilation
7649327d 2244target. Every time we synchronize translations, developers need to
6386c011
JL
2245recompile all the translated manuals and cookbooks. This is useless for what
2246is essentially the English manual or cookbook. Therefore, we will only
2247include a new language when it reaches 10% completion in the component.
2248When a language is included, it may be removed in the future if it stays
2249out of sync and falls below 5% completion.
2250
1897a6ef
JL
2251@subsubheading Translation Infrastructure
2252
2253Weblate is backed by a git repository from which it discovers new strings to
2254translate and pushes new and updated translations. Normally, it would be
2255enough to give it commit access to our repositories. However, we decided
2256to use a separate repository for two reasons. First, we would have to give
2257Weblate commit access and authorize its signing key, but we do not trust it
ef7275cd 2258in the same way we trust guix developers, especially since we do not manage
1897a6ef
JL
2259the instance ourselves. Second, if translators mess something up, it can
2260break the generation of the website and/or guix pull for all our users,
2261independently of their language.
2262
2263For these reasons, we use a dedicated repository to host translations, and we
2264synchronize it with our guix and artworks repositories after checking no issue
2265was introduced in the translation.
2266
ef7275cd 2267Developers can download the latest PO files from weblate in the Guix
d127fdd0 2268repository by running the @command{make download-po} command. It will
1897a6ef
JL
2269automatically download the latest files from weblate, reformat them to a
2270canonical form, and check they do not contain issues. The manual needs to be
2271built again to check for additional issues that might crash Texinfo.
2272
ef7275cd 2273Before pushing new translation files, developers should add them to the
1897a6ef
JL
2274make machinery so the translations are actually available. The process
2275differs for the various components.
2276
2277@itemize
2278@item New po files for the @code{guix} and @code{packages} components must
2279 be registered by adding the new language to @file{po/guix/LINGUAS} or
2280 @file{po/packages/LINGUAS}.
2281@item New po files for the @code{documentation-manual} component must be
2282 registered by adding the file name to @code{DOC_PO_FILES} in
2283 @file{po/doc/local.mk}, the generated @file{%D%/guix.xx.texi} manual to
2284 @code{info_TEXINFOS} in @file{doc/local.mk} and the generated
2285 @file{%D%/guix.xx.texi} and @file{%D%/contributing.xx.texi} to
2286 @code{TRANSLATED_INFO} also in @file{doc/local.mk}.
2287@item New po files for the @code{documentation-cookbook} component must be
2288 registered by adding the file name to @code{DOC_COOKBOOK_PO_FILES} in
2289 @file{po/doc/local.mk}, the generated @file{%D%/guix-cookbook.xx.texi}
2290 manual to @code{info_TEXINFOS} in @file{doc/local.mk} and the generated
2291 @file{%D%/guix-cookbook.xx.texi} to @code{TRANSLATED_INFO} also
2292 in @file{doc/local.mk}.
2293@item New po files for the @code{website} component must be added to the
2294 @code{guix-artwork} repository, in @file{website/po/}.
2295 @file{website/po/LINGUAS} and @file{website/po/ietf-tags.scm} must
2296 be updated accordingly (see @file{website/i18n-howto.txt} for more
2297 information on the process).
2298@end itemize