Changes between Version 4 and Version 5 of WorkingConventions/Submissions

Oct 8, 2007 11:36:11 AM (8 years ago)



  • WorkingConventions/Submissions

    v4 v5  
     1= Submissions =
     3This page has been replaced by a combination or
     4 * [wiki:WorkingConventions/FixingBugs How to fix a bug in GHC]
     5 * [wiki:WorkingConventions/AddingFeatures How to add a new feature to GHC]
    3 = Submitting patches =
     7Both are referred to from [wiki:WorkingConventions].
    5 To submit patches to the GHC developers, please use {{{darcs send}}} to `[email protected]`.  You don't need any special permission to do this. 
    7 Broadly speaking there are two sorts of patches: '''bug fixes''', and '''new features'''.  We treat them differently.
    9 We have separate guidelines for proposing changes to standard libraries; see [ Library Submissions].
    11 == How to submit a bug fix ==
    13 Bug fixes always extremely welcome.  GHC is so large, and is used in such diverse ways by so many people, that we really need your help in fixing bugs, especially those that show up in specialised situations.
    15  * Follow our convention for naming patches: [wiki:WorkingConventions/Darcs#PatchNaming].
    17  * Comment your fix in the source code, and include a reference to the bug ticket number, e.g. "`#1466`" (this helps when grepping for the fix later).  It is often helpful to give a small example code fragment that demonstrates the need for your fix.  This isn't always relevant; sometimes you are fixing a plain error, but often it's more subtle than that.
    19  * Please ensure that there is a test case in the [wiki:Building/RunningTests regression-test suite] that shows up the bug, and which is fixed by your patch.  This test case should be identified in the "Test Case" field of the Trac report.
    21 == How to submit a patch for a new feature ==
    23 We welcome your involvement in making GHC able to do more.  That said, we think twice before committing new features. Here are some things to bear in mind:
    25  * Your patch does not need to be incorporated in the main GHC repository to be useful.  The joy of Darcs is that you can send it to anyone, and they can use it quite independently.
    27  * It may seem that running 'darcs apply' is practically free for us; you have done all the hard work.  But it isn't:
    28    * It effectively commits us to maintaining it indefinitely, and worrying about its interactions with existing features
    29    * We try hard to keep GHC's language design somewhat coherent.  GHC deliberately tries to host a variety of ideas, not all of which may be good, but we try to keep it under control.
    30    * We have to do quality-control on your patch; we don't want to commit un-maintainable code... or even well-written code that we can't understand.
    31    * If your patch breaks something else, we'll get blamed regardless. 
    32    * Subsequent new features have to take account of interactions with your feature.
    34  * New features should be switchable with their own flag, by default off.  We used to have just one flag `-fglasgow-exts` but nowadays we try to be much more selective.
    36  * We are much happier about features whose implementation is:   
    37    * '''Localised''': only a handful of places in the code are changed.
    38    * '''Orthogonal''': no new invariants or constraints are added that subsequent changes must bear in mind. This is really important; any change that imposes costs on later, apparently unrelated, changes is much more costly.
    40  * A new feature should come with
    41    * A '''patch name''' and '''description''' that (a) explains what the patch does, and (b) sketches how it works.  See "Patch naming" below for conventions concerning the patch name.
    42    * A '''patch to the user manual''' that documents it (part of the main source-code patch)
    43    * A '''(separate) patch to the testsuite repository''' that gives a reasonable collection of tests for the new feature.  This has to be a separate patch, because the testsuite is a separate repository.
    45  * New features should work in a way that is consistent, as far as possible, with the way that other
    46    existing GHC features work.  Adopting a variety of different styles leads to a
    47    system that is hard to learn, and complaints of the form "why doesn't it work like X?
    48    I'm familiar with X!".
    50  * Remember that GHC HQ is not heavily staffed!  It may take us a while to give your patch the attention it deserves. However, if you hear nothing for a couple of weeks then please feel free to ping us, in case your patch has slipped through the cracks.
    52 If you are working on a feature that you think you think is a candidate for including in GHC's main repository, you may want to talk to us while you are developing it.  We may well, for example, have advice about how to structure the change in a way that we're happy to incorporate in our code base.
     9Ultimately we'll delete this Submissions page.