source: trunk/doc/procedures @ 18524

Revision 18524, 11.3 KB checked in by ghudson, 21 years ago (diff)
Reindent using two-space indents.
Line 
1This file contains a description of the process developers should go
2through to get changes into the source tree.  Although it discusses
3the use of CVS, it is not a CVS tutorial; read the CVS info pages
4(available in M-x info in emacs on Athena) for a general introduction
5to CVS.  Areas covered in this file are:
6
7  Checking out a working directory
8  Preparing changes for review
9  Reviewing changes
10  Early checkins
11  Third-party sources
12
13You should use cvs from the gnu locker with the source repository.
14People without write access to the repository can use "cvs -u" (a
15local modification to CVS) to access the repository without making
16read locks.  If you do not have write access to the repository and you
17want to submit a change, follow the guidelines below up and including
18sending mail to source-reviewers, and note in your mail that your
19reviewer should check in the change because you cannot do so.
20
21Checking out a working directory
22--------------------------------
23
24Set CVSROOT to "/afs/dev.mit.edu/source/repository" before trying to
25check out a working directory.
26
27The entire source tree is very large.  You can check it out with "cvs
28co -P all", but in almost all cases this would be a big waste of space.
29Simply check out a subdirectory of the source tree with a command like
30"cvs co -P athena/bin/olc".
31
32CVS knows nothing about AFS permissions, so all directories created
33will have the same permissions as their parent.  It is generally
34safest to do your checkouts in a private area of the filesystem.
35
36You should use the -P option for checkout because the source tree
37contains some historical directories (now empty) which will conflict
38with builds.
39
40Preparing changes for review
41----------------------------
42
43Changes to the doc hierarchy do not typically need to be reviewed;
44notification is typically good enough, since no software will break as
45a result of changes to the source tree documentation.
46
47For changes to other parts of the tree, you should perform the
48following steps while preparing your changes for review:
49
50  1. Do a "cvs update" in your working directory to merge in changes
51     other people may have made.  (You can do "cvs -n update" if you
52     want to see what needs to be merged in without actually doing the
53     merge.)
54
55  2. Be sure to test your changes.
56
57  3. Make sure your changes are made in reviewable chunks to the
58     greatest extent possible.  If you have many changes to make of
59     several different types, prepare one patch for each type of
60     change; in particular, if you have some cosmetic changes to make
61     and some functional fixes to make, submit them as two different
62     patches if they add up to a significant number of changes.  This
63     requirement creates more work for the submitter, but it greatly
64     increases the effectiveness of the review process.
65
66  4. Use "cvs diff -u -N" piped to a file to prepare your changes.  (Do
67     not cut and paste diffs from an xterm; your tabs will be
68     converted to spaces.)  If your change involves reindentation of
69     code, you may want to also use the "-w" flag to diff.  If you
70     find that your change is clearer when presented as a context diff
71     ("-c" instead of "-u"), feel free to submit it that way.
72
73  5. Look over your diffs.  Make sure you haven't been sloppy about
74     spacing, punctuation, and naming, and that you have tried to
75     conform to the guidelines in the file "standards" in this
76     directory
77
78  6. Send your diffs, along with a clear description of the change you
79     are making, to source-reviewers@mit.edu.  If the diffs are very
80     large (more than 50K), put the changes somewhere world-readable
81     (unless the source code in question is restricted) and mail a
82     pointer.
83
84  7. If you do not have write access to the source tree and submitted
85     your diff using the -w flag, submit it again without the -w flag
86     so that the full patch can be checked in by someone with write
87     access.
88
89Ideally, at least one person will respond to your mail within a day or
90two, either expressing concerns or signing onto your change.  You
91should wait at least one day for people to voice their objections.  If
92you receive objections or requests for further information from staff
93members, you must either satisfy those concerns or resolve the issue
94with the release team before committing your change.  If after one
95day, you have received no objections and someone has signed onto your
96change, you may commit your change.  You may also commit your change
97if no one objects within five days, even if no one has signed onto it.
98
99When you check in your change, be sure to include a clear log message.
100Explain why you are making the change you are making if it's not
101obvious.
102
103Reviewing changes
104-----------------
105
106Sometimes you can review a change by looking at the patch.  Other
107times you will want to check out a tree and apply the patch, with
108"patch -E -p < message-file" if you have the mail message in a file,
109or "dsgrep -p -t trn-number source-reviewers | patch -E -p" if what
110you have is a transaction number in the source-reviewers discuss
111meeting.
112
113When reviewing a change, be sure to make your position on the change
114clear.  Say "I object to this change" if you are not merely voicing a
115concern, or "I would like these questions answered before this change
116is committed" if you have asked questions and are not merely curious.
117When your objections are responded to, you should in turn respond in a
118timely fashion saying whether your objections have been satisfied or
119not.  If the dispute appears intractable, say so, so that the issue
120may be brought up before the release team.
121
122If you have reviewed a change carefully and have found nothing wrong
123with it, and no one else has responded to the change, you should sign
124onto the change rather than remaining silent.  You are encouraged to
125try out changes before signing onto them, but in some cases the
126inconvenience outweights the benefit of this consideration.
127
128Early checkins
129--------------
130
131In some cases it may be appropriate to check in a change in advance of
132the normal review period.  The following should be true of those
133cases:
134
135  1. The change is obvious and noncontroversial, such as a fix for a
136     syntax error.
137
138  2. The problem being fixed is causing an immediate difficulty,
139     usually "I'm doing a build of /mit/source and it blows out at
140     this point."
141
142The change should still be sent to source-reviewers with a note about
143the early checkin.  If the immediate difficulty is "the wash is broken
144and I want the next wash to work," then it is good to get a positive
145review of the change before checking it in.  Close to a release cycle,
146though, that can be ignored.
147
148Third-party sources
149-------------------
150
151For modules in the third hierarchy, we generally use the "cvs import"
152command to track development from outside.  (To find out if this
153applies to a given module, to a "cvs log" of a file in the tree; if
154you see a revision 1.1.1.1, then we're using cvs import.)  Do not
155check in a new outside version of a third-party package onto the
156mainline if it was originally imported with cvs import; it's very
157difficult to recover from that particular mistake.  Do, however, check
158local changes you made yourself onto the mainline.  Always refer to
159doc/third-party before doing an import to see if there are any special
160notes on the module you are importing.
161
162Generally, you should only import "clean" third-party source trees
163with no modifications.  If you absolutely need to make changes to the
164source tree before importing it (check with a release engineer before
165deciding that you have to), make a note in the doc/third-party file so
166that people doing future imports will know about it.
167
168Before doing an import, run timestamps.pl from the repository CVSROOT
169directory.  This script helps work around the problem that CVS does
170not version metadata such as timestamps, by crunching all of the
171timestamps up near the current time while preserving their relative
172order.  Use the "-d" flag to cvs import to use the resulting
173timestamps as the time of import.
174
175Also before doing an import, remove any .cvsignore files which might
176be present in the tree.  We are builders, not developers, of
177third-party software, and want to track the entire distribution
178including any auto-generated files.
179
180Here is an example of how one might import a hypothetical new version
181of emacs (assuming the CVSROOT environment variable is set to point at
182the Athena repository):
183
184  gtar xzf emacs-22.3.tar.gz
185  cd emacs-22.3
186  find . -name .cvsignore -print | xargs rm
187  perl $CVSROOT/CVSROOT/timestamps.pl
188  cvs import -d -m "Import emacs 22.3." third/emacs vendor emacs-22_3
189
190Make sure to use the literal word "vendor" for the vendor branch name.
191
192After importing, you should take care of files which have been removed
193from one version to the next, since CVS doesn't do a good job.  Here
194is an example:
195
196  cd /tmp
197  cvs co -r vendor third/emacs
198  cd third/emacs
199  cvs update -j emacs-22_2 -j emacs-22_3
200  cvs ci -m "Not present in emacs 22.3."
201
202It is important to remove such files on the vendor branch, so that
203diffs against the vendor branch will work properly.
204
205Now you can do the merge.  Here is an example of how you might do one:
206
207  cd /tmp
208  rm -rf third/emacs
209  cvs co -kk third/emacs
210  cd third/emacs
211  cvs update -kk -j emacs-22_2 -j emacs-22_3
212  # Resolve conflicts.
213  cvs ci -m "Merge with emacs 22.3."
214
215Using a "-kk" working directory and merge will prevent merge conflicts
216based on RCS IDs; it is unnecessary for a package which does not use
217RCS keyword strings.  If the merge results in any files being deleted,
218check those files (with "cvs log") to make sure they were in fact
219modified on the mainline.  If they weren't, then some CVS oddity is
220involved.  Try using "cvs admin -bvendor filename" and then "cvs
221update filename" to make the file go away more naturally.
222
223If you add a new piece of third-party software or import a new
224version, you should look over doc/third-party and see if any notes
225should be added or modified.  This file is instrumental in locating
226new versions of software.
227
228Here are some things to pay attention to when adding or updating a
229piece of third-party software:
230
231  * If the package's build system does not use autoconf, you will
232    probably need to write a Makefile.athena file telling the build
233    system how to build it.
234
235  * If the package's build system does use autoconf, you may need to
236    write a configure.athena giving special options to pass to the
237    configure script.
238
239  * Most packages will need to be taught how to use DESTDIR.  Make
240    sure that DESTDIR references don't make it into the installed
241    program.
242
243  * If the package installs a file setuid, it needs to specify the
244    owner (probably "-o root" if it didn't specify one before).
245    Likewise, a setgid program needs a specified group owner, although
246    this is usually done already.  Other than that, our fix_owners
247    program will coerce unspecified owners and groups to 0.
248
249  * The package should create directories before installing files in
250    them.
251
252  * Test your package's build and install.  Preferrably, use the "do"
253    command, something like:
254
255      do prepare
256      do clean
257      do
258      do check
259      do -d /var/tmp/inst install
260
261    (Replace "do" with "sh /mit/source/packs/build/do.sh" or use a
262    shell alias.)  If the package relies on libraries, you can use "-c
263    -d /afs/dev.mit.edu/system/<sysname>/srvd-current" in the
264    non-install steps to point at them.
Note: See TracBrowser for help on using the repository browser.