gpridge.build_info

Build identity: library version, SBOM digest, and dependency versions.

The build inventory is the installed CycloneDX SBOM whose SHA-256 the library embeds. The native runtime component registry (gpridge.provenance.component_registry) describes what the running process loaded; it is reported next to the build inventory, never in place of it.

read_build_info is the function. The module stays importable as gpridge.build_info; the package does not rebind that name.

Exceptions

SbomLookupError

An installed SBOM is missing or does not match the library digest.

Functions

sbom_directories(→ list[pathlib.Path])

Places an installed or just-generated SBOM may live.

read_build_info(→ dict[str, Any])

Version, SBOM digest, the build inventory, and the runtime components.

Module Contents

exception gpridge.build_info.SbomLookupError

Bases: RuntimeError

An installed SBOM is missing or does not match the library digest.

gpridge.build_info.sbom_directories(module_file: pathlib.Path | None = None) → list[pathlib.Path]

Places an installed or just-generated SBOM may live.

Search order is GPRIDGE_SBOM_DIR when it is set, the sbom directory next to this module, then <prefix>/share/gpridge/sbom for each ancestor of the module and for the interpreter prefix. A non-Python install keeps the documents under that share directory.

gpridge.build_info.read_build_info() → dict[str, Any]

Version, SBOM digest, the build inventory, and the runtime components.

dependencies are the CycloneDX components keyed by package URL and source is build-sbom. digest_verified is true when gpridge._core.build_info supplied the digest compiled from gpr_sbom_digest.h and the installed CycloneDX bytes match it.

A library built with -Dsbom=disabled embeds an empty digest. Then source is sbom-disabled, dependencies is empty, and no directory is searched: another installation’s SBOM does not describe this build. Without the extension, the first complete installed SBOM is read unverified; if there is none, SbomLookupError is raised.

runtime_components is gpridge.provenance.component_registry()’s component list, or None when the extension is not importable.