source: trunk/doc/procedures @ 13857

Revision 13857, 8.9 KB checked in by tb, 25 years ago (diff)
Recommend -P on checkouts.
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
51           changes other people may have made.  (You can do "cvs -n
52           update" if you want to see what needs to be merged in
53           without actually doing the 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
59           of several different types, prepare one patch for each type
60           of change; in particular, if you have some cosmetic changes
61           to make and some functional fixes to make, submit them as
62           two different patches if they add up to a significant
63           number of changes.  This requirement creates more work for
64           the submitter, but it greatly increases the effectiveness
65           of the review process.
66
67        4. Use "cvs diff -c -N" piped to a file to prepare your
68           changes.  (Do not cut and paste diffs from an xterm; your
69           tabs will be converted to spaces.)  If your change
70           involves lots of reindentation, you may want to also use
71           the "-w" flag to diff.
72
73        5. Look over your diffs.  Make sure you haven't been sloppy
74           about spacing, punctuation, and naming, and that you have
75           tried to conform to the guidelines in the file "standards"
76           in this directory
77
78        6. Send your diffs, along with a clear description of the
79           change you are making, to source-reviewers@mit.edu.  If the
80           diffs are very large (more than 50K), put the changes
81           somewhere world-readable (unless the source code in
82           question is restricted) and mail a pointer.
83
84        7. If you do not have write access to the source tree and
85           submitted your diff using the -w flag, submit it again
86           without the -w flag so that the full patch can be checked
87           in by someone with write 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
136           for a 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
140           at 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
168If you add a new piece of third-party software or import a new
169version, you should look over doc/third-party and see if any notes
170should be added or modified.  This file is instrumental in locating
171new versions of software.
172
173Here are some things to pay attention to when adding or updating a
174piece of third-party software:
175
176        * If the package's build system does not use autoconf, you
177          will probably need to write a Makefile.athena file telling
178          the build system how to build it.
179
180        * If the package's build system does use autoconf, you may
181          need to write a configure.athena giving special options to
182          pass to the configure script.
183
184        * Most packages will need to be taught how to use DESTDIR.
185          Make sure that DESTDIR references don't make it into the
186          installed program.
187
188        * If the package installs a file setuid, it needs to specify
189          the owner (probably "-o root" if it didn't specify one
190          before).  Likewise, a setgid program needs a specified group
191          owner, although this is usually done already.  Other than
192          that, our fix_owners program will coerce unspecified owners
193          and groups to 0.
194
195        * The package should create directories before installing
196          files in them.
197
198        * Test your package's build and install.  Preferrably, use the
199          "do" command, something like:
200
201                do prepare
202                do clean
203                do
204                do check
205                do -d /var/tmp/inst install
206
207          (Replace "do" with "sh /mit/source/packs/build/do.sh" or use
208          a shell alias.)  If the package relies on libraries, you can
209          use "-c -d /afs/dev.mit.edu/system/<sysname>/srvd-current"
210          in the non-install steps to point at them.
Note: See TracBrowser for help on using the repository browser.