Chapter 11. Using the development version

Table of Contents

Tracing the execution
Benchmarking
Profiling
Tracing parallel task execution
Obtaining the latest source code
Programming constraints

Tracing the execution

The generic flags to add more information to the stack traces or to the messages is -v (verbosity), it is used to display the command-lines executed during a build:

$ waf -v
			

To display all the traces (useful for bug reports), use the following flag:

$ waf -vvv
			

Debugging information can be filtered easily with the flag zones:

$ waf --zones=action
			

Tracing zones must be comma-separated, for example:

$ waf --zones=action,envhash,task_gen
			

The Waf module Logs replaces the Python module logging. In the source code, traces are provided by using the debug function, they must obey the format "zone: message" like in the following:

Logs.debug("task: task %r must run as it was never run before or the task code changed" % self)
			

The following zones are used in Waf:

Table 11.1. Debugging zones

ZoneMeaning
runnercommand-lines executed (enabled when -v is provided without debugging zones)
task_gentask creation (from task generators)
actionfunctions to execute for building the targets
envenvironment contents
envhashhashes of the environment objects - helps seeing what changes
buildbuild context operations such as filesystem access
depsimplicit dependencies found (task scanners)