README.txt
author jrose
Mon Sep 29 19:30:36 2008 -0700 (13 months ago)
changeset 3 81daeabfb5ac
parent 2f24d40c1b134
child 40bf6d77bfb0b
permissions -rw-r--r--
adjust bash-isms
        1 OpenJDK Multi-Language VM: The Da Vinci Machine Project
        2 
        3 This is a Mercurial patch repository.
        4 
        5   See http://openjdk.java.net/ for more information about the OpenJDK.
        6 
        7   See http://openjdk.java.net/projects/mlvm/ for more information
        8   about the Da Vinci Machine Project.
        9 
       10   See also the wiki at http://wikis.sun.com/display/mlvm/Home .
       11 
       12 == Organization
       13 
       14 The OpenJDK mlvm/mlvm repository forest is (at present) only a set of patches, not a full set of JDK sources.  The patches apply to some version of the full OpenJDK forest structure.  The structure of the mlvm forest parallels the structure of the full jdk7 sources, but each repository in mvlm is only the .hg/patches directory (of the Mercurial mq extension).  Thus, repositories under mlvm are called "patch repositories" and those under jdk7 are by contrast called "source repositories".
       15 
       16 Commits in the mlvm repositories do not update the full source trees, only the patches.  To make this clear, when a commit occurs in a patch repository, we will refer to it specifically as a "patch commit".
       17 
       18 === Patches
       19 
       20 Make sure you have enabled the Mercurial mq extension with the following lines in your ".hgrc" file:
       21 	[extensions] 
       22 	mq =
       23 
       24 All patch files must end with the suffix ".patch".
       25 
       26 Patches must not have patch headers, since they are easy to lose if patches are regenerated.
       27 
       28 All patches must be in "git" format, without file dates.  To ensure this, add the following lines to your ".hgrc" file:
       29 	[diff]
       30 	nodates=1
       31 	git=1
       32 
       33 A patch file may be accompanied by a similar file with the suffix ".txt".  This file will contain brief comments about the patch, including:
       34 * references to project documentation, if needed
       35 * draft commit comments
       36 * dependencies on other patches
       37 
       38 Patch repositories may also contain scripts and documentation.  All these non-patch files are ignored by the Mercurial patch queue, since they do not appear in the series file.
       39 
       40 Patches may be split.  Files that contribute to a split patch must all have the same prefix up to the first dot.
       41 
       42 Patches may depend on each other.  (For example, invoke dynamic may depend on method handles, which in turn may depend on anonymous classes.)  Such dependencies should be clearly stated.
       43 
       44 The patch sequence is ordered by both stability and by dependency.  If patch B is less stable than patch A, then B should come later in the series.  If B depends on A, it also must come later in the series, and A must not be less stable than B.
       45 
       46 Patches of the same name in multiple patch repositories (hotspot and jdk) are to be applied simultaneously to parallel source repositories.  Their series file elements must be kept exactly in sync.  The documenting text file for a patch does not need to be on both sides, and should not be duplicated.
       47 
       48 === Patch Guards
       49 
       50 The series file contains guard annotations for each patch.  Patches are guarded with the OpenJDK release tags that they apply to.  In this way, as the OpenJDK release advances, patches can be rebased independently from each other.  Patches must be rebased in a special-purpose "rebasing patch commit" which includes a change to the patch guard in the series file also.  Actual development must be placed in patch commits that are *not* rebasing.
       51 
       52 Each patch must have one or more positive guards, and each must be the tag of an OpenJDK build, such as "jdk7-b25".  If a patch is guarded by such a tag, it is guaranteed to apply, without rejects, to that particular OpenJDK build, and to build successfully.
       53 
       54 Each patch must have a negative guard which names that patch with a "slash" prefix.  This allows developers to control individual entries in the patch queue without editing the series file.  Editing the series file is risky, since it is under version control and shared by all developers.  By contrast, the guards file is not under version control.
       55 
       56 The following guards are also significant as negative guards on patches which do not yet have the relevant quality level:
       57 * #-buildable: the patch does not build, or iterferes with the operation of the JVM
       58 * #-testable: the patch fails to have a working test suite
       59 
       60 For normal development, the guards 'buildable' and 'testable' should be present in the guard file, as well as the OpenJDK release in use.
       61 
       62 Example series file entries:
       63 	anonk.patch #-/anonk #+jdk7-b25
       64 	meth.patch  #-/meth  #+jdk7-b25
       65 
       66 The 'qselect' command can be used to control these patches:
       67 	hg qselect jdk7-b25  # select both patches, plus any other jdk7-b25 ones
       68 	hg qselect jdk7-b25 /meth  # select anonk but not meth
       69 
       70 References:
       71 * more on guards: http://hgbook.red-bean.com/hgbookch13.html
       72 * patch rebasing procedures: http://www.selenic.com/mercurial/wiki/index.cgi/MqMerge
       73 * a good summary on rebasing: http://www.selenic.com/pipermail/mercurial/2008-February/017367.html
       74 
       75 === Multi-based Patches
       76 
       77 If a patch must be split so as to apply to several OpenJDK builds, the latest patch in the series must be a complete patch for the most recent build, and for each previous build, a temporary patches must simply track the relevant changes up to the most recent build, so as to make the newest patch apply correctly in all cases.
       78 
       79 For example, to support builds 25 and 28 behind build 30 two fixup patches are needed:
       80 	anonk.jdk7-b25-b30.patch #-/anonk #+jdk7-b25
       81 	anonk.jdk7-b28-b30.patch #-/anonk #+jdk7-b28
       82 	anonk.patch #-/anonk #+jdk7-b30 #+jdk7-b28 #+jdk7-b25
       83 
       84 Normally this will not be necessary, unless the patch provides functionality which several other patches depend on, and those patches are in different stages of rebasing.
       85 
       86 == Setting Up Your Workspace
       87 
       88 Make a directory which will contain both sets of repositories (patches and full sources), and pull everything there.  Then create symbolic links to the patch directories from the corresponding ".hg" directories of the full sources.
       89 
       90 	$ mkdir davinci
       91 	$ cd davinci
       92         $ hg fclone http://hg.openjdk.java.net/jdk7/hotspot sources
       93 	$ hg fclone http://hg.openjdk.java.net/mlvm/mlvm patches
       94 	$ bash patches/make/link-patch-dirs.sh sources patches
       95 	+ ln -s ../../../patches/hotspot sources/hotspot/.hg/patches
       96 	+ ln -s ../../../patches/jdk sources/jdk/.hg/patches
       97 	$ ls -il patches/hotspot/series sources/hotspot/.hg/patches/series
       98 	(should be identical files)
       99 	$ guards="buildable testable $(sh patches/make/current-release.sh)"
      100 	$ sh patches/make/each-patch-repo.sh hg qselect --pop $guards
      101 	$ sh patches/make/each-patch-repo.sh hg qpush -a
      102 
      103 The last command may produce output about patches being skipped.  This is correct, because the setting of $guards will ensure that only buildable and testable patches will be applied.
      104 
      105 (To apply other sets of patches, adjust the guard settings and/or use qpush to refer to specific desired patches.  Do not make permanent edits to the series file, unless they reflect true changes of development status.)
      106 
      107 TO DO: Put the details for setup and build in patches/Makefile, with a simple build target.