gpridge.build_info ================== .. py:module:: gpridge.build_info .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: gpridge.build_info.SbomLookupError Functions --------- .. autoapisummary:: gpridge.build_info.sbom_directories gpridge.build_info.read_build_info Module Contents --------------- .. py:exception:: SbomLookupError Bases: :py:obj:`RuntimeError` An installed SBOM is missing or does not match the library digest. .. py:function:: 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 ``/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. .. py:function:: 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.