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