SML/NJ SVN Howto

The repository now hosts a number of semi-independent toplevel trees: ... and so forth

To compile and install SML/NJ, one needs to create a root directory (of arbitrary name, let's call it "root" for the purpose of this explanation) and then populate it with various sub-trees by checking out parts of this repository (and potentially other repositories). The default layout populates root with:

(Not all of these trees are always necessary.)

Suppose we have added the following shell definitions to our environment:

   gf=https://smlnj-gforge.cs.uchicago.edu/svn
   smlnj=$gf/smlnj

By default, a working copy of tree T is obtained by performing

   svn co $smlnj/T/trunk T
There currently are two exceptions to this:
   svn co $smlnj/sml/trunk base
   svn co $gf/ml-lpt/ml-lpt ml-lpt
To simplify the creation of the default layout one can use the scripts in $gf/admin. Do:
   svn co $smlnj/admin admin
and put the admin directory in your shell's PATH. To create the default layout, you can now run
   checkout-all.sh root
which creates the root directory and populates it as described above. Without the optional argument, checkout-all.sh populates the current directory.

To perform svn update on all subtrees, run

   refresh-all.sh
from within root. Similarly, to perform svn stat on all subtrees, use stat-all.sh.

Commits should be done on a per-tree basis by hand.

Recipies

The following are more detailed recipies for performing typical tasks.

I. Preparation

Assume that the path for your local smlnj development directory is the value of shell variable SMLDEV (e.g. in my case, SMLDEV=~/sml/Dev).
  1. define some shell variables
      $ export gf=https://smlnj-gforge.cs.uchicago.edu/svn
      $ export smlnj=$gf/smlnj
    
  2. In your $SMLDEV directory, create a directory gf
      $ cd $SMLDEV
      $ mkdir gf
    
  3. Go to gf and checkout the admin directory
      $ cd gf
      $ svn co $smlnj/admin
    
    This creates subdirectory gf/admin containing some shell scripts to automate checking out the full source code, checking status, etc.
  4. Add $SMLDEV/gf/admin to your shell PATH.

Of course, you could put this checkout somewhere else, such in your personal bin file, or in /usr/local/bin if you have permission. In this case, step 4 would not be necessary.

II. To check out a working copy of the trunk smlnj code and build the compiler

  1. Assuming you are in your development directory, create a working directory and check out the required top level subdirectories. This can be done in one step by giving checkout-all.sh a directory name as an argument, e.g.:
      $ checkout-all.sh smlnj
    
  2. Change to the new working directory and run the install script:
      $ cd smlnj
      $ config/install.sh
    
  3. If you do not have an existing ml-yacc in your PATH, then this may fail because of the order in which svn checks out certain ml-yacc source files. In this case, you can recover by executing
      $ touch ml-yacc/src/yacc.grm.sig ml-yacc/src/yacc.grm.sml
    
    to make these younger than ml-yacc/src/yacc.grm. This is a temporary problem until the build scripts are modified to take care of this.

III. To check out a private development branch

In this example, the branch is named primop-branch-3, and is based on the top-level repository directory $smlnj/sml.

  1. To check what branches exist under a top-level directory, like sml (= base), do
      $ svn list $gf/sml/branches/
    
  2. Create target directory, here called primop3, and change to it.
      $ mkdir primop3
      $ cd primop3
    
  3. In the target primop3 directory do
      $ svn co https://smlnj-gforge.cs.uchicago.edu/svn/smlnj/sml/branches/primop-branch-3
    
    or (given the definition of shell variable smlnj from part I above)
      $ svn co $smlnj/sml/branches/primop-branch-3 base
    
    This checks out the primop-branch-3 code for the sml directory, locally renamed as "base".
  4. Run checkout-all.sh to get the rest of the source code (assuming gf/admin has been added to the PATH)
      $ checkout-all.sh
    
  5. Run config/install.sh to build the compiler.

David MacQueen
Last modified: Fri Dec 8 12:53:01 CST 2006