BitBake Parser Improvements
April 21, 2026 ยท View on GitHub
Summary
Rust now ships static BitBake support for both .bb recipe files and .bbappend append files even
though the Python ScanCode reference does not currently provide a production BitBake parser.
Rust Improvements
Recipe and append-file coverage
- Rust recognizes both
.bband.bbappendfiles. .bbappendfiles participate in sibling assembly with their matching recipe instead of remaining standalone parser-only output.- Filename-derived identity supports the common
name_version.bbshape and bounded%wildcards in append filenames.
Bounded BitBake variable semantics
- Rust extracts
PN,PV,SUMMARY,DESCRIPTION,HOMEPAGE,BUGTRACKER,SECTION, and inherited classes. - Rust supports ordinary assignment operators (
=,?=,??=,:=,+=,=+,.=,=.) plus bounded override-style handling for:append,:prepend,:remove, and their legacy_append,_prepend,_removeforms. - Variable references such as
${EXTRA_DEPENDS}are preserved in raw metadata surfaces where appropriate, but unresolved dependency placeholders are not promoted into dependency purls.
License and dependency fidelity
- Rust preserves the raw
LICENSEvalue asextracted_license_statement. - Rust prefers package-specific
LICENSE:${PN}/LICENSE_${PN}declarations when present and falls back to recipe-levelLICENSEotherwise. - BitBake-specific
&/|operators are normalized for declared-license expression generation. DEPENDSandRDEPENDSvariants are extracted as build/runtime dependencies, and versioned requirements such asfoo (>= 1.2)are preserved inextracted_requirement.
Source metadata fidelity
- When a recipe declares exactly one non-local source URI, Rust promotes that entry to top-level
download_urlmetadata. - Rust extracts source checksum metadata from both inline
SRC_URIparameters and documented varflag forms such asSRC_URI[sha256sum]andSRC_URI[name.sha256sum].
Local file references and scanner ownership
- Local
LIC_FILES_CHKSUMandSRC_URIfile://...entries are emitted asfile_referencesinstead of being dropped. - Scanner assembly resolves those references relative to the manifest directory, so sibling files like patches and license texts can attach back to the assembled BitBake package.
Guardrails
- Rust does not execute BitBake, evaluate full override context, or resolve fetcher search
paths such as
FILESPATHdynamically. - The current implementation is intentionally bounded static parsing aimed at trustworthy manifest metadata recovery rather than full BitBake execution semantics.