contributing.tm 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <TeXmacs|2.1>
  2. <project|scheme-gnunet.tm>
  3. <style|generic>
  4. <\body>
  5. <section|Building from source>
  6. The latest \<#2018\>official\<#2019\> development version of scheme-GNUnet
  7. can be found at <hlink|https://git.gnunet.org/gnunet-scheme.git/|https://git.gnunet.org/gnunet-scheme.git/>.
  8. It can be downloaded with <hlink|git|https://en.wikipedia.org/wiki/Git>.
  9. The following software needs to be installed first:
  10. <\itemize>
  11. <item>The Autotools (<hlink|autoconf|https://www.gnu.org/software/autoconf/>
  12. and <hlink|automake|https://www.gnu.org/software/automake/>)
  13. <item><hlink|GNU Guile|https://www.gnu.org/software/guile/> (at least
  14. version 3), with the patch from <slink|https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49623>
  15. applied
  16. <item><hlink|Purely Functional Data Structures in Scheme
  17. (pfds)|https://github.com/ijp/pfds/>
  18. <item><hlink|(Guile) Fibers|https://github.com/wingo/fibers/>, with the
  19. <slink|https://github.com/wingo/fibers/pull/50> patch
  20. <item><hlink|Guile-QuickCheck|https://ngyro.com/software/guile-quickcheck.html>
  21. <item><hlink|Guile-Gcrypt|https://notabug.org/cwebber/guile-gcrypt>
  22. </itemize>
  23. Users of <hlink|GNU Guix|https://guix.gnu.org><index|Guix> can run
  24. <shell|guix shell -D gnunet-scheme> in the checkout to create an
  25. environment where these dependencies are all
  26. present.<space|1em>Scheme-GNUnet uses the standard GNU build system, so to
  27. build Scheme-Gnunet, you only need to run
  28. <\shell-code>
  29. autoreconf -vif
  30. ./configure
  31. make
  32. make check
  33. </shell-code>
  34. After building, the documentation is available at
  35. <verbatim|doc/scheme-gnunet.pdf> and <verbatim|doc/scheme-gnunet.html> in
  36. PDF and HTML formats.<space|1em>To get started, you can run the example
  37. mini-application at <verbatim|examples/nse-web.scm> and point your browser
  38. at <slink|http://localhost:8089>:
  39. <\shell-code>
  40. $ guile -L . -C . -l examples/nse-web.scm
  41. </shell-code>
  42. <subsection|Authenticating new source code><index|authentication>
  43. When GNU Guix is present, after pulling the latest Scheme-GNUnet commit,
  44. the following command can be run to verify it is authentic:
  45. <\shell-code>
  46. guix git authenticate 088ea8b27b95143584cbc36202c5a02dfe95796c "C1F3 3EE2
  47. 0C52 8FDB 7DD7 \ 011F 49E3 EE22 1917 25EE"
  48. </shell-code>
  49. If it isn't authentic, an error message such as the following will be
  50. written:
  51. <\shell-code>
  52. Authenticating commits 54a74dc to 431f336 (1 new commits)...
  53. [#########################################################]
  54. guix git: error: commit 431f336edd51e1f0fe059a6f6f2d4c3e9267b7bc not
  55. signed by an authorized key: C1F3 3EE2 0C52 8FDB 7DD7 \ 011F 49E3 EE22
  56. 1917 25EE
  57. </shell-code>
  58. <section|Writing tests>
  59. <index|tests>\<#2018\><hlink|How SQLite Is
  60. Tested|https://sqlite.org/testing.html>\<#2019\> is a recommended
  61. read.<space|1em>Scheme-GNUnet isn't that well-tested but still aims for
  62. being free of bugs and having many tests to prevents bugs from being
  63. introduced.<space|1em>When adding new code, consider writing test
  64. cases.<space|1em>Some things that can be tested and few methods for testing
  65. things:
  66. <\itemize>
  67. <item>Run mutation tests.<space|1em>That is, replace in the source code
  68. <scm|\<less\>> with <scm|\<less\>=>, <scm|0> with <scm|1>, a variable
  69. reference <scm|i> with a variable reference <scm|j>, swap destination and
  70. source arguments <text-dots> and verify whether the tests detect these
  71. little mutations.
  72. <item>Be exhaustive.<space|1em>If a procedure handles both foos and bars,
  73. write test cases that pass the procedure a foo and test cases that pass
  74. the procedure a bar.<space|1em>Sometimes Guile-QuickCheck can help with
  75. generating many test cases if the input has a regular structure yet many
  76. edge cases, see e.g. <verbatim|tests/cmsg.scm>.
  77. <item>Verify exception mechanisms!<space|1em>If a procedure is expected
  78. to handle I/O errors, simulate I/O errors and end-of-files in all the
  79. wrong places.<space|1em>If the procedure can raise exceptions, make sure
  80. these exceptions are raised when necessary.
  81. </itemize>
  82. Tests are added in the directory <scm|tests> and to the variable
  83. <verbatim|SCM_TESTS> in <verbatim|Makefile.am> and use <scm|srfi
  84. :64>.<space|1em>To run the test suite, run <verbatim|make check>.
  85. <section|Contact>
  86. Scheme-GNUnet is currently maintained on NotABug:
  87. <slink|https://notabug.org/maximed/scheme-gnunet/>.<space|1em>Issues and
  88. pull requests can be reported and submitted here.<space|1em>Alternatively,
  89. for discussion about developing Scheme-GNUnet, you can send mails to
  90. <hlink|gnunet-devel@gnu.org|mailto:gnunet-devel@gnu.org> and for help about
  91. how to use Scheme-GNUnet, you can contact
  92. <hlink|help-gnunet@gnu.org|mailto:help-gnunet@gnu.org>.<space|1em>These are
  93. public mailing lists, so don't send anything there you wouldn't mind the
  94. whole world to know.
  95. For security-sensitive issues, you can send a mail directly to the
  96. maintainer, <hlink|Maxime Devos \<less\>maximedevos@telenet.be\<gtr\>|mailto:maximedevos@telenet.be>,
  97. optionally encrypted and signed with a GnuPG-compatible
  98. system.<space|1em>The maintainer's key fingerprint is C1F3 3EE2 0C52 8FDB
  99. 7DD7 011F 49E3 EE22 1917 25EE and a copy of the key can be downloaded from
  100. <slink|https://notabug.org/maximed/things/raw/master/Maxime_Devos.pub>.
  101. <section|License>
  102. The code of Scheme-GNUnet is available under the Affero General Public
  103. License (AGPL), version 3 or later; see individual source files for
  104. details.<space|1em>The documentaton is available under the GNU Free
  105. Documentation License, see the start of this manual and the likewise-named
  106. appendix for details.<space|1em>The AGPL has some unusual conditions w.r.t.
  107. applications interacting with the network, please read it carefully.
  108. </body>
  109. <\initial>
  110. <\collection>
  111. <associate|page-medium|paper>
  112. <associate|save-aux|false>
  113. </collection>
  114. </initial>