In manual.css, declaring styling for pre.example-preformatted, which seems to be...
[maxima/cygwin.git] / README.developers-howto
blob5d9d24e6f82d20d01bbea3708b7ba612f79cf2db
1   Maxima project Git / build system HOWTO
4   1  General
6       Makefile.am is the file to modify, NOT Makefile
7       (Makefile is generated automatically from Makefile.am)
9       "make install" catches Makefile problems
10       that are not detected by "make" alone
12       Adding / removing files often leads to Makefile problems
14       To update your repository, execute
15       git pull  # assuming origin/master points to the SF Maxima repo
17       Workflow with Git:
18       git pull                      # update your repo
19       git checkout master           # work off master
20       git checkout -b scratch-pad   # create a working branch
21       <do development, tests, commits, then, once satisfied...>
22       git checkout master           # put yourself on master branch
23       git pull                      # update your repo, again
24       git merge scratch-pad         # merge development work into master
25       git push origin master        # push to SF Maxima repo
27       BE SURE NOT TO PUSH YOUR SCRATCH-PAD!
29   2  Renaming something in Git
31       --  Create a scratch/development branch as in 1.
32   
33       --  git mv X Y
34           This moves X to Y and preserves the history.
35           Like any other change, this needs to be committed
36           as a separate step.
38   3  Adding / removing a file in maxima/src
40       --  Create a scratch/development branch as in 1.
41   
42       --  Add new file X, then execute
43           git add X; git commit -m 'Message' -- X
45       --  Remove old file X
46           git rm X
47           Then execute "git commit" as above
49       --  Add / remove file name from maxima/src/Makefile.am
51       --  Add / remove file name from maxima/src/*-depends.mk
53           NOTE: There are several *-depends.mk files. These are
54           theoretically updated automatically but to the best
55           of my knowledge it is necessary to fix them by hand.
57       --  Add / remove file name in maxima/src/maxima.system
59       --  Verify that
60           "sh bootstrap; ./configure --enable-foolisp; make; make install"
61           and "run_testsuite();" all succeed
63       --  If the change affects the plotting routines: Verify that
64           tests/testbench_draw_manual.wxm still holds the right
65           results.
67       --  If the change affects drawdf() or plotdf(): Verify that
68           tests/testbench_drawdf_manual.wxm still holds the right
69           results.
70           
71       --  Merge your work onto master and push the changes as in 1.
74   4  Adding / removing a file in maxima/share
76       --  Copy new file / remove old file
77           as you did in 3.
79       --  Add / remove file name in maxima/share/Makefile.am
81       --  Verify that
82           "sh bootstrap; ./configure --enable-foolisp; make; make install"
83           and "run_testsuite();" all succeed
85       --  If the change affects the plotting routines: Verify that
86           tests/testbench_draw_manual.wxm still holds the right
87           results.
88           
89       --  Merge your work onto master and push the changes as in 1.
92   5.1  Creating a new share package
94        E.g., new package name = my_package
96       -- Naming conventions:
98          write_long_names_like_this, andNotLikeThisPlease,
99          norlikethiseitherthanks
101          spell_out_names, dnt_try_sv_typng_w_abbrvs_tnx
103       -- Create a new directory my_package
105       -- Put Lisp and/or Maxima files in the directory
107          At least one file must be named my_package.lisp or my_package.mac
108          Otherwise load(my_package) fails
110       -- Create texinfo documentation file my_package.texi
111          (PLEASE CREATE DOCUMENTATION, THANK YOU)
113          my_package.texi goes in maxima/doc/info
114          (same as other texinfo files)
116          Use maxima/share/template.texi as a template for my_package.texi
118       -- Create test file rtest_my_package.mac
119          (PLEASE CREATE A TEST FILE, THANK YOU)
121          Test file contains pairs of expressions:
122          input expression, then expected result
124          batch("my_package/rtest_my_package.mac", test);
125          executes the test
128   5.2  Adding a directory in maxima/share
129   
130       --  Create a scratch/development branch as in 1.
132       --  Make the new directory and put the new files in it
134       --  Add the all the files in your new directory and commit this change:
135           git add .
136           git commit -m 'Message' -a
138       --  Put the my_package files on the file list of maxima/share/Makefile.am
140       --  Add my_package to SHARE-SUBDIRS-LIST in maxima/src/init-cl.lisp
142       --  Move my_package.texi to maxima/doc/info
144           Put my_package.texi on the list of files in
145           maxima/doc/info/Makefile.am
147           Put my_package on the list of topics in maxima/doc/info/include-maxima.texi.in
148           See instructions in comments at top of maxima/share/template.texi
150       --  Verify that
151           "sh bootstrap; ./configure --enable-foolisp; make; make install"
152           and "run_testsuite();" all succeed
154       --  Commit and push your work as in 1.
157   6  Adding / removing a file in maxima/tests
159       --  Create a scratch/development branch as in 1.
161       --  Copy new file / remove old file
162           and execute "git add" / "git rm"
164       --  Add / remove file name in maxima/tests/Makefile.am
166       --  Add / remove file name in maxima/tests/testsuite.lisp
168       --  Verify that
169           "sh bootstrap; ./configure --enable-foolisp; make; make install"
170           and "run_testsuite();" all succeed
172       --  Commit and push your work as in 1.
175   7  Updating the website
177     See the Git repository "website", particularly "README.md" there.
180   8.1  Backups of Git
182     All you need is the rsync tool and some disk space.
184     Issue the following command:
186     rsync -av 'rsync://maxima.git.sourceforge.net/gitroot/maxima/*' .
189   8.2  Backups of the ML subscribers list
191     You need to be a list admin to do that. Other then that you only
192     need a mail client to send mailman commands to
193     maxima-request@math.utexas.edu
195     The command to get the subscribers list is "who" followed by the
196     list admin password. Sending an empty mail with "who XXX" in the
197     subject line should be enough.
199     I have the following cron.weekly script to do this automatically:
201     | #! /bin/sh
202     | 
203     | su myuser -c "echo end | mail -s \"who password\" maxima-request@math.utexas.edu"
206   8.3  Other Backups
208     Backups of the following stuff would be nice too:
210     - wiki
212     - bug database
215   9  Releases
217   9.1  Release policies
219     Releases are prepared (nominally) three times a year, on April 1,
220     August 1, and December 1. Releases simply package whatever seems
221     stable at that time.
223     It is the responsibility of developers (not the release
224     administrator) to copy bug fixes from the release branch to master
225     or vice versa (it doesn't matter whether bug fixes are introduced
226     on one branch or the other).
228     I don't recommend major changes on a release branch, but there is
229     really nothing to stop it. As always I'll appeal to good judgement.
231     If I've forgotten some step, please add it to this document.
233   9.2  Release numbering
235     The first release on the 5.mm release branch is 5.mm.0, the second
236     is 5.mm.1, third 5.mm.2, etc. The highest number on the branch is
237     the "best" or, at least, the most committed-to version. There is no
238     release candidate numbering.
240     The version major number has been 5 for many years. If you feel like
241     changing it to, say, 6, well, there's nothing to stop you.
243   9.3  Changelog
245     The changelog for 5.mm is named ChangeLog-5.mm.md (the suffix .md
246     indicating that it is in so-called "markdown" format). To obtain the
247     raw material for the changelog:
249     $ git log branch-5.${mm-1}-base..HEAD
251     Use the git-log output as the basis for ChangeLog-5.mm.md. Use your
252     best judgement as to what to include; the git-log output is
253     typically much, much larger than the changelog. Look at previous
254     changelogs to see the markdown format and organization.
256     Commit ChangeLog-5.mm.md to master. Don't forget to add it to 
257     the top level "Makefile.am" so that it will be included in the
258     release tarball.
260   9.4  Verifying the functionality of the maxima tarball
262     The autotools offer a few make targets that allow to verify the
263     maxima release:
265     $ make pdf
266     isn't done automatically on "make all" so it is good to test if this
267     make target works.
268     
269     $ make check
270     runs the standard testsuite, the testsuite for the share packages
271     and the tests for the ask_* functions for all lisps maxima is compiled
272     with and returns an error if any test unexpectedly failed.
274     $ make distcheck
275     compiles maxima, builds a release tarball, extracts this tarball,
276     compiles it and runs "make check" on it in order to find out if
277     "make dist" has produced a working tarball no files are missing from.
279     $ mkdir build
280     $ ../configure
281     $ make
282     $ make distcleancheck
283     tests if "make disclean" brings maxima back into the original state.
284     this is very handy when building debian packages.
285     
286     make installcheck
287     $ tests if "make install" results in a working maxima release.
289     Note that with Ubuntu Cosmic/Disco in Jan 2019 still only the first
290     two of these make targets run without errors.
292   9.5  Git commands for releases
294     Release versions live on a branch named branch-5_mm, and are tagged
295     5.mm.0, 5.mm.1, 5.mm.2, etc. The Git tag must be the same as the
296     version number declared to autoconf.
298     $ git checkout master
299     $ git tag -a branch-5_mm-base
300     $ git push --tags origin master
301     $ git checkout -b branch-5_mm
302     $ <edit configure.ac to set version number to 5.mm.0>
303     $ git add configure.ac && git commit
304     $ git tag -a 5.mm.0
306     <at this point, verify that you can build packages BEFORE you push>
308     $ git push --tags origin branch-5_mm-base
309     $ git checkout master
310     $ <edit configure.ac to set version number to 5.${mm-1}post>
311     $ git add configure.ac && git commit
312     $ git push origin master
314     Repeat 5.mm.0 stuff (edit configure.ac and tag) for 5.mm.1, 2, 3, ....
316     To copy bug fixes from one branch to another:
318     $ git cherry-pick -x <commit hash>
320   9.6  Building a release
322     $ git checkout branch-5_mm
323     $ sh bootstrap
324     $ ./configure
325     $ make dist-gzip
327     At this point you now have maxima-5.mm.nn.tar.gz.
328     
329     Binaries for Linux are traditionally created by RPM.
331     I'll assume you know how to build stuff with RPM. Copy the tar.gz
332     to <path to rpm build tree>/SOURCES/. Then:
334     $ rpmbuild -ba maxima.spec
336     Debian packages can be built the following way:
338     - Install clisp, sbcl, gcl, ecl and debhelper.
339     - checkout the branch DebianPackaging
340     - Update the changelog contained in its debian directory: From there the
341       e-mail address of the packager and the version number of the Debian
342       package are taken. It also is important that gpg knows the private key
343       for the e-mail address mentioned in the last ChangeLog entry.
344     - copy the debian directory into the directory containing the contents of
345       the release tarball.
346     - cd into this directory and type:
347       $ debuild
348     - debuild will now complain that the source is missing and tell under which
349       names it will accept the tarball. Rename the tarball to this name and start
350       debuild again.
351     - a few minutes later gpg will ask for the key's password in order to sign
352       the newly built packages.
354     Unfortunately just using the Debian package included in the autotools won't
355     equip the Maxima package it generates with the metadata that allows to
356     install the wxMaxima package shipped with Debian and Ubuntu.
357     
358   9.7  Uploading files
360     $ sftp mysfusername,maxima@frs.sourceforge.net
361     > cd /home/frs/project/m/ma/maxima
362     > cd Maxima-Linux
363     > mkdir 5.mm.nn-Linux
364     > cd 5.mm.nn-Linux
365     > lcd /path/to/rpms
366     > put maxima-*5.mm.nn*.rpm
367     > cd ..
368     > mkdir 5.mm.nn-source
369     > cd 5.mm.nn-source
370     > lcd /path/to/tar.gz
371     > put maxima-5.mm.nn.tar.gz
372     > quit
374   9.8  Announcements
376     Post an announcement about every 5.mm.nn release to the Maxima
377     mailing list. When it seems stable enough (i.e. no immediate plans
378     to create another release) feel free to announce it in other forums,
379     e.g. sage-devel.
381     Since wxMaxima does do a simultaneous release with Maxima and
382     windows installers containing wxMaxima and maxima are usually
383     published within hours of the new Maxima release the wxMaxima
384     developers beg to be informed in advance about the planned release
385     date. Filing a ticket at https://github.com/wxMaxima-developers/wxmaxima/issues
386     or sending the project maintainer an email should be sufficient
387     for this task.