2
1

contribute.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. == Contributing to Buildroot
  4. There are many ways in which you can contribute to Buildroot: analyzing
  5. and fixing bugs, analyzing and fixing package build failures detected by
  6. the autobuilders, testing and reviewing patches sent by other
  7. developers, working on the items in our TODO list and sending your own
  8. improvements to Buildroot or its manual. The following sections give a
  9. little more detail on each of these items.
  10. If you are interested in contributing to Buildroot, the first thing you
  11. should do is to subscribe to the Buildroot mailing list. This list is
  12. the main way of interacting with other Buildroot developers and to send
  13. contributions to. If you aren't subscribed yet, then refer to
  14. xref:community-resources[] for the subscription link.
  15. If you are going to touch the code, it is highly recommended to use a
  16. git repository of Buildroot, rather than starting from an extracted
  17. source code tarball. Git is the easiest way to develop from and directly
  18. send your patches to the mailing list. Refer to xref:getting-buildroot[]
  19. for more information on obtaining a Buildroot git tree.
  20. === Reproducing, analyzing and fixing bugs
  21. A first way of contributing is to have a look at the open bug reports in
  22. the https://bugs.buildroot.org/buglist.cgi?product=buildroot[Buildroot bug
  23. tracker]. As we strive to keep the bug count as small as possible, all
  24. help in reproducing, analyzing and fixing reported bugs is more than
  25. welcome. Don't hesitate to add a comment to bug reports reporting your
  26. findings, even if you don't yet see the full picture.
  27. === Analyzing and fixing autobuild failures
  28. The Buildroot autobuilders are a set of build machines that continuously
  29. run Buildroot builds based on random configurations. This is done for
  30. all architectures supported by Buildroot, with various toolchains, and
  31. with a random selection of packages. With the large commit activity on
  32. Buildroot, these autobuilders are a great help in detecting problems
  33. very early after commit.
  34. All build results are available at http://autobuild.buildroot.org[],
  35. statistics are at http://autobuild.buildroot.org/stats.php[]. Every day,
  36. an overview of all failed packages is sent to the mailing list.
  37. Detecting problems is great, but obviously these problems have to be
  38. fixed as well. Your contribution is very welcome here! There are
  39. basically two things that can be done:
  40. - Analyzing the problems. The daily summary mails do not contain details
  41. about the actual failures: in order to see what's going on you have to
  42. open the build log and check the last output. Having someone doing
  43. this for all packages in the mail is very useful for other developers,
  44. as they can make a quick initial analysis based on this output alone.
  45. - Fixing a problem. When fixing autobuild failures, you should follow
  46. these steps:
  47. . Check if you can reproduce the problem by building with the same
  48. configuration. You can do this manually, or use the
  49. http://git.buildroot.org/buildroot-test/tree/utils/br-reproduce-build[br-reproduce-build]
  50. script that will automatically clone a Buildroot git repository,
  51. checkout the correct revision, download and set the right
  52. configuration, and start the build.
  53. . Analyze the problem and create a fix.
  54. . Verify that the problem is really fixed by starting from a clean
  55. Buildroot tree and only applying your fix.
  56. . Send the fix to the Buildroot mailing list (see
  57. xref:submitting-patches[]). In case you created a patch against the
  58. package sources, you should also send the patch upstream so that the
  59. problem will be fixed in a later release, and the patch in Buildroot
  60. can be removed.
  61. In the commit message of a patch fixing an autobuild failure, add a
  62. reference to the build result directory, as follows:
  63. ---------------------
  64. Fixes http://autobuild.buildroot.org/results/51000a9d4656afe9e0ea6f07b9f8ed374c2e4069
  65. ---------------------
  66. === Reviewing and testing patches
  67. With the amount of patches sent to the mailing list each day, the
  68. maintainer has a very hard job to judge which patches are ready to apply
  69. and which ones aren't. Contributors can greatly help here by reviewing
  70. and testing these patches.
  71. In the review process, do not hesitate to respond to patch submissions
  72. for remarks, suggestions or anything that will help everyone to
  73. understand the patches and make them better. Please use internet
  74. style replies in plain text emails when responding to patch
  75. submissions.
  76. To indicate approval of a patch, there are three formal tags that keep
  77. track of this approval. To add your tag to a patch, reply to it with the
  78. approval tag below the original author's Signed-off-by line. These tags
  79. will be picked up automatically by patchwork (see
  80. xref:apply-patches-patchwork[]) and will be part of the commit log when
  81. the patch is accepted.
  82. Tested-by:: Indicates that the patch has been tested successfully.
  83. You are encouraged to specify what kind of testing you performed
  84. (compile-test on architecture X and Y, runtime test on target A,
  85. ...). This additional information helps other testers and the
  86. maintainer.
  87. Reviewed-by:: Indicates that you code-reviewed the patch and did your
  88. best in spotting problems, but you are not sufficiently familiar with
  89. the area touched to provide an Acked-by tag. This means that there
  90. may be remaining problems in the patch that would be spotted by
  91. someone with more experience in that area. Should such problems be
  92. detected, your Reviewed-by tag remains appropriate and you cannot
  93. be blamed.
  94. Acked-by:: Indicates that you code-reviewed the patch and you are
  95. familiar enough with the area touched to feel that the patch can be
  96. committed as-is (no additional changes required). In case it later
  97. turns out that something is wrong with the patch, your Acked-by could
  98. be considered inappropriate. The difference between Acked-by and
  99. Reviewed-by is thus mainly that you are prepared to take the blame on
  100. Acked patches, but not on Reviewed ones.
  101. If you reviewed a patch and have comments on it, you should simply reply
  102. to the patch stating these comments, without providing a Reviewed-by or
  103. Acked-by tag. These tags should only be provided if you judge the patch
  104. to be good as it is.
  105. It is important to note that neither Reviewed-by nor Acked-by imply
  106. that testing has been performed. To indicate that you both reviewed and
  107. tested the patch, provide two separate tags (Reviewed/Acked-by and
  108. Tested-by).
  109. Note also that _any developer_ can provide Tested/Reviewed/Acked-by
  110. tags, without exception, and we encourage everyone to do this. Buildroot
  111. does not have a defined group of _core_ developers, it just so happens
  112. that some developers are more active than others. The maintainer will
  113. value tags according to the track record of their submitter. Tags
  114. provided by a regular contributor will naturally be trusted more than
  115. tags provided by a newcomer. As you provide tags more regularly, your
  116. 'trustworthiness' (in the eyes of the maintainer) will go up, but _any_
  117. tag provided is valuable.
  118. Buildroot's Patchwork website can be used to pull in patches for testing
  119. purposes. Please see xref:apply-patches-patchwork[] for more
  120. information on using Buildroot's Patchwork website to apply patches.
  121. [[apply-patches-patchwork]]
  122. ==== Applying Patches from Patchwork
  123. The main use of Buildroot's Patchwork website for a developer is for
  124. pulling in patches into their local git repository for testing
  125. purposes.
  126. When browsing patches in the patchwork management interface, an +mbox+
  127. link is provided at the top of the page. Copy this link address and
  128. run the following commands:
  129. ---------------------
  130. $ git checkout -b <test-branch-name>
  131. $ wget -O - <mbox-url> | git am
  132. ---------------------
  133. Another option for applying patches is to create a bundle. A bundle is
  134. a set of patches that you can group together using the patchwork
  135. interface. Once the bundle is created and the bundle is made public,
  136. you can copy the +mbox+ link for the bundle and apply the bundle
  137. using the above commands.
  138. === Work on items from the TODO list
  139. If you want to contribute to Buildroot but don't know where to start,
  140. and you don't like any of the above topics, you can always work on items
  141. from the http://elinux.org/Buildroot#Todo_list[Buildroot TODO list].
  142. Don't hesitate to discuss an item first on the mailing list or on IRC.
  143. Do edit the wiki to indicate when you start working on an item, so we
  144. avoid duplicate efforts.
  145. [[submitting-patches]]
  146. === Submitting patches
  147. [NOTE]
  148. _Please, do not attach patches to bugs, send them to the mailing list
  149. instead_.
  150. If you made some changes to Buildroot and you would like to contribute
  151. them to the Buildroot project, proceed as follows. Starting from the
  152. changes committed in your local git view, _rebase_ your development
  153. branch on top of the upstream tree before generating a patch set. To do
  154. so, run:
  155. ---------------------
  156. $ git fetch --all --tags
  157. $ git rebase origin/master
  158. ---------------------
  159. Now, you are ready to generate then submit your patch set.
  160. To generate it, run:
  161. ---------------------
  162. $ git format-patch -M -n -s -o outgoing origin/master
  163. ---------------------
  164. This will generate patch files in the +outgoing+ subdirectory,
  165. automatically adding the +Signed-off-by+ line.
  166. Once patch files are generated, you can review/edit the commit message
  167. before submitting them, using your favorite text editor.
  168. Lastly, send/submit your patch set to the Buildroot mailing list:
  169. ---------------------
  170. $ git send-email --to buildroot@buildroot.org outgoing/*
  171. ---------------------
  172. Note that +git+ should be configured to use your mail account.
  173. To configure +git+, see +man git-send-email+ or google it.
  174. If you do not use +git send-email+, make sure posted *patches are not
  175. line-wrapped*, otherwise they cannot easily be applied. In such a case,
  176. fix your e-mail client, or better yet, learn to use +git send-email+.
  177. ==== Cover letter
  178. If you want to present the whole patch set in a separate mail, add
  179. +--cover-letter+ to the +git format-patch+ command (see +man
  180. git-format-patch+ for further information). This will generate a
  181. template for an introduction e-mail to your patch series.
  182. A 'cover letter' may be useful to introduce the changes you propose
  183. in the following cases:
  184. * large number of commits in the series;
  185. * deep impact of the changes in the rest of the project;
  186. * RFC footnote:[RFC: (Request for comments) change proposal];
  187. * whenever you feel it will help presenting your work, your choices,
  188. the review process, etc.
  189. ==== Patch revision changelog
  190. When improvements are requested, the new revision of each commit
  191. should include a changelog of the modifications between each
  192. submission. Note that when your patch series is introduced by a cover
  193. letter, an overall changelog may be added to the cover letter in
  194. addition to the changelog in the individual commits.
  195. The best thing to rework a patch series is by interactive rebasing:
  196. +git rebase -i origin/master+. Consult the git manual for more
  197. information.
  198. When added to the individual commits, this changelog is added when
  199. editing the commit message. Below the +Signed-off-by+ section, add
  200. +---+ and your changelog.
  201. Although the changelog will be visible for the reviewers in the mail
  202. thread, as well as in http://patchwork.buildroot.org[patchwork], +git+
  203. will automatically ignores lines below +---+ when the patch will be
  204. merged. This is the intended behavior: the changelog is not meant to
  205. be preserved forever in the +git+ history of the project.
  206. Hereafter the recommended layout:
  207. ---------------
  208. Patch title: short explanation, max 72 chars
  209. A paragraph that explains the problem, and how it manifests itself. If
  210. the problem is complex, it is OK to add more paragraphs. All paragraphs
  211. should be wrapped at 72 characters.
  212. A paragraph that explains the root cause of the problem. Again, more
  213. than on paragraph is OK.
  214. Finally, one or more paragraphs that explain how the problem is solved.
  215. Don't hesitate to explain complex solutions in detail.
  216. Signed-off-by: John DOE <john.doe@example.net>
  217. ---
  218. Changes v2 -> v3:
  219. - foo bar (suggested by Jane)
  220. - bar buz
  221. Changes v1 -> v2:
  222. - alpha bravo (suggested by John)
  223. - charly delta
  224. ---------------
  225. Any patch revision should include the version number. The version number
  226. is simply composed of the letter +v+ followed by an +integer+ greater or
  227. equal to two (i.e. "PATCH v2", "PATCH v3" ...).
  228. This can be easily handled with +git format-patch+ by using the option
  229. +--subject-prefix+:
  230. ---------------------
  231. $ git format-patch --subject-prefix "PATCH v4" \
  232. -M -s -o outgoing origin/master
  233. ---------------------
  234. Since git version 1.8.1, you can also use +-v <n>+ (where <n> is the
  235. version number):
  236. ---------------------
  237. $ git format-patch -v4 -M -s -o outgoing origin/master
  238. ---------------------
  239. When you provide a new version of a patch, please mark the old one as
  240. superseded in http://patchwork.buildroot.org[patchwork]. You need to
  241. create an account on http://patchwork.buildroot.org[patchwork] to be
  242. able to modify the status of your patches. Note that you can only change
  243. the status of patches you submitted yourself, which means the email
  244. address you register in http://patchwork.buildroot.org[patchwork] should
  245. match the one you use for sending patches to the mailing list.
  246. You can also add the +--in-reply-to <message-id>+ option when
  247. submitting a patch to the mailing list. The id of the mail to reply to
  248. can be found under the "Message Id" tag on
  249. http://patchwork.buildroot.org[patchwork]. The advantage of
  250. *in-reply-to* is that patchwork will automatically mark the previous
  251. version of the patch as superseded.
  252. [[reporting-bugs]]
  253. === Reporting issues/bugs or getting help
  254. Before reporting any issue, please check in
  255. xref:community-resources[the mailing list archive] whether someone has
  256. already reported and/or fixed a similar problem.
  257. However you choose to report bugs or get help, either by
  258. opening a bug in the xref:community-resources[bug tracker] or by
  259. xref:community-resources[sending a mail to the mailing list], there are
  260. a number of details to provide in order to help people reproduce and
  261. find a solution to the issue.
  262. Try to think as if you were trying to help someone else; in
  263. that case, what would you need?
  264. Here is a short list of details to provide in such case:
  265. * host machine (OS/release)
  266. * version of Buildroot
  267. * target for which the build fails
  268. * package(s) for which the build fails
  269. * the command that fails and its output
  270. * any information you think that may be relevant
  271. Additionally, you should add the +.config+ file (or if you know how, a
  272. +defconfig+; see xref:customize-store-buildroot-config[]).
  273. If some of these details are too large, do not hesitate to use a
  274. pastebin service. Note that not all available pastebin services will
  275. preserve Unix-style line terminators when downloading raw pastes.
  276. Following pastebin services are known to work correctly:
  277. - https://gist.github.com/
  278. - http://code.bulix.org/