| 1 | |
|---|
| 2 | ---------------------------------- |
|---|
| 3 | Boost.Build contributor guidelines |
|---|
| 4 | ---------------------------------- |
|---|
| 5 | |
|---|
| 6 | Boost.Build is an open-source project. This means that we welcome and |
|---|
| 7 | appreciate all contributions --- be it ideas, bug reports, or patches. |
|---|
| 8 | This document contains guidelines which helps to assure that development |
|---|
| 9 | goes on smoothly, and changes are made quickly. |
|---|
| 10 | |
|---|
| 11 | The guidelines are not mandatory, and you can decide for yourself which one |
|---|
| 12 | to follow. But note, that 10 mins that you spare writing a comment, for |
|---|
| 13 | example, might lead to significally longer delay for everyone. |
|---|
| 14 | |
|---|
| 15 | Before contributing, make sure you are subscribed to our mailing list |
|---|
| 16 | |
|---|
| 17 | jamboost@yahoogroups.com |
|---|
| 18 | |
|---|
| 19 | Additional resources include |
|---|
| 20 | |
|---|
| 21 | - brief issues list |
|---|
| 22 | http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build/Issues |
|---|
| 23 | |
|---|
| 24 | - the issue tracker |
|---|
| 25 | http://zigzag.cs.msu.su:7814 |
|---|
| 26 | |
|---|
| 27 | - commits mailing list: |
|---|
| 28 | boost-build@lists.sourceforge.net |
|---|
| 29 | http://sourceforge.net/mailarchive/forum.php?forum_id=9097 |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | BUGS and PATCHES |
|---|
| 33 | |
|---|
| 34 | Both bugs and patches can be send to our mailing list. |
|---|
| 35 | |
|---|
| 36 | When reporting a bug, please try to provide the following information. |
|---|
| 37 | |
|---|
| 38 | - What you did. A minimal reproducible testcase is very much appreciated. |
|---|
| 39 | Shell script with some annotations is much better than verbose description of |
|---|
| 40 | the problem. A regression test is the best (see test/test_system.html). |
|---|
| 41 | - What you got. |
|---|
| 42 | - What you expected. |
|---|
| 43 | - What version of Boost.Build and Boost.Jam did you use. If possible, |
|---|
| 44 | please try to test with the CVS HEAD state. |
|---|
| 45 | |
|---|
| 46 | When submitting a patch, please: |
|---|
| 47 | |
|---|
| 48 | - make a single patch for a single logical change |
|---|
| 49 | - follow the policies and coding conventions below, |
|---|
| 50 | - send patches in unified diff format, |
|---|
| 51 | (using either "cvs diff -u" or "diff -u") |
|---|
| 52 | - provide a log message together with the patch |
|---|
| 53 | - put the patch and the log message as attachment to your email. |
|---|
| 54 | |
|---|
| 55 | The purpose of log message serves to communicate what was changed, and |
|---|
| 56 | *why*. Without a good log message, you might spend a lot of time later, |
|---|
| 57 | wondering where a strange piece of code came from and why it was necessary. |
|---|
| 58 | |
|---|
| 59 | The good log message mentions each changed file and each rule/method, saying |
|---|
| 60 | what happend to it, and why. Consider, the following log message |
|---|
| 61 | |
|---|
| 62 | Better direct request handling. |
|---|
| 63 | |
|---|
| 64 | * new/build-request.jam |
|---|
| 65 | (directly-requested-properties-adjuster): Redo. |
|---|
| 66 | |
|---|
| 67 | * new/targets.jam |
|---|
| 68 | (main-target.generate-really): Adjust properties here. |
|---|
| 69 | |
|---|
| 70 | * new/virtual-target.jam |
|---|
| 71 | (register-actual-name): New rule. |
|---|
| 72 | (virtual-target.actualize-no-scanner): Call the above, to detected bugs, |
|---|
| 73 | where two virtual target correspond to one Jam target name. |
|---|
| 74 | |
|---|
| 75 | The log messages for the last two files are good. They tell what was |
|---|
| 76 | changed. The change to the first file is clearly undercommented. |
|---|
| 77 | |
|---|
| 78 | It's OK to use terse log messages for uninteresting changes, like |
|---|
| 79 | ones induces by interface changes elsewhere. |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | POLICIES. |
|---|
| 83 | |
|---|
| 84 | 1. Testing. |
|---|
| 85 | |
|---|
| 86 | All serious changes must be tested. New rules must be tested by the module |
|---|
| 87 | where they are declared. Test system (test/test_system.html) should be used |
|---|
| 88 | to verify user-observable behaviour. |
|---|
| 89 | |
|---|
| 90 | 2. Documentation. |
|---|
| 91 | |
|---|
| 92 | It turns out that it's hard to have too much comments, but it's easy to have |
|---|
| 93 | too little. Please predend each rule with a comment saying what the rule does |
|---|
| 94 | and what arguments means. Stop for a minute and consider if the comment makes |
|---|
| 95 | sense for anybody else, and completely describes what the rules does. Generic |
|---|
| 96 | phrases like "adjusts properties" are really not enough. |
|---|
| 97 | |
|---|
| 98 | When applicable, make changes to the user documentation as well. |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | CODING CONVENTIONS. |
|---|
| 102 | |
|---|
| 103 | 1. All names of rules and variables are lowercase with "-" to separate |
|---|
| 104 | words. |
|---|
| 105 | |
|---|
| 106 | rule call-me-ishmael ( ) ... |
|---|
| 107 | |
|---|
| 108 | 2. Names with dots in them are "intended globals". Ordinary globals use |
|---|
| 109 | a dot prefix: |
|---|
| 110 | |
|---|
| 111 | .foobar |
|---|
| 112 | $(.foobar) |
|---|
| 113 | |
|---|
| 114 | 3. Pseudofunctions or associations are <parameter>.<property>: |
|---|
| 115 | |
|---|
| 116 | $(argument).name = hello ; |
|---|
| 117 | $($(argument).name) |
|---|
| 118 | |
|---|
| 119 | 4. Class attribute names are prefixed with "self.": |
|---|
| 120 | |
|---|
| 121 | self.x |
|---|
| 122 | $(self.x) |
|---|
| 123 | |
|---|
| 124 | 5. Builtin rules are called via their ALL_UPPERCASE_NAMES: |
|---|
| 125 | |
|---|
| 126 | DEPENDS $(target) : $(sources) ; |
|---|
| 127 | |
|---|
| 128 | 6. Opening and closing braces go on separate lines: |
|---|
| 129 | |
|---|
| 130 | if $(a) |
|---|
| 131 | { |
|---|
| 132 | # |
|---|
| 133 | } |
|---|
| 134 | else |
|---|
| 135 | { |
|---|
| 136 | # |
|---|
| 137 | } |
|---|
| 138 | |
|---|
| 139 | HTML DOCUMENTATION. |
|---|
| 140 | |
|---|
| 141 | Please pass HTML files though HTML Tidy (http://tidy.sf.net) before |
|---|
| 142 | comitting. This has to important purposes: |
|---|
| 143 | - detecting bad HTML |
|---|
| 144 | - converting files to uniform indentation style, which inverses effect |
|---|
| 145 | of different editors and makes differences between revisions much |
|---|
| 146 | smaller and easy for review. |
|---|
| 147 | |
|---|
| 148 | Alas, the way Tidy indents HTML differs between version. Please use |
|---|
| 149 | the version awailable at |
|---|
| 150 | |
|---|
| 151 | http://tidy.sourceforge.net/src/old/tidy_src_020411.tgz |
|---|
| 152 | |
|---|
| 153 | and "-i -wrap 78" command line parameters. |
|---|