gnu: Add python-outcome.
[jackhill/guix/guix.git] / doc / contributing.texi
1 @node Contributing
2 @chapter Contributing
3
4 This project is a cooperative effort, and we need your help to make it
5 grow! Please get in touch with us on @email{guix-devel@@gnu.org} and
6 @code{#guix} on the Freenode IRC network. We welcome ideas, bug
7 reports, patches, and anything that may be helpful to the project. We
8 particularly welcome help on packaging (@pxref{Packaging Guidelines}).
9
10 @cindex code of conduct, of contributors
11 @cindex contributor covenant
12 We want to provide a warm, friendly, and harassment-free environment, so
13 that anyone can contribute to the best of their abilities. To this end
14 our project uses a ``Contributor Covenant'', which was adapted from
15 @url{https://contributor-covenant.org/}. You can find a local version in
16 the @file{CODE-OF-CONDUCT} file in the source tree.
17
18 Contributors are not required to use their legal name in patches and
19 on-line communication; they can use any name or pseudonym of their
20 choice.
21
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.
26 * Packaging Guidelines:: Growing the distribution.
27 * Coding Style:: Hygiene of the contributor.
28 * Submitting Patches:: Share your work.
29 * Tracking Bugs and Patches:: Using Debbugs.
30 * Commit Access:: Pushing to the official repository.
31 @end menu
32
33 @node Building from Git
34 @section Building from Git
35
36 If you want to hack Guix itself, it is recommended to use the latest
37 version from the Git repository:
38
39 @example
40 git clone https://git.savannah.gnu.org/git/guix.git
41 @end example
42
43 @cindex authentication, of a Guix checkout
44 How do you ensure that you obtained a genuine copy of the repository?
45 To do that, run @command{guix git authenticate}, passing if the commit
46 and OpenPGP fingerprint of the @dfn{channel introduction}
47 (@pxref{Invoking guix git authenticate}):
48
49 @c The commit and fingerprint below must match those of the channel
50 @c introduction in '%default-channels'.
51 @example
52 guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
53 "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
54 @end example
55
56 @noindent
57 This command completes with exit code zero on success; it prints an
58 error message and exits with a non-zero code otherwise.
59
60 As you can see, there is a chicken-and-egg problem: you first need to
61 have Guix installed. Typically you would install Guix System
62 (@pxref{System Installation}) or Guix on top of another distro
63 (@pxref{Binary Installation}); in either case, you would verify the
64 OpenPGP signature on the installation medium. This ``bootstraps'' the
65 trust chain.
66
67 The easiest way to set up a development environment for Guix is, of
68 course, by using Guix! The following command starts a new shell where
69 all the dependencies and appropriate environment variables are set up to
70 hack on Guix:
71
72 @example
73 guix environment guix --pure
74 @end example
75
76 @xref{Invoking guix environment}, for more information on that command.
77
78 If you are unable to use Guix when building Guix from a checkout, the
79 following are the required packages in addition to those mentioned in the
80 installation instructions (@pxref{Requirements}).
81
82 @itemize
83 @item @url{https://gnu.org/software/autoconf/, GNU Autoconf};
84 @item @url{https://gnu.org/software/automake/, GNU Automake};
85 @item @url{https://gnu.org/software/gettext/, GNU Gettext};
86 @item @url{https://gnu.org/software/texinfo/, GNU Texinfo};
87 @item @url{https://www.graphviz.org/, Graphviz};
88 @item @url{https://www.gnu.org/software/help2man/, GNU Help2man (optional)}.
89 @end itemize
90
91 On Guix, extra dependencies can be added by instead running @command{guix
92 environment} with @option{--ad-hoc}:
93
94 @example
95 guix environment guix --pure --ad-hoc help2man git strace
96 @end example
97
98 Run @command{./bootstrap} to generate the build system infrastructure
99 using Autoconf and Automake. If you get an error like this one:
100
101 @example
102 configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
103 @end example
104
105 @noindent
106 it probably means that Autoconf couldn’t find @file{pkg.m4}, which is
107 provided by pkg-config. Make sure that @file{pkg.m4} is available. The
108 same holds for the @file{guile.m4} set of macros provided by Guile. For
109 instance, if you installed Automake in @file{/usr/local}, it wouldn’t
110 look for @file{.m4} files in @file{/usr/share}. In that case, you have
111 to invoke the following command:
112
113 @example
114 export ACLOCAL_PATH=/usr/share/aclocal
115 @end example
116
117 @xref{Macro Search Path,,, automake, The GNU Automake Manual}, for
118 more information.
119
120 Then, run @command{./configure} as usual. Make sure to pass
121 @code{--localstatedir=@var{directory}} where @var{directory} is the
122 @code{localstatedir} value used by your current installation (@pxref{The
123 Store}, for information about this). We recommend to use the value
124 @code{/var}.
125
126 Finally, you have to invoke @code{make check} to run tests
127 (@pxref{Running the Test Suite}). If anything
128 fails, take a look at installation instructions (@pxref{Installation})
129 or send a message to the @email{guix-devel@@gnu.org, mailing list}.
130
131 From there on, you can authenticate all the commits included in your
132 checkout by running:
133
134 @example
135 make authenticate
136 @end example
137
138 The first run takes a couple of minutes, but subsequent runs are faster.
139
140 @quotation Note
141 You are advised to run @command{make authenticate} after every
142 @command{git pull} invocation. This ensures you keep receiving valid
143 changes to the repository.
144 @end quotation
145
146
147 @node Running Guix Before It Is Installed
148 @section Running Guix Before It Is Installed
149
150 In order to keep a sane working environment, you will find it useful to
151 test the changes made in your local source tree checkout without
152 actually installing them. So that you can distinguish between your
153 ``end-user'' hat and your ``motley'' costume.
154
155 To that end, all the command-line tools can be used even if you have not
156 run @code{make install}. To do that, you first need to have an environment
157 with all the dependencies available (@pxref{Building from Git}), and then
158 simply prefix each command with
159 @command{./pre-inst-env} (the @file{pre-inst-env} script lives in the
160 top build tree of Guix; it is generated by @command{./configure}).
161 An example@footnote{The @option{-E} flag to
162 @command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set
163 such that @command{guix-daemon} and the tools it uses can find the Guile
164 modules they need.}:
165
166 @example
167 $ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
168 $ ./pre-inst-env guix build hello
169 @end example
170
171 @noindent
172 Similarly, an example for a Guile session using the Guix modules:
173
174 @example
175 $ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
176
177 ;;; ("x86_64-linux")
178 @end example
179
180 @noindent
181 @cindex REPL
182 @cindex read-eval-print loop
183 @dots{} and for a REPL (@pxref{Using Guile Interactively,,, guile, Guile
184 Reference Manual}):
185
186 @example
187 $ ./pre-inst-env guile
188 scheme@@(guile-user)> ,use(guix)
189 scheme@@(guile-user)> ,use(gnu)
190 scheme@@(guile-user)> (define snakes
191 (fold-packages
192 (lambda (package lst)
193 (if (string-prefix? "python"
194 (package-name package))
195 (cons package lst)
196 lst))
197 '()))
198 scheme@@(guile-user)> (length snakes)
199 $1 = 361
200 @end example
201
202 The @command{pre-inst-env} script sets up all the environment variables
203 necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}.
204
205 Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
206 local source tree; it simply updates the @file{~/.config/guix/current}
207 symlink (@pxref{Invoking guix pull}). Run @command{git pull} instead if
208 you want to upgrade your local source tree.
209
210
211 @node The Perfect Setup
212 @section The Perfect Setup
213
214 The Perfect Setup to hack on Guix is basically the perfect setup used
215 for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference
216 Manual}). First, you need more than an editor, you need
217 @url{https://www.gnu.org/software/emacs, Emacs}, empowered by the
218 wonderful @url{https://nongnu.org/geiser/, Geiser}. To set that up, run:
219
220 @example
221 guix package -i emacs guile emacs-geiser
222 @end example
223
224 Geiser allows for interactive and incremental development from within
225 Emacs: code compilation and evaluation from within buffers, access to
226 on-line documentation (docstrings), context-sensitive completion,
227 @kbd{M-.} to jump to an object definition, a REPL to try out your code,
228 and more (@pxref{Introduction,,, geiser, Geiser User Manual}). For
229 convenient Guix development, make sure to augment Guile’s load path so
230 that it finds source files from your checkout:
231
232 @lisp
233 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
234 (with-eval-after-load 'geiser-guile
235 (add-to-list 'geiser-guile-load-path "~/src/guix"))
236 @end lisp
237
238 To actually edit the code, Emacs already has a neat Scheme mode. But in
239 addition to that, you must not miss
240 @url{https://www.emacswiki.org/emacs/ParEdit, Paredit}. It provides
241 facilities to directly operate on the syntax tree, such as raising an
242 s-expression or wrapping it, swallowing or rejecting the following
243 s-expression, etc.
244
245 @cindex code snippets
246 @cindex templates
247 @cindex reducing boilerplate
248 We also provide templates for common git commit messages and package
249 definitions in the @file{etc/snippets} directory. These templates can
250 be used with @url{https://joaotavora.github.io/yasnippet/, YASnippet} to
251 expand short trigger strings to interactive text snippets. You may want
252 to add the snippets directory to the @var{yas-snippet-dirs} variable in
253 Emacs.
254
255 @lisp
256 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
257 (with-eval-after-load 'yasnippet
258 (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
259 @end lisp
260
261 The commit message snippets depend on @url{https://magit.vc/, Magit} to
262 display staged files. When editing a commit message type @code{add}
263 followed by @kbd{TAB} to insert a commit message template for adding a
264 package; type @code{update} followed by @kbd{TAB} to insert a template
265 for updating a package; type @code{https} followed by @kbd{TAB} to
266 insert a template for changing the home page URI of a package to HTTPS.
267
268 The main snippet for @code{scheme-mode} is triggered by typing
269 @code{package...} followed by @kbd{TAB}. This snippet also inserts the
270 trigger string @code{origin...}, which can be expanded further. The
271 @code{origin} snippet in turn may insert other trigger strings ending on
272 @code{...}, which also can be expanded further.
273
274 @cindex insert or update copyright
275 @cindex @code{M-x guix-copyright}
276 @cindex @code{M-x copyright-update}
277 We additionally provide insertion and automatic update of a copyright in
278 @file{etc/copyright.el}. You may want to set your full name, mail, and
279 load a file.
280
281 @lisp
282 (setq user-full-name "Alice Doe")
283 (setq user-mail-address "alice@@mail.org")
284 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
285 (load-file "~/src/guix/etc/copyright.el")
286 @end lisp
287
288 To insert a copyright at the current line invoke @code{M-x guix-copyright}.
289
290 To update a copyright you need to specify a @code{copyright-names-regexp}.
291
292 @lisp
293 (setq copyright-names-regexp
294 (format "%s <%s>" user-full-name user-mail-address))
295 @end lisp
296
297 You can check if your copyright is up to date by evaluating @code{M-x
298 copyright-update}. If you want to do it automatically after each buffer
299 save then add @code{(add-hook 'after-save-hook 'copyright-update)} in
300 Emacs.
301
302 @node Packaging Guidelines
303 @section Packaging Guidelines
304
305 @cindex packages, creating
306 The GNU distribution is nascent and may well lack some of your favorite
307 packages. This section describes how you can help make the distribution
308 grow.
309
310 Free software packages are usually distributed in the form of
311 @dfn{source code tarballs}---typically @file{tar.gz} files that contain
312 all the source files. Adding a package to the distribution means
313 essentially two things: adding a @dfn{recipe} that describes how to
314 build the package, including a list of other packages required to build
315 it, and adding @dfn{package metadata} along with that recipe, such as a
316 description and licensing information.
317
318 In Guix all this information is embodied in @dfn{package definitions}.
319 Package definitions provide a high-level view of the package. They are
320 written using the syntax of the Scheme programming language; in fact,
321 for each package we define a variable bound to the package definition,
322 and export that variable from a module (@pxref{Package Modules}).
323 However, in-depth Scheme knowledge is @emph{not} a prerequisite for
324 creating packages. For more information on package definitions,
325 @pxref{Defining Packages}.
326
327 Once a package definition is in place, stored in a file in the Guix
328 source tree, it can be tested using the @command{guix build} command
329 (@pxref{Invoking guix build}). For example, assuming the new package is
330 called @code{gnew}, you may run this command from the Guix build tree
331 (@pxref{Running Guix Before It Is Installed}):
332
333 @example
334 ./pre-inst-env guix build gnew --keep-failed
335 @end example
336
337 Using @code{--keep-failed} makes it easier to debug build failures since
338 it provides access to the failed build tree. Another useful
339 command-line option when debugging is @code{--log-file}, to access the
340 build log.
341
342 If the package is unknown to the @command{guix} command, it may be that
343 the source file contains a syntax error, or lacks a @code{define-public}
344 clause to export the package variable. To figure it out, you may load
345 the module from Guile to get more information about the actual error:
346
347 @example
348 ./pre-inst-env guile -c '(use-modules (gnu packages gnew))'
349 @end example
350
351 Once your package builds correctly, please send us a patch
352 (@pxref{Submitting Patches}). Well, if you need help, we will be happy to
353 help you too. Once the patch is committed in the Guix repository, the
354 new package automatically gets built on the supported platforms by
355 @url{@value{SUBSTITUTE-SERVER}, our continuous integration system}.
356
357 @cindex substituter
358 Users can obtain the new package definition simply by running
359 @command{guix pull} (@pxref{Invoking guix pull}). When
360 @code{@value{SUBSTITUTE-SERVER}} is done building the package, installing the
361 package automatically downloads binaries from there
362 (@pxref{Substitutes}). The only place where human intervention is
363 needed is to review and apply the patch.
364
365
366 @menu
367 * Software Freedom:: What may go into the distribution.
368 * Package Naming:: What's in a name?
369 * Version Numbers:: When the name is not enough.
370 * Synopses and Descriptions:: Helping users find the right package.
371 * Python Modules:: A touch of British comedy.
372 * Perl Modules:: Little pearls.
373 * Java Packages:: Coffee break.
374 * Rust Crates:: Beware of oxidation.
375 * Fonts:: Fond of fonts.
376 @end menu
377
378 @node Software Freedom
379 @subsection Software Freedom
380
381 @c Adapted from http://www.gnu.org/philosophy/philosophy.html.
382 @cindex free software
383 The GNU operating system has been developed so that users can have
384 freedom in their computing. GNU is @dfn{free software}, meaning that
385 users have the @url{https://www.gnu.org/philosophy/free-sw.html,four
386 essential freedoms}: to run the program, to study and change the program
387 in source code form, to redistribute exact copies, and to distribute
388 modified versions. Packages found in the GNU distribution provide only
389 software that conveys these four freedoms.
390
391 In addition, the GNU distribution follow the
392 @url{https://www.gnu.org/distros/free-system-distribution-guidelines.html,free
393 software distribution guidelines}. Among other things, these guidelines
394 reject non-free firmware, recommendations of non-free software, and
395 discuss ways to deal with trademarks and patents.
396
397 Some otherwise free upstream package sources contain a small and optional
398 subset that violates the above guidelines, for instance because this subset
399 is itself non-free code. When that happens, the offending items are removed
400 with appropriate patches or code snippets in the @code{origin} form of the
401 package (@pxref{Defining Packages}). This way, @code{guix
402 build --source} returns the ``freed'' source rather than the unmodified
403 upstream source.
404
405
406 @node Package Naming
407 @subsection Package Naming
408
409 @cindex package name
410 A package has actually two names associated with it:
411 First, there is the name of the @emph{Scheme variable}, the one following
412 @code{define-public}. By this name, the package can be made known in the
413 Scheme code, for instance as input to another package. Second, there is
414 the string in the @code{name} field of a package definition. This name
415 is used by package management commands such as
416 @command{guix package} and @command{guix build}.
417
418 Both are usually the same and correspond to the lowercase conversion of
419 the project name chosen upstream, with underscores replaced with
420 hyphens. For instance, GNUnet is available as @code{gnunet}, and
421 SDL_net as @code{sdl-net}.
422
423 We do not add @code{lib} prefixes for library packages, unless these are
424 already part of the official project name. But @pxref{Python
425 Modules} and @ref{Perl Modules} for special rules concerning modules for
426 the Python and Perl languages.
427
428 Font package names are handled differently, @pxref{Fonts}.
429
430
431 @node Version Numbers
432 @subsection Version Numbers
433
434 @cindex package version
435 We usually package only the latest version of a given free software
436 project. But sometimes, for instance for incompatible library versions,
437 two (or more) versions of the same package are needed. These require
438 different Scheme variable names. We use the name as defined
439 in @ref{Package Naming}
440 for the most recent version; previous versions use the same name, suffixed
441 by @code{-} and the smallest prefix of the version number that may
442 distinguish the two versions.
443
444 The name inside the package definition is the same for all versions of a
445 package and does not contain any version number.
446
447 For instance, the versions 2.24.20 and 3.9.12 of GTK+ may be packaged as follows:
448
449 @lisp
450 (define-public gtk+
451 (package
452 (name "gtk+")
453 (version "3.9.12")
454 ...))
455 (define-public gtk+-2
456 (package
457 (name "gtk+")
458 (version "2.24.20")
459 ...))
460 @end lisp
461 If we also wanted GTK+ 3.8.2, this would be packaged as
462 @lisp
463 (define-public gtk+-3.8
464 (package
465 (name "gtk+")
466 (version "3.8.2")
467 ...))
468 @end lisp
469
470 @c See <https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00425.html>,
471 @c for a discussion of what follows.
472 @cindex version number, for VCS snapshots
473 Occasionally, we package snapshots of upstream's version control system
474 (VCS) instead of formal releases. This should remain exceptional,
475 because it is up to upstream developers to clarify what the stable
476 release is. Yet, it is sometimes necessary. So, what should we put in
477 the @code{version} field?
478
479 Clearly, we need to make the commit identifier of the VCS snapshot
480 visible in the version string, but we also need to make sure that the
481 version string is monotonically increasing so that @command{guix package
482 --upgrade} can determine which version is newer. Since commit
483 identifiers, notably with Git, are not monotonically increasing, we add
484 a revision number that we increase each time we upgrade to a newer
485 snapshot. The resulting version string looks like this:
486
487 @example
488 2.0.11-3.cabba9e
489 ^ ^ ^
490 | | `-- upstream commit ID
491 | |
492 | `--- Guix package revision
493 |
494 latest upstream version
495 @end example
496
497 It is a good idea to strip commit identifiers in the @code{version}
498 field to, say, 7 digits. It avoids an aesthetic annoyance (assuming
499 aesthetics have a role to play here) as well as problems related to OS
500 limits such as the maximum shebang length (127 bytes for the Linux
501 kernel). It is best to use the full commit identifiers in
502 @code{origin}s, though, to avoid ambiguities. A typical package
503 definition may look like this:
504
505 @lisp
506 (define my-package
507 (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
508 (revision "1")) ;Guix package revision
509 (package
510 (version (git-version "0.9" revision commit))
511 (source (origin
512 (method git-fetch)
513 (uri (git-reference
514 (url "git://example.org/my-package.git")
515 (commit commit)))
516 (sha256 (base32 "1mbikn@dots{}"))
517 (file-name (git-file-name name version))))
518 ;; @dots{}
519 )))
520 @end lisp
521
522 @node Synopses and Descriptions
523 @subsection Synopses and Descriptions
524
525 @cindex package description
526 @cindex package synopsis
527 As we have seen before, each package in GNU@tie{}Guix includes a
528 synopsis and a description (@pxref{Defining Packages}). Synopses and
529 descriptions are important: They are what @command{guix package
530 --search} searches, and a crucial piece of information to help users
531 determine whether a given package suits their needs. Consequently,
532 packagers should pay attention to what goes into them.
533
534 Synopses must start with a capital letter and must not end with a
535 period. They must not start with ``a'' or ``the'', which usually does
536 not bring anything; for instance, prefer ``File-frobbing tool'' over ``A
537 tool that frobs files''. The synopsis should say what the package
538 is---e.g., ``Core GNU utilities (file, text, shell)''---or what it is
539 used for---e.g., the synopsis for GNU@tie{}grep is ``Print lines
540 matching a pattern''.
541
542 Keep in mind that the synopsis must be meaningful for a very wide
543 audience. For example, ``Manipulate alignments in the SAM format''
544 might make sense for a seasoned bioinformatics researcher, but might be
545 fairly unhelpful or even misleading to a non-specialized audience. It
546 is a good idea to come up with a synopsis that gives an idea of the
547 application domain of the package. In this example, this might give
548 something like ``Manipulate nucleotide sequence alignments'', which
549 hopefully gives the user a better idea of whether this is what they are
550 looking for.
551
552 Descriptions should take between five and ten lines. Use full
553 sentences, and avoid using acronyms without first introducing them.
554 Please avoid marketing phrases such as ``world-leading'',
555 ``industrial-strength'', and ``next-generation'', and avoid superlatives
556 like ``the most advanced''---they are not helpful to users looking for a
557 package and may even sound suspicious. Instead, try to be factual,
558 mentioning use cases and features.
559
560 @cindex Texinfo markup, in package descriptions
561 Descriptions can include Texinfo markup, which is useful to introduce
562 ornaments such as @code{@@code} or @code{@@dfn}, bullet lists, or
563 hyperlinks (@pxref{Overview,,, texinfo, GNU Texinfo}). However you
564 should be careful when using some characters for example @samp{@@} and
565 curly braces which are the basic special characters in Texinfo
566 (@pxref{Special Characters,,, texinfo, GNU Texinfo}). User interfaces
567 such as @command{guix package --show} take care of rendering it
568 appropriately.
569
570 Synopses and descriptions are translated by volunteers
571 @uref{https://translationproject.org/domain/guix-packages.html, at the
572 Translation Project} so that as many users as possible can read them in
573 their native language. User interfaces search them and display them in
574 the language specified by the current locale.
575
576 To allow @command{xgettext} to extract them as translatable strings,
577 synopses and descriptions @emph{must be literal strings}. This means
578 that you cannot use @code{string-append} or @code{format} to construct
579 these strings:
580
581 @lisp
582 (package
583 ;; @dots{}
584 (synopsis "This is translatable")
585 (description (string-append "This is " "*not*" " translatable.")))
586 @end lisp
587
588 Translation is a lot of work so, as a packager, please pay even more
589 attention to your synopses and descriptions as every change may entail
590 additional work for translators. In order to help them, it is possible
591 to make recommendations or instructions visible to them by inserting
592 special comments like this (@pxref{xgettext Invocation,,, gettext, GNU
593 Gettext}):
594
595 @example
596 ;; TRANSLATORS: "X11 resize-and-rotate" should not be translated.
597 (description "ARandR is designed to provide a simple visual front end
598 for the X11 resize-and-rotate (RandR) extension. @dots{}")
599 @end example
600
601
602 @node Python Modules
603 @subsection Python Modules
604
605 @cindex python
606 We currently package Python 2 and Python 3, under the Scheme variable names
607 @code{python-2} and @code{python} as explained in @ref{Version Numbers}.
608 To avoid confusion and naming clashes with other programming languages, it
609 seems desirable that the name of a package for a Python module contains
610 the word @code{python}.
611
612 Some modules are compatible with only one version of Python, others with
613 both. If the package Foo is compiled with Python 3, we name it
614 @code{python-foo}. If it is compiled with Python 2, we name it
615 @code{python2-foo}. Packages should be added when they are necessary;
616 we don't add Python 2 variants of the package unless we are going to use
617 them.
618
619 If a project already contains the word @code{python}, we drop this;
620 for instance, the module python-dateutil is packaged under the names
621 @code{python-dateutil} and @code{python2-dateutil}. If the project name
622 starts with @code{py} (e.g.@: @code{pytz}), we keep it and prefix it as
623 described above.
624
625 @subsubsection Specifying Dependencies
626 @cindex inputs, for Python packages
627
628 Dependency information for Python packages is usually available in the
629 package source tree, with varying degrees of accuracy: in the
630 @file{setup.py} file, in @file{requirements.txt}, or in @file{tox.ini}.
631
632 Your mission, when writing a recipe for a Python package, is to map
633 these dependencies to the appropriate type of ``input'' (@pxref{package
634 Reference, inputs}). Although the @code{pypi} importer normally does a
635 good job (@pxref{Invoking guix import}), you may want to check the
636 following check list to determine which dependency goes where.
637
638 @itemize
639
640 @item
641 We currently package Python 2 with @code{setuptools} and @code{pip}
642 installed like Python 3.4 has per default. Thus you don't need to
643 specify either of these as an input. @command{guix lint} will warn you
644 if you do.
645
646 @item
647 Python dependencies required at run time go into
648 @code{propagated-inputs}. They are typically defined with the
649 @code{install_requires} keyword in @file{setup.py}, or in the
650 @file{requirements.txt} file.
651
652 @item
653 Python packages required only at build time---e.g., those listed with
654 the @code{setup_requires} keyword in @file{setup.py}---or only for
655 testing---e.g., those in @code{tests_require}---go into
656 @code{native-inputs}. The rationale is that (1) they do not need to be
657 propagated because they are not needed at run time, and (2) in a
658 cross-compilation context, it's the ``native'' input that we'd want.
659
660 Examples are the @code{pytest}, @code{mock}, and @code{nose} test
661 frameworks. Of course if any of these packages is also required at
662 run-time, it needs to go to @code{propagated-inputs}.
663
664 @item
665 Anything that does not fall in the previous categories goes to
666 @code{inputs}, for example programs or C libraries required for building
667 Python packages containing C extensions.
668
669 @item
670 If a Python package has optional dependencies (@code{extras_require}),
671 it is up to you to decide whether to add them or not, based on their
672 usefulness/overhead ratio (@pxref{Submitting Patches, @command{guix
673 size}}).
674
675 @end itemize
676
677
678 @node Perl Modules
679 @subsection Perl Modules
680
681 @cindex perl
682 Perl programs standing for themselves are named as any other package,
683 using the lowercase upstream name.
684 For Perl packages containing a single class, we use the lowercase class name,
685 replace all occurrences of @code{::} by dashes and prepend the prefix
686 @code{perl-}.
687 So the class @code{XML::Parser} becomes @code{perl-xml-parser}.
688 Modules containing several classes keep their lowercase upstream name and
689 are also prepended by @code{perl-}. Such modules tend to have the word
690 @code{perl} somewhere in their name, which gets dropped in favor of the
691 prefix. For instance, @code{libwww-perl} becomes @code{perl-libwww}.
692
693
694 @node Java Packages
695 @subsection Java Packages
696
697 @cindex java
698 Java programs standing for themselves are named as any other package,
699 using the lowercase upstream name.
700
701 To avoid confusion and naming clashes with other programming languages,
702 it is desirable that the name of a package for a Java package is
703 prefixed with @code{java-}. If a project already contains the word
704 @code{java}, we drop this; for instance, the package @code{ngsjava} is
705 packaged under the name @code{java-ngs}.
706
707 For Java packages containing a single class or a small class hierarchy,
708 we use the lowercase class name, replace all occurrences of @code{.} by
709 dashes and prepend the prefix @code{java-}. So the class
710 @code{apache.commons.cli} becomes package
711 @code{java-apache-commons-cli}.
712
713
714 @node Rust Crates
715 @subsection Rust Crates
716
717 @cindex rust
718 Rust programs standing for themselves are named as any other package, using the
719 lowercase upstream name.
720
721 To prevent namespace collisions we prefix all other Rust packages with the
722 @code{rust-} prefix. The name should be changed to lowercase as appropriate and
723 dashes should remain in place.
724
725 In the rust ecosystem it is common for multiple incompatible versions of a
726 package to be used at any given time, so all packages should have a versioned
727 suffix. If a package has passed version 1.0.0 then just the major version
728 number is sufficient (e.g.@: @code{rust-clap-2}), otherwise the version suffix
729 should contain both the major and minor version (e.g.@: @code{rust-rand-0.6}).
730
731 Because of the difficulty in reusing rust packages as pre-compiled inputs for
732 other packages the Cargo build system (@pxref{Build Systems,
733 @code{cargo-build-system}}) presents the @code{#:cargo-inputs} and
734 @code{cargo-development-inputs} keywords as build system arguments. It would be
735 helpful to think of these as similar to @code{propagated-inputs} and
736 @code{native-inputs}. Rust @code{dependencies} and @code{build-dependencies}
737 should go in @code{#:cargo-inputs}, and @code{dev-dependencies} should go in
738 @code{#:cargo-development-inputs}. If a Rust package links to other libraries
739 then the standard placement in @code{inputs} and the like should be used.
740
741 Care should be taken to ensure the correct version of dependencies are used; to
742 this end we try to refrain from skipping the tests or using @code{#:skip-build?}
743 when possible. Of course this is not always possible, as the package may be
744 developed for a different Operating System, depend on features from the Nightly
745 Rust compiler, or the test suite may have atrophied since it was released.
746
747
748 @node Fonts
749 @subsection Fonts
750
751 @cindex fonts
752 For fonts that are in general not installed by a user for typesetting
753 purposes, or that are distributed as part of a larger software package,
754 we rely on the general packaging rules for software; for instance, this
755 applies to the fonts delivered as part of the X.Org system or fonts that
756 are part of TeX Live.
757
758 To make it easier for a user to search for fonts, names for other packages
759 containing only fonts are constructed as follows, independently of the
760 upstream package name.
761
762 The name of a package containing only one font family starts with
763 @code{font-}; it is followed by the foundry name and a dash @code{-}
764 if the foundry is known, and the font family name, in which spaces are
765 replaced by dashes (and as usual, all upper case letters are transformed
766 to lower case).
767 For example, the Gentium font family by SIL is packaged under the name
768 @code{font-sil-gentium}.
769
770 For a package containing several font families, the name of the collection
771 is used in the place of the font family name.
772 For instance, the Liberation fonts consist of three families,
773 Liberation Sans, Liberation Serif and Liberation Mono.
774 These could be packaged separately under the names
775 @code{font-liberation-sans} and so on; but as they are distributed together
776 under a common name, we prefer to package them together as
777 @code{font-liberation}.
778
779 In the case where several formats of the same font family or font collection
780 are packaged separately, a short form of the format, prepended by a dash,
781 is added to the package name. We use @code{-ttf} for TrueType fonts,
782 @code{-otf} for OpenType fonts and @code{-type1} for PostScript Type 1
783 fonts.
784
785
786 @node Coding Style
787 @section Coding Style
788
789 In general our code follows the GNU Coding Standards (@pxref{Top,,,
790 standards, GNU Coding Standards}). However, they do not say much about
791 Scheme, so here are some additional rules.
792
793 @menu
794 * Programming Paradigm:: How to compose your elements.
795 * Modules:: Where to store your code?
796 * Data Types and Pattern Matching:: Implementing data structures.
797 * Formatting Code:: Writing conventions.
798 @end menu
799
800 @node Programming Paradigm
801 @subsection Programming Paradigm
802
803 Scheme code in Guix is written in a purely functional style. One
804 exception is code that involves input/output, and procedures that
805 implement low-level concepts, such as the @code{memoize} procedure.
806
807 @node Modules
808 @subsection Modules
809
810 Guile modules that are meant to be used on the builder side must live in
811 the @code{(guix build @dots{})} name space. They must not refer to
812 other Guix or GNU modules. However, it is OK for a ``host-side'' module
813 to use a build-side module.
814
815 Modules that deal with the broader GNU system should be in the
816 @code{(gnu @dots{})} name space rather than @code{(guix @dots{})}.
817
818 @node Data Types and Pattern Matching
819 @subsection Data Types and Pattern Matching
820
821 The tendency in classical Lisp is to use lists to represent everything,
822 and then to browse them ``by hand'' using @code{car}, @code{cdr},
823 @code{cadr}, and co. There are several problems with that style,
824 notably the fact that it is hard to read, error-prone, and a hindrance
825 to proper type error reports.
826
827 Guix code should define appropriate data types (for instance, using
828 @code{define-record-type*}) rather than abuse lists. In addition, it
829 should use pattern matching, via Guile’s @code{(ice-9 match)} module,
830 especially when matching lists.
831
832 @node Formatting Code
833 @subsection Formatting Code
834
835 @cindex formatting code
836 @cindex coding style
837 When writing Scheme code, we follow common wisdom among Scheme
838 programmers. In general, we follow the
839 @url{https://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
840 Style Rules}. This document happens to describe the conventions mostly
841 used in Guile’s code too. It is very thoughtful and well written, so
842 please do read it.
843
844 Some special forms introduced in Guix, such as the @code{substitute*}
845 macro, have special indentation rules. These are defined in the
846 @file{.dir-locals.el} file, which Emacs automatically uses. Also note
847 that Emacs-Guix provides @code{guix-devel-mode} mode that indents and
848 highlights Guix code properly (@pxref{Development,,, emacs-guix, The
849 Emacs-Guix Reference Manual}).
850
851 @cindex indentation, of code
852 @cindex formatting, of code
853 If you do not use Emacs, please make sure to let your editor knows these
854 rules. To automatically indent a package definition, you can also run:
855
856 @example
857 ./etc/indent-code.el gnu/packages/@var{file}.scm @var{package}
858 @end example
859
860 @noindent
861 This automatically indents the definition of @var{package} in
862 @file{gnu/packages/@var{file}.scm} by running Emacs in batch mode. To
863 indent a whole file, omit the second argument:
864
865 @example
866 ./etc/indent-code.el gnu/services/@var{file}.scm
867 @end example
868
869 @cindex Vim, Scheme code editing
870 If you are editing code with Vim, we recommend that you run @code{:set
871 autoindent} so that your code is automatically indented as you type.
872 Additionally,
873 @uref{https://www.vim.org/scripts/script.php?script_id=3998,
874 @code{paredit.vim}} may help you deal with all these parentheses.
875
876 We require all top-level procedures to carry a docstring. This
877 requirement can be relaxed for simple private procedures in the
878 @code{(guix build @dots{})} name space, though.
879
880 Procedures should not have more than four positional parameters. Use
881 keyword parameters for procedures that take more than four parameters.
882
883
884 @node Submitting Patches
885 @section Submitting Patches
886
887 Development is done using the Git distributed version control system.
888 Thus, access to the repository is not strictly necessary. We welcome
889 contributions in the form of patches as produced by @code{git
890 format-patch} sent to the @email{guix-patches@@gnu.org} mailing list.
891 Seasoned Guix developers may also want to look at the section on commit
892 access (@pxref{Commit Access}).
893
894 This mailing list is backed by a Debbugs instance, which allows us to
895 keep track of submissions (@pxref{Tracking Bugs and Patches}). Each
896 message sent to that mailing list gets a new tracking number assigned;
897 people can then follow up on the submission by sending email to
898 @code{@var{NNN}@@debbugs.gnu.org}, where @var{NNN} is the tracking
899 number (@pxref{Sending a Patch Series}).
900
901 Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
902 standards, GNU Coding Standards}); you can check the commit history for
903 examples.
904
905 Before submitting a patch that adds or modifies a package definition,
906 please run through this check list:
907
908 @enumerate
909 @item
910 If the authors of the packaged software provide a cryptographic
911 signature for the release tarball, make an effort to verify the
912 authenticity of the archive. For a detached GPG signature file this
913 would be done with the @code{gpg --verify} command.
914
915 @item
916 Take some time to provide an adequate synopsis and description for the
917 package. @xref{Synopses and Descriptions}, for some guidelines.
918
919 @item
920 Run @code{guix lint @var{package}}, where @var{package} is the
921 name of the new or modified package, and fix any errors it reports
922 (@pxref{Invoking guix lint}).
923
924 @item
925 Make sure the package builds on your platform, using @code{guix build
926 @var{package}}.
927
928 @item
929 We recommend you also try building the package on other supported
930 platforms. As you may not have access to actual hardware platforms, we
931 recommend using the @code{qemu-binfmt-service-type} to emulate them. In
932 order to enable it, add the following service to the list of services in
933 your @code{operating-system} configuration:
934
935 @lisp
936 (service qemu-binfmt-service-type
937 (qemu-binfmt-configuration
938 (platforms (lookup-qemu-platforms "arm" "aarch64"))
939 (guix-support? #t)))
940 @end lisp
941
942 Then reconfigure your system.
943
944 You can then build packages for different platforms by specifying the
945 @code{--system} option. For example, to build the "hello" package for
946 the armhf, aarch64, or mips64 architectures, you would run the following
947 commands, respectively:
948 @example
949 guix build --system=armhf-linux --rounds=2 hello
950 guix build --system=aarch64-linux --rounds=2 hello
951 @end example
952
953 @item
954 @cindex bundling
955 Make sure the package does not use bundled copies of software already
956 available as separate packages.
957
958 Sometimes, packages include copies of the source code of their
959 dependencies as a convenience for users. However, as a distribution, we
960 want to make sure that such packages end up using the copy we already
961 have in the distribution, if there is one. This improves resource usage
962 (the dependency is built and stored only once), and allows the
963 distribution to make transverse changes such as applying security
964 updates for a given software package in a single place and have them
965 affect the whole system---something that bundled copies prevent.
966
967 @item
968 Take a look at the profile reported by @command{guix size}
969 (@pxref{Invoking guix size}). This will allow you to notice references
970 to other packages unwillingly retained. It may also help determine
971 whether to split the package (@pxref{Packages with Multiple Outputs}),
972 and which optional dependencies should be used. In particular, avoid adding
973 @code{texlive} as a dependency: because of its extreme size, use
974 @code{texlive-tiny} or @code{texlive-union} instead.
975
976 @item
977 For important changes, check that dependent package (if applicable) are
978 not affected by the change; @code{guix refresh --list-dependent
979 @var{package}} will help you do that (@pxref{Invoking guix refresh}).
980
981 @c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
982 @cindex branching strategy
983 @cindex rebuild scheduling strategy
984 Depending on the number of dependent packages and thus the amount of
985 rebuilding induced, commits go to different branches, along these lines:
986
987 @table @asis
988 @item 300 dependent packages or less
989 @code{master} branch (non-disruptive changes).
990
991 @item between 300 and 1,800 dependent packages
992 @code{staging} branch (non-disruptive changes). This branch is intended
993 to be merged in @code{master} every 6 weeks or so. Topical changes
994 (e.g., an update of the GNOME stack) can instead go to a specific branch
995 (say, @code{gnome-updates}).
996
997 @item more than 1,800 dependent packages
998 @code{core-updates} branch (may include major and potentially disruptive
999 changes). This branch is intended to be merged in @code{master} every
1000 6 months or so.
1001 @end table
1002
1003 All these branches are @uref{@value{SUBSTITUTE-SERVER},
1004 tracked by our build farm} and merged into @code{master} once
1005 everything has been successfully built. This allows us to fix issues
1006 before they hit users, and to reduce the window during which pre-built
1007 binaries are not available.
1008
1009 Generally, branches other than @code{master} are considered
1010 @emph{frozen} if there has been a recent evaluation, or there is a
1011 corresponding @code{-next} branch. Please ask on the mailing list or
1012 IRC if unsure where to place a patch.
1013 @c TODO: It would be good with badges on the website that tracks these
1014 @c branches. Or maybe even a status page.
1015
1016 @item
1017 @cindex determinism, of build processes
1018 @cindex reproducible builds, checking
1019 Check whether the package's build process is deterministic. This
1020 typically means checking whether an independent build of the package
1021 yields the exact same result that you obtained, bit for bit.
1022
1023 A simple way to do that is by building the same package several times in
1024 a row on your machine (@pxref{Invoking guix build}):
1025
1026 @example
1027 guix build --rounds=2 my-package
1028 @end example
1029
1030 This is enough to catch a class of common non-determinism issues, such
1031 as timestamps or randomly-generated output in the build result.
1032
1033 Another option is to use @command{guix challenge} (@pxref{Invoking guix
1034 challenge}). You may run it once the package has been committed and
1035 built by @code{@value{SUBSTITUTE-SERVER}} to check whether it obtains the same
1036 result as you did. Better yet: Find another machine that can build it
1037 and run @command{guix publish}. Since the remote build machine is
1038 likely different from yours, this can catch non-determinism issues
1039 related to the hardware---e.g., use of different instruction set
1040 extensions---or to the operating system kernel---e.g., reliance on
1041 @code{uname} or @file{/proc} files.
1042
1043 @item
1044 When writing documentation, please use gender-neutral wording when
1045 referring to people, such as
1046 @uref{https://en.wikipedia.org/wiki/Singular_they, singular
1047 ``they''@comma{} ``their''@comma{} ``them''}, and so forth.
1048
1049 @item
1050 Verify that your patch contains only one set of related changes.
1051 Bundling unrelated changes together makes reviewing harder and slower.
1052
1053 Examples of unrelated changes include the addition of several packages,
1054 or a package update along with fixes to that package.
1055
1056 @item
1057 Please follow our code formatting rules, possibly running the
1058 @command{etc/indent-code.el} script to do that automatically for you
1059 (@pxref{Formatting Code}).
1060
1061 @item
1062 When possible, use mirrors in the source URL (@pxref{Invoking guix download}).
1063 Use reliable URLs, not generated ones. For instance, GitHub archives are not
1064 necessarily identical from one generation to the next, so in this case it's
1065 often better to clone the repository. Don't use the @command{name} field in
1066 the URL: it is not very useful and if the name changes, the URL will probably
1067 be wrong.
1068
1069 @item
1070 Check if Guix builds (@pxref{Building from Git}) and address the
1071 warnings, especially those about use of undefined symbols.
1072
1073 @item
1074 Make sure your changes do not break Guix and simulate a @code{guix pull} with:
1075 @example
1076 guix pull --url=/path/to/your/checkout --profile=/tmp/guix.master
1077 @end example
1078
1079 @end enumerate
1080
1081 When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as
1082 a subject, if your patch is to be applied on a branch other than
1083 @code{master}, say @code{core-updates}, specify it in the subject like
1084 @samp{[PATCH core-updates] @dots{}}. You may use your email client or
1085 the @command{git send-email} command (@pxref{Sending a Patch Series}).
1086 We prefer to get patches in plain text messages, either inline or as
1087 MIME attachments. You are advised to pay attention if your email client
1088 changes anything like line breaks or indentation which could potentially
1089 break the patches.
1090
1091 When a bug is resolved, please close the thread by sending an email to
1092 @email{@var{NNN}-done@@debbugs.gnu.org}.
1093
1094 @unnumberedsubsec Sending a Patch Series
1095 @anchor{Sending a Patch Series}
1096 @cindex patch series
1097 @cindex @code{git send-email}
1098 @cindex @code{git-send-email}
1099
1100 When sending a patch series (e.g., using @code{git send-email}), please
1101 first send one message to @email{guix-patches@@gnu.org}, and then send
1102 subsequent patches to @email{@var{NNN}@@debbugs.gnu.org} to make sure
1103 they are kept together. See
1104 @uref{https://debbugs.gnu.org/Advanced.html, the Debbugs documentation}
1105 for more information. You can install @command{git send-email} with
1106 @command{guix install git:send-email}.
1107 @c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html
1108
1109 @node Tracking Bugs and Patches
1110 @section Tracking Bugs and Patches
1111
1112 @cindex bug reports, tracking
1113 @cindex patch submissions, tracking
1114 @cindex issue tracking
1115 @cindex Debbugs, issue tracking system
1116 Bug reports and patch submissions are currently tracked using the
1117 Debbugs instance at @uref{https://bugs.gnu.org}. Bug reports are filed
1118 against the @code{guix} ``package'' (in Debbugs parlance), by sending
1119 email to @email{bug-guix@@gnu.org}, while patch submissions are filed
1120 against the @code{guix-patches} package by sending email to
1121 @email{guix-patches@@gnu.org} (@pxref{Submitting Patches}).
1122
1123 A web interface (actually @emph{two} web interfaces!) are available to
1124 browse issues:
1125
1126 @itemize
1127 @item
1128 @url{https://issues.guix.gnu.org} provides a pleasant
1129 interface@footnote{The web interface at
1130 @url{https://issues.guix.gnu.org} is powered by Mumi, a nice piece of
1131 software written in Guile, and you can help! See
1132 @url{https://git.elephly.net/gitweb.cgi?p=software/mumi.git}.} to browse
1133 bug reports and patches, and to participate in discussions;
1134 @item
1135 @url{https://bugs.gnu.org/guix} lists bug reports;
1136 @item
1137 @url{https://bugs.gnu.org/guix-patches} lists patch submissions.
1138 @end itemize
1139
1140 To view discussions related to issue number @var{n}, go to
1141 @indicateurl{https://issues.guix.gnu.org/@var{n}} or
1142 @indicateurl{https://bugs.gnu.org/@var{n}}.
1143
1144 If you use Emacs, you may find it more convenient to interact with
1145 issues using @file{debbugs.el}, which you can install with:
1146
1147 @example
1148 guix install emacs-debbugs
1149 @end example
1150
1151 For example, to list all open issues on @code{guix-patches}, hit:
1152
1153 @example
1154 @kbd{C-u} @kbd{M-x} debbugs-gnu @kbd{RET} @kbd{RET} guix-patches @kbd{RET} n y
1155 @end example
1156
1157 @xref{Top,,, debbugs-ug, Debbugs User Guide}, for more information on
1158 this nifty tool!
1159
1160 @node Commit Access
1161 @section Commit Access
1162
1163 @cindex commit access, for developers
1164 For frequent contributors, having write access to the repository is
1165 convenient. When you deem it necessary, consider applying for commit
1166 access by following these steps:
1167
1168 @enumerate
1169 @item
1170 Find three committers who would vouch for you. You can view the list of
1171 committers at
1172 @url{https://savannah.gnu.org/project/memberlist.php?group=guix}. Each
1173 of them should email a statement to @email{guix-maintainers@@gnu.org} (a
1174 private alias for the collective of maintainers), signed with their
1175 OpenPGP key.
1176
1177 Committers are expected to have had some interactions with you as a
1178 contributor and to be able to judge whether you are sufficiently
1179 familiar with the project's practices. It is @emph{not} a judgment on
1180 the value of your work, so a refusal should rather be interpreted as
1181 ``let's try again later''.
1182
1183 @item
1184 Send @email{guix-maintainers@@gnu.org} a message stating your intent,
1185 listing the three committers who support your application, signed with
1186 the OpenPGP key you will use to sign commits, and giving its fingerprint
1187 (see below). See @uref{https://emailselfdefense.fsf.org/en/}, for an
1188 introduction to public-key cryptography with GnuPG.
1189
1190 @c See <https://sha-mbles.github.io/>.
1191 Set up GnuPG such that it never uses the SHA1 hash algorithm for digital
1192 signatures, which is known to be unsafe since 2019, for instance by
1193 adding the following line to @file{~/.gnupg/gpg.conf} (@pxref{GPG
1194 Esoteric Options,,, gnupg, The GNU Privacy Guard Manual}):
1195
1196 @example
1197 digest-algo sha512
1198 @end example
1199
1200 @item
1201 Maintainers ultimately decide whether to grant you commit access,
1202 usually following your referrals' recommendation.
1203
1204 @item
1205 @cindex OpenPGP, signed commits
1206 If and once you've been given access, please send a message to
1207 @email{guix-devel@@gnu.org} to say so, again signed with the OpenPGP key
1208 you will use to sign commits (do that before pushing your first commit).
1209 That way, everyone can notice and ensure you control that OpenPGP key.
1210
1211 @quotation Important
1212 Before you can push for the first time, maintainers must:
1213
1214 @enumerate
1215 @item
1216 add your OpenPGP key to the @code{keyring} branch;
1217 @item
1218 add your OpenPGP fingerprint to the @file{.guix-authorizations} file of
1219 the branch(es) you will commit to.
1220 @end enumerate
1221 @end quotation
1222
1223 @item
1224 Make sure to read the rest of this section and... profit!
1225 @end enumerate
1226
1227 @quotation Note
1228 Maintainers are happy to give commit access to people who have been
1229 contributing for some time and have a track record---don't be shy and
1230 don't underestimate your work!
1231
1232 However, note that the project is working towards a more automated patch
1233 review and merging system, which, as a consequence, may lead us to have
1234 fewer people with commit access to the main repository. Stay tuned!
1235 @end quotation
1236
1237 If you get commit access, please make sure to follow
1238 the policy below (discussions of the policy can take place on
1239 @email{guix-devel@@gnu.org}).
1240
1241 Non-trivial patches should always be posted to
1242 @email{guix-patches@@gnu.org} (trivial patches include fixing typos,
1243 etc.). This mailing list fills the patch-tracking database
1244 (@pxref{Tracking Bugs and Patches}).
1245
1246 For patches that just add a new package, and a simple one, it's OK to
1247 commit, if you're confident (which means you successfully built it in a
1248 chroot setup, and have done a reasonable copyright and license
1249 auditing). Likewise for package upgrades, except upgrades that trigger
1250 a lot of rebuilds (for example, upgrading GnuTLS or GLib). We have a
1251 mailing list for commit notifications (@email{guix-commits@@gnu.org}),
1252 so people can notice. Before pushing your changes, make sure to run
1253 @code{git pull --rebase}.
1254
1255 All commits that are pushed to the central repository on Savannah must
1256 be signed with an OpenPGP key, and the public key should be uploaded to
1257 your user account on Savannah and to public key servers, such as
1258 @code{keys.openpgp.org}. To configure Git to automatically sign
1259 commits, run:
1260
1261 @example
1262 git config commit.gpgsign true
1263 git config user.signingkey CABBA6EA1DC0FF33
1264 @end example
1265
1266 You can prevent yourself from accidentally pushing unsigned commits to
1267 Savannah by using the pre-push Git hook called located at
1268 @file{etc/git/pre-push}:
1269
1270 @example
1271 cp etc/git/pre-push .git/hooks/pre-push
1272 @end example
1273
1274 When pushing a commit on behalf of somebody else, please add a
1275 @code{Signed-off-by} line at the end of the commit log message---e.g.,
1276 with @command{git am --signoff}. This improves tracking of who did
1277 what.
1278
1279 When adding channel news entries (@pxref{Channels, Writing Channel
1280 News}), make sure they are well-formed by running the following command
1281 right before pushing:
1282
1283 @example
1284 make check-channel-news
1285 @end example
1286
1287 For anything else, please post to @email{guix-patches@@gnu.org} and
1288 leave time for a review, without committing anything (@pxref{Submitting
1289 Patches}). If you didn’t receive any reply after two weeks, and if
1290 you're confident, it's OK to commit.
1291
1292 That last part is subject to being adjusted, allowing individuals to commit
1293 directly on non-controversial changes on parts they’re familiar with.
1294
1295 One last thing: the project keeps moving forward because committers not
1296 only push their own awesome changes, but also offer some of their time
1297 @emph{reviewing} and pushing other people's changes. As a committer,
1298 you're welcome to use your expertise and commit rights to help other
1299 contributors, too!