*** empty log message ***
[bpt/guile.git] / HACKING
1 Here are some guidelines for members of the Guile developers team.
2
3 Contributing Your Changes ============================================
4
5 - If you have put together a change that meets the coding standards
6 described below, we encourage you to submit it to Guile. The best
7 place to post it is guile@sourceware.cygnus.com. Please don't send it
8 directly to me; I often don't have time to look things over. If you
9 have tested your change, then you don't need to be shy.
10
11 - Please submit patches using either context or unified diffs (diff -c
12 or diff -u). Don't include a patch for ChangeLog; such patches don't
13 apply cleanly, since we've probably changed the top of ChangeLog too.
14 Instead, provide the unaltered text at the top of your patch.
15
16 Please don't include patches for generated files like configure,
17 aclocal.m4, or any Makefile.in. Such patches are often large, and
18 we're just going to regenerate those files anyway.
19
20
21 CVS conventions ======================================================
22
23 - We use CVS to manage the Guile sources. The repository lives on
24 egcs.cygnus.com, in /cvs/guile; you will need an
25 account on that machine to access the repository. Also, for security
26 reasons, egcs presently only supports CVS connections via the SSH
27 protocol, so you must first install the SSH client. Then, you should
28 set your CVS_RSH environment variable to ssh, and use the following as
29 your CVS root:
30
31 :ext:USER@egcs.cygnus.com:/cvs/guile
32
33 Either set your CVSROOT environment variable to that, or give it as
34 the value of the global -d option to CVS when you check out a working
35 directory.
36
37 For more information on SSH, see http://www.cs.hut.fi/ssh.
38
39 The Guile sources live in several modules:
40
41 - guile-core --- the interpreter, QuickThreads, and ice-9
42 - guile-doc --- documentation in progress. When complete, this will
43 be incorporated into guile-core.
44 - guile-oops --- The Guile Object-Oriented Programming System (talk to mdj)
45 - guile-tcltk --- the Guile/Tk interface
46 - guile-tk --- the new Guile/Tk interface, based on STk's modified Tk
47 - guile-rgx-ctax --- the Guile/Rx interface, and the ctax implementation
48 - guile-scsh --- the port of SCSH to guile, talk to Gary Houston
49 - guile-www --- A Guile module for making HTTP requests.
50
51 There is a mailing list for CVS commit messages; see README for details.
52
53 - We check Makefile.in and configure files into CVS, as well as the
54 files they are built from (Makefile.am, configure.in); we do not check
55 in Makefiles or header files generated by configuration scripts. The
56 general rule is that you should be able to check out a working
57 directory of Guile from CVS, and then type "configure" and "make",
58 without running any other tools.
59
60 - (Automake 1.4 only) Be sure to run automake at the top of the tree
61 with no arguments. Do not use `automake Makefile' to regenerate
62 specific Makefile.in files, and do not trust the Makefile rules to
63 rebuild them when they are out of date. Automake 1.4 will add
64 extraneous rules to the top-level Makefile if you specify specific
65 Makefiles to rebuild on the command line. Running the command
66 `autoreconf --force' should take care of everything correctly.
67
68 - Make sure your changes compile and work, at least on your own
69 machine, before checking them into the main branch of the Guile
70 repository. If you really need to check in untested changes, make a
71 branch.
72
73 - Include each log entry in both the ChangeLog and in the CVS logs.
74 If you're using Emacs, the pcl-cvs interface to CVS has features to
75 make this easier; it checks the ChangeLog, and generates good default
76 CVS log entries from that.
77
78
79 Coding standards =====================================================
80
81 - As for any part of Project GNU, changes to Guile should follow the
82 GNU coding standards. The standards are available via anonymous FTP
83 from prep.ai.mit.edu, as /pub/gnu/standards/standards.texi and
84 make-stds.texi.
85
86 - The Guile tree should compile without warnings under the following
87 GCC switches, which are the default in the current configure script:
88 -O2 -Wall -Wpointer-arith -Wmissing-prototypes
89 The only exceptions are the warnings about variables being clobbered
90 by longjmp/vfork in eval.c. (Tho' if you can figure out how to get
91 rid of those, too, I'd be happy.)
92
93 Note that the warnings generated vary from one version of GCC to the
94 next, and from one architecture to the next (apparently). To provide
95 a concrete common standard, Guile should compile without warnings from
96 GCC 2.7.2.3 in a Red Hat 5.0 i386 Linux machine. Furthermore, each
97 developer should pursue any additional warnings noted by on their
98 compiler. This means that people using more stringent compilers will
99 have more work to do, and assures that everyone won't switch to the
100 most lenient compiler they can find. :)
101
102 Note also that EGCS (as of November 3 1998) doesn't handle the
103 `noreturn' attribute properly, so it doesn't understand that functions
104 like scm_error won't return. This may lead to some silly warnings
105 about uninitialized variables. You should look into these warnings to
106 make sure they are indeed spurious, but you needn't correct warnings
107 caused by this EGCS bug.
108
109 - If you add code which uses functions or other features that are not
110 entirely portable, please make sure the rest of Guile will still
111 function properly on systems where they are missing. This usually
112 entails adding a test to configure.in, and then adding #ifdefs to your
113 code to disable it if the system's features are missing.
114
115 - When you make a user-visible change (i.e. one that should be
116 documented, and appear in NEWS, put an asterisk in column zero of the
117 start of the ChangeLog entry, like so:
118
119 Sat Aug 3 01:27:14 1996 Gary Houston <ghouston@actrix.gen.nz>
120
121 * * fports.c (scm_open_file): don't return #f, throw error.
122
123 When you've written a NEWS entry and updated the documentation, go
124 ahead and remove the asterisk. I will use the asterisks to find and
125 document changes that haven't been dealt with before a release.
126
127 - Please write log entries for functions written in C under the
128 functions' C names, and write log entries for functions written in
129 Scheme under the functions' Scheme names. Please don't do this:
130
131 * procs.c, procs.h (procedure-documentation): Moved from eval.c.
132
133 Entries like this make it harder to search the ChangeLogs, because you
134 can never tell which name the entry will refer to. Instead, write this:
135
136 * procs.c, procs.h (scm_procedure_documentation): Moved from eval.c.
137
138 Changes like adding this line are special:
139
140 SCM_PROC (s_serial_map, "serial-map", 2, 0, 1, scm_map);
141
142 Since the change here is about the name itself --- we're adding a new
143 alias for scm_map that guarantees the order in which we process list
144 elements, but we're not changing scm_map at all --- it's appropriate
145 to use the Scheme name in the log entry.
146
147 - There's no need to keep a change log for documentation files. This
148 is because documentation is not susceptible to bugs that are hard to
149 fix. Documentation does not consist of parts that must interact in a
150 precisely engineered fashion; to correct an error, you need not know
151 the history of the erroneous passage. (This is copied from the GNU
152 coding standards.)
153
154 - Make sure you have papers from people before integrating their
155 changes or contributions. This is very frustrating, but very
156 important to do right. From maintain.texi, "Information for
157 Maintainers of GNU Software":
158
159 When incorporating changes from other people, make sure to follow the
160 correct procedures. Doing this ensures that the FSF has the legal
161 right to distribute and defend GNU software.
162
163 For the sake of registering the copyright on later versions ofthe
164 software you need to keep track of each person who makes significant
165 changes. A change of ten lines or so, or a few such changes, in a
166 large program is not significant.
167
168 *Before* incorporating significant changes, make sure that the person
169 has signed copyright papers, and that the Free Software Foundation has
170 received them.
171
172 If you receive contributions you want to use from someone, let me know
173 and I'll take care of the administrivia. Put the contributions aside
174 until we have the necessary papers.
175
176 - When you make substantial changes to a file, add the current year to
177 the list of years in the copyright notice at the top of the file.
178
179
180 Helpful hints ========================================================
181
182 - [From Mikael Djurfeldt] When working on the Guile internals, it is
183 quite often practical to implement a scheme-level procedure which
184 helps you examine the feature you're working on.
185
186 Examples of such procedures are: pt-size, debug-hand and
187 current-pstate.
188
189 I've now put #ifdef GUILE_DEBUG around all such procedures, so that
190 they are not compiled into the "normal" Guile library. Please do the
191 same when you add new procedures/C functions for debugging purpose.
192
193 You can define the GUILE_DEBUG flag by passing --enable-guile-debug to
194 the configure script.
195
196 - You'll see uses of the macro SCM_P scattered throughout the code;
197 those are vestiges of a time when Guile was meant to compile on
198 pre-ANSI compilers. Guile now requires ANSI C, so when you write new
199 functions, feel free to use ANSI declarations, and please provide
200 prototypes for everything. You don't need to use SCM_P in new code.
201
202
203 Jim Blandy