]> Sergey Matveev's repositories - public-inbox.git/blob - HACKING
t/imapd.t: skip dependent test on failure
[public-inbox.git] / HACKING
1 hacking public-inbox
2 --------------------
3
4 Send all patches and "git request-pull"-formatted emails to our
5 self-hosting inbox at meta@public-inbox.org
6 It is archived at: https://public-inbox.org/meta/
7 and http://hjrcffqmbrq6wope.onion/meta/ (using Tor)
8
9 Contributions are email-driven, just like contributing to git
10 itself or the Linux kernel; however anonymous and pseudonymous
11 contributions will always be welcome.
12
13 Please consider our goals in mind:
14
15         Decentralization, Accessibility, Compatibility, Performance
16
17 These goals apply to everyone: users viewing over the web or NNTP,
18 sysadmins running public-inbox, and other hackers working public-inbox.
19
20 We will reject any feature which advocates or contributes to any
21 particular instance of a public-inbox becoming a single point of failure.
22 Things we've considered but rejected include:
23
24 * exposing article serial numbers outside of NNTP
25 * allowing readers to inject metadata (e.g. votes)
26
27 We care about being accessible to folks with vision problems and/or
28 lack the computing resources to view so-called "modern" websites.
29 This includes folks on slow connections and ancient browsers which
30 may be too difficult to upgrade due to resource demands.
31
32 Only depend on Free Software packages which exist in the "main"
33 section of Debian "stable" distribution.  That is Debian 9.x
34 ("stretch") as of this writing, but "oldstable" (8.x, "jessie")
35 remains supported for v1 inboxes.
36
37 In general, we favor mature and well-tested old things rather than
38 the shiny new.
39
40 Avoid relying on compiled modules too much.  Even if it is Free,
41 compiled code makes packages more expensive to audit, build,
42 distribute and verify.  public-inbox itself will only be implemented
43 in scripting languages (currently Perl 5) and optional JIT-compiled C
44 (via Inline::C)
45
46 Do not recurse on user-supplied data.  Neither Perl or C handle
47 deep recursion gracefully.  See lib/PublicInbox/SearchThread.pm
48 and lib/PublicInbox/MsgIter.pm for examples of non-recursive
49 alternatives to previously-recursive algorithms.
50
51 Performance should be reasonably good for server administrators, too,
52 and we will sacrifice features to achieve predictable performance.
53 Encouraging folks to self-host will be easier with lower hardware
54 requirements.
55
56 See design_www.txt and design_notes.txt in the Documentation/
57 directory for design decisions made during development.
58
59 See Documentation/technical/ in the source tree for more details
60 on specific topics, in particular data_structures.txt
61
62 Faster tests
63 ------------
64
65 The `make test' target provided by MakeMaker does not run in
66 parallel.  Our `make check' target supports parallel runs, and
67 it also creates a `.prove' file to optimize `make check-run'.
68
69 The prove(1) command (distributed with Perl) may also be used
70 for finer-grained testing: prove -bvw t/foo.t
71
72 If using a make(1) (e.g. GNU make) with `include' support, the
73 `config.mak' Makefile snippet can be used to set environment
74 variables such as PERL_INLINE_DIRECTORY and TMPDIR.
75
76 With PERL_INLINE_DIRECTORY set to enable Inline::C support and
77 TMPDIR pointed to a tmpfs(5) mount, `make check-run' takes 6-10s
78 (load-dependent) on a busy workstation built in 2010.
79
80 Perl notes
81 ----------
82
83 * \w, \s, \d character classes all match Unicode characters;
84   so write out class ranges (e.g "[0-9]") if you only intend to
85   match ASCII.  Do not use the "/a" (ASCII) modifier, that requires
86   Perl 5.14 and we're only depending on 5.10.1 at the moment.