Changes between Version 49 and Version 50 of Building/GettingTheSources


Ignore:
Timestamp:
Apr 26, 2010 12:30:40 PM (4 years ago)
Author:
simonmar
Comment:

clean up now that we have hashed repos

Legend:

Unmodified
Added
Removed
Modified
  • Building/GettingTheSources

    v49 v50  
    2626The first thing to do is install [http://darcs.net/ darcs]. 
    2727 
    28 A source tree consists of the GHC repository,  
    29 with a set of library packages in the `libraries` directory.  Each of these 
    30 libraries has its own repository: see DarcsRepositories. 
    31  
    32 If you only want to download the latest sources and aren't interested in working on GHC, then you can get ''partial'' repositories: 
     28A source tree consists of more than one repository: at the top level there is the main GHC repository, and certain subdirectories contain separate darcs repositories (the full list of darcs repositories relating to GHC is at DarcsRepositories).  To get a complete repository tree using darcs: 
    3329 
    3430{{{ 
    35   $ darcs get --partial http://darcs.haskell.org/ghc 
     31  $ darcs get --lazy http://darcs.haskell.org/ghc 
    3632  $ cd ghc 
    3733  $ chmod +x darcs-all 
    3834  $ ./darcs-all --testsuite get 
    3935}}} 
    40 The [wiki:Building/DarcsAll darcs-all script] adds the `--partial` flag by default. 
    4136 
    42 The full list of darcs repositories relating to GHC is at DarcsRepositories. 
     37Note that we use the `--lazy` flag: this tells darcs not to download the entire repository history, which can take rather a long time, but to download it on demand if you later use a darcs command that needs access to the history, such as `darcs changes`.  The [wiki:Building/DarcsAll darcs-all script] adds the `--lazy` flag by default when getting the other repositories. 
    4338 
    44 If you plan to modify GHC, then you '''must''' get repositories with full history rather than just partial repositories.  (Why?  Because darcs has some bugs that sometimes cause problems when using partial repositories for anything more than just pulling the latest patches.) 
    45 However, '''you cannot use `darcs get` to get a full GHC repository''', for two reasons: 
    46   * GHC has more than 16,000 patches and the `darcs get` will take forever.  
    47   * Darcs prior to version 2.3 has a bug concerning case-sensitivity on Windows, and ([http://www.haskell.org/pipermail/glasgow-haskell-users/2007-November/013373.html apparently]) MacOS X, which makes Darcs crash if you do `darcs get` on the full GHC repository.  You get this message 
     39Darcs has a sophisticated system of caching, which means that if you have already downloaded a GHC repository in the past, then most of the contents will probably be cached locally, so darcs won't have to download so much.  Furthermore, all the history and content will be shared with your other local repositories, saving disk space. 
     40 
     41== Making a local branch == 
     42 
     43Branches in darcs are just separate repositories, although internally they share most of their files so are cheap to make.  Once you have a local GHC repository, branching it is easy: just 
     44 
    4845{{{ 
    49 Applying patch 12 of 17349... Unapplicable patch: 
    50 Thu Jan 11 07:26:13 MST 1996  partain 
    51   * [project @ 1996-01-11 14:06:51 by partain] 
     46 $ darcs get --lazy ~/ghc ~/ghc-branch 
    5247}}} 
    53   In darcs verison 2.3 and later, `darcs get` uses the hashed repository format by default, which is not subject to the case-sensitivity bug. 
    5448 
    55 On MacOS X this can be [wiki:Building/MacOSX#Caseinsensitivity worked around using filesystem tricks].  A way to  work around the problem on any system is to follow the following steps: 
    56  0. Download a complete bundle of the required repositories first, using your browser rather than darcs. These bundles are on [http://darcs.haskell.org/] usually in three files of the form  
     49where `~/ghc` is the repository you want to branch and `~/ghc-branch` is where you want to put the branch.  Then use `darcs-all` as before to branch the rest of the repositories.  You can then use `darcs-all -r <path>` to push and pull patches between your two local repository trees. 
     50 
     51== Getting a branch == 
     52 
     53The above instructions will get the HEAD - the main trunk of GHC development.  There are also branches, from which stable releases are made.  The active branches are listed on DarcsRepositories. 
     54 
     55To get a branch, add the branch name after http://darcs.haskell.org/.  For example, to get the `ghc-6.12` branch, you would first say  
     56 
     57{{{ 
     58  $ darcs get --lazy http://darcs.haskell.org/ghc-6.12/ghc 
     59}}} 
     60 
     61and then use `darcs-all` as above to get the rest of the respositories. 
     62 
     63== Pulling new patches == 
     64 
     65The [wiki:Building/DarcsAll darcs-all] script makes it easy to pull new patches.  For example, `darcs-all pull -a` will pull all new patches from the original repository into the repository tree in the current directory. 
     66 
     67 
     68== Getting a complete repository tarball == 
     69 
     70Sometimes it's easier to download the entire set of repositories, complete with history, as a tarball and unpack it onto your system.  These bundles are on [http://darcs.haskell.org/] usually in three files of the form  
    5771   * `ghc-HEAD-2007-08-29-ghc-corelibs-testsuite.tar.bz2` (100Mbytes) 
    5872   * `ghc-HEAD-2007-08-29-ghc-corelibs.tar.bz2` (90 Mbytes) 
    5973   * `ghc-HEAD-2007-08-29-ghc.tar.bz2` (60 Mbytes) 
    60  Each of these is a subset of the previous one; pick the smallest one that has what you need. Note that you need the corelibs to build GHC; the only reason not to get a tarball that includes them is if you want to do `--partial` gets of them to save a little disk space. Of course, the dates may vary. 
    61  2. Unpack the bundle, which will create a directory called `ghc`.  You can rename this directory freely.[[BR]][[BR]] 
    62  0. Change into the new directory, and pull patches from the main GHC repository: 
     74Each of these is a subset of the previous one; pick the smallest one that has what you need.  Of course, the dates may vary.   
     75 
     76Here's how to use the bundles: 
     77 
     78 1. Unpack the bundle, which will create a directory called `ghc`.  You can rename this directory freely. 0. Change into the new directory, and pull patches from the main GHC repository: 
    6379{{{ 
    6480   $ cd ghc 
     
    113129since this is a global setting, you probably want to change it back after cloning ghc, and then set it locally for the GHC repo(s). 
    114130 
    115 == Getting a branch == 
    116  
    117 The above instructions will get the HEAD - the main trunk of GHC development.  There are also branches, from which stable releases are made.  The active branches are listed on DarcsRepositories. 
    118  
    119 To get a branch, add the branch name after http://darcs.haskell.org/.  For example, to get the `ghc-6.6` branch, you would first say  
    120  
    121 {{{ 
    122   $ darcs get --partial http://darcs.haskell.org/ghc-6.6/ghc 
    123 }}} 
    124  
    125 and then use `darcs-all` as above to get the rest of the respositories. 
    126  
    127 == Pulling new patches == 
    128  
    129 The [wiki:Building/DarcsAll darcs-all] script makes it easy to pull new patches. 
    130  
    131