Switching to Waf
From LilyPond Wiki
Contents |
[edit] What is this about?
LilyPond is a very large project with especially a huge amount of documentation, which takes a long time and is complex to build. Our current build system is based on Autoconf, GNU Make and Stepmake, a homebrew set of makefiles used as templates in makefiles in individual directories of the project. The growing of the documentation is recent (since 2007) and has shown that this build system is no longer maintainable, so we must switch to a newer build system.
Waf has been chosen as the build system that will be adopted. The discussion that led to this choice is on http://lists.gnu.org/archive/html/lilypond-devel/2009-09/msg00169.html More advocacy in favor of Waf can be found on http://code.google.com/p/waf/wiki/WafAndOtherBuildSystems and in the conclusion of the Waf book, see http://freehackers.org/~tnagy/wafbook/ch12s04.html
[edit] Migration plan
The new build system that uses Waf should satisfy a number of requirements:
- builds should be at least as reliable and efficient as current build system;
- building the documentation should be independent from building LilyPond binary: this means in particular that it should be easy to build the documentation with an external LilyPond binary, and on operating systems where LilyPond cannot be currently compiled (e.g. on MS Windows without Cygwin) -- this should be done by providing appropriate command-line options;
- the build system based on Waf should be much more maintainable than the old one;
- GUB should handle building with Waf easily, which means in particular that it will be possible to get rid of dirty hacks like smart-autogen.sh.
[edit] Support documentation build with Waf
Documentation (and the new web site that is being integrated with it) is by far the most urgent and critical part of LilyPond building to be switched to Waf. This is going to be done on a new branch dev/waf, which will be merged into master when the documentation build with Waf works at least as good as with GNU Make.
- Develop new Waf tools, see http://code.google.com/p/waf/wiki/AddingNewToolsToWaf
- Texinfo: makeinfo, texi2html, texi2pdf, including i18n support;
- LilyPond executables: lilypond, lilypond-book, etc.;
- custom maintenance scripts;
- Test these tools as they are developed by writing wscript files, with careful thinking on:
- interfering with GNU Make (which is still used to build scripts/ and python/ at this stage of the migration),
- subdirectories handling,
- maintenance scripts handling,
- add proper checks so "waf configure" checks system installed packages and configuration to build the documentation
[edit] Switch the rest to Waf
- support for waf dist/distcheck;
- build scripts/ and python/ (should be easy);
- progressively support building the rest of LilyPond.
[edit] Ongoing development tasks
- Write a Waf tool for Texinfo - started by John
- Write a Waf tool for LilyPond executables - started but currently not owned by anyone, please take over
- Implement function python/auxiliar/custom_configure.py:miss_program() - please take over, see John's recent message on -devel in thread about Waf
- Please test existing configure checks by running "waf configure"

