mate.build.build module

exception mate.build.build.CPGBuildError(build_id: str, message: str)

Bases: mate_common.error.MateError

An exception denoting a CPG build-specific error during a MATE build.

Parameters
  • build_id (str) –

  • message (str) –

Return type

None

build_id: str
classmethod from_process_error(cpe: subprocess.CalledProcessError, build_id: str) mate.build.build.CPGBuildError
Parameters
  • cpe (subprocess.CalledProcessError) –

  • build_id (str) –

Return type

mate.build.build.CPGBuildError

message: str
mate.build.build.build_artifact(artifact: mate_query.db.Artifact, build: mate_query.db.Build, session: sqlalchemy.orm.session.Session, options: mate_common.models.builds.BuildOptions) None

Run the MATE CPG build pipeline for the given artifact, which is assumed to be the bitcode output of the compilation pipeline.

The CPG build pipeline produces a series of artifacts, each of which is associated with the given build.

Parameters
Return type

None

mate.build.build.limit_virtual_memory(max_virtual_memory: Bytes = 34359738368) None
Parameters

max_virtual_memory (Bytes) –

Return type

None

mate.build.build.populate_graph(cpg_jsonl: Iterable[Dict[Any, Any]], session: sqlalchemy.orm.session.Session, build: mate_query.db.Build, *, validate: bool = False) mate_query.db.Graph

Given an iterable of CPG records and a db.Build, attempt to construct a db.Graph for those records and associate it with the build.

Parameters
  • cpg_jsonl (Iterable[Dict[Any, Any]]) –

  • session (sqlalchemy.orm.session.Session) –

  • build (mate_query.db.Build) –

  • validate (bool) –

Return type

mate_query.db.Graph