Google Code-In 2014
Task Preview
Waf: Fast preprocessor extension 1Copyleft Games Group

By default, the Waf libraries use a Python-based preprocessor in order to compute build dependencies in C and C++ files. While this option is portable (it works with any compiler and on any operating system), the performance can be disappointing with complex projects, in particular with boost-based ones. The goal if this task is to create the foundation for a fast Python module in C or C++ that can compute dependencies for some C files, it does not have to actually process files and can return incorrect dependencies in this stage. Yet, the extension must return Python objects based on data from the file read.

  1. Start by adding a new folder in playground/fast_preprocessor mimicking the example in demos/python
  2. Create a new Waf tool that can load the python module being built, and replace the function c_preproc.scan through monkey-patching
  3. Create an additional build group by using the example in playground/dynamic_build
  4. Have your tool loaded, verify that it is used for computing dependencies on a dummy C++ target
  5. In your Python extension, obtain data from the first line of the file read, and verify with "waf --zones=deps" that the expected data is returned.

When done, commit your changes, then create a patch by using git-format and submit an enhancement request to the Waf bug tracker on googlecode and post the resulting URL to this task.

While working on this task you should join and remain in #Waf on Freenode to get help, feedback, and guidance from mentors and other developers.

When you've done, post the resulting tool this task.