mozbuild.controller package

Submodules

mozbuild.controller.building module

class mozbuild.controller.building.BuildDriver(*args, **kwargs)

Bases: MozbuildObject

Provides a high-level API for build actions.

build(metrics, what=None, jobs=0, job_size=0, directory=None, verbose=False, keep_going=False, mach_context=None, append_env=None, allow_subdirectory_build=False, no_completion_messages=False)
configure(metrics, options=None, buildstatus_messages=False, line_handler=None, append_env=None)
install_tests(force=False)

Install test files.

class mozbuild.controller.building.BuildMonitor(topsrcdir, settings, log_manager, topobjdir=None, mozconfig=<object object>, virtualenv_name=None)

Bases: MozbuildObject

Monitors the output of the build.

ccache_stats(ccache=None)
finish()

Record the end of the build.

get_resource_usage()

Produce a data structure containing the low-level resource usage information.

This data structure can e.g. be serialized into JSON and saved for subsequent analysis.

If no resource usage is available, None is returned.

have_excessive_swapping()

Determine whether there was excessive swapping during the build.

Returns a tuple of (excessive, swap_in, swap_out). All values are None if no swap information is available.

have_high_finder_usage()

Determine whether there was high Finder CPU usage during the build.

Returns True if there was high Finder CPU usage, False if there wasn’t, or None if there is nothing to report.

property have_resource_usage

Whether resource usage is available.

init(warnings_path, terminal, metrics)

Create a new monitor.

warnings_path is a path of a warnings database to use.

log_resource_usage(usage)

Summarize the resource usage of this build in a log message.

on_line(line)

Consume a line of output from the build system.

This will parse the line for state and determine whether more action is needed.

Returns a BuildOutputResult instance.

In this named tuple, warning will be an object describing a new parsed warning. Otherwise it will be None.

state_changed indicates whether the build system changed state with this line. If the build system changed state, the caller may want to query this instance for the current state in order to update UI, etc.

message is either None, or the content of a message to be displayed to the user (as a str or a logging.LogRecord).

record_usage()
start()

Record the start of the build.

start_resource_recording()
stop_resource_recording()
class mozbuild.controller.building.BuildOutputManager(log_manager, monitor, footer)

Bases: OutputManager

Handles writing build output to a terminal, to logs, etc.

on_stderr_line(line)

Handle stderr output - parse for warnings/errors.

on_stdout_line(line)

Handle stdout output - log as INFO, but catch obvious warnings/errors.

class mozbuild.controller.building.BuildOutputResult(warning, state_changed, message)

Bases: tuple

message

Alias for field number 2

state_changed

Alias for field number 1

warning

Alias for field number 0

class