BuiltImage.not_affected is empty for SPDX 2.2. Built::statements order: Yocto's cve-check verdict, then the SPDX 3.0 not-affected statement (justification mapped onto our VEX justifications), then the fixed list, then the recipe in the tree.
read_build_outputs recognises an SPDX 3 document by its @context before the cve-check check (both are JSON). The run note names all three accepted forms.
The 2.2 reader's component construction is shared (yocto_spdx::component, ComponentFacts) with no change in output. license() is pub(crate).
Docs (guide/yocto): what to upload for SPDX 3.0, and the tier table now reads tier 2 as done (SPDX 2.2/3.0, cve-check, the kernel report from #858, with or without layers from #857).
Sample
ferrite (Scarthgap 5.0.21, core-image-minimal, qemuarm64), rebuilt with create-spdx-3.0. Nothing recompiled: 3,702 of 5,680 tasks came from the cache, the rest were SPDX tasks. The image document is 6.5 MB and has 9,663 elements, including 100 installed packages, 252 fixed and 81 not-affected assessments.
The fixture fixtures/yocto/core-image-minimal-qemuarm64.rootfs.spdx3.json (124 KB) is a trimmed copy:
6 recipes (busybox, glibc as libc6+ldconfig, openssl, libxml2, base-files, packagegroup-core-boot) with their licences and VEX;
one installed package without its element.
There are no files and no local paths.
Tests
Unit tests (yocto_spdx3.rs, yocto_build.rs):
components, versions, CPE, licence, Built, the package grouping;
fixed and not-affected per recipe;
the dangling package;
recognition by the first bytes;
statement order with a glibc CVE settled not affected and a busybox CVE fixed.
#150: SPDX 3.0. Tracker #167.
## Why
From Styhead (5.1) on, Yocto writes the image SBOM as SPDX 3.0 JSON-LD (`create-spdx-3.0`), and Scarthgap can already do so. #852 reads only SPDX 2.2.
## What
**`pipeline::yocto_spdx3`** reads `<image>.spdx.json`, one graph per image, into the same `BuiltImage` as #852:
| SPDX 3.0 | becomes |
|---|---|
| `software_Package` with purpose `archive`, output (`hasOutput`) of the rootfs `build_Build` | the image |
| that build's `hasInput` packages (purpose `install`) | what is installed |
| `build_Build` `<recipe>:do_create_spdx:recipe` → `hasOutput` | the package's recipe: one component per recipe |
| `software_packageVersion`, `externalIdentifier` cpe23, `software_homePage` | version, CPE, homepage |
| `hasConcludedLicense` → `simplelicensing_LicenseExpression` | licence |
| `security_Vulnerability` + `fixedIn` | `fixed` |
| `doesNotAffect` (+ `security_justificationType`, `security_impactStatement`) | new `not_affected` |
- `BuiltImage.not_affected` is empty for SPDX 2.2. `Built::statements` order: Yocto's cve-check verdict, then the **SPDX 3.0 not-affected statement** (justification mapped onto our VEX justifications), then the fixed list, then the recipe in the tree.
- `read_build_outputs` recognises an SPDX 3 document by its `@context` before the cve-check check (both are JSON). The run note names all three accepted forms.
- The 2.2 reader's component construction is shared (`yocto_spdx::component`, `ComponentFacts`) with no change in output. `license()` is `pub(crate)`.
- **Docs** (`guide/yocto`): what to upload for SPDX 3.0, and the tier table now reads tier 2 as done (SPDX 2.2/3.0, cve-check, the kernel report from #858, with or without layers from #857).
## Sample
`ferrite` (Scarthgap 5.0.21, `core-image-minimal`, qemuarm64), rebuilt with `create-spdx-3.0`. Nothing recompiled: 3,702 of 5,680 tasks came from the cache, the rest were SPDX tasks. The image document is 6.5 MB and has 9,663 elements, including 100 installed packages, 252 fixed and 81 not-affected assessments.
The fixture `fixtures/yocto/core-image-minimal-qemuarm64.rootfs.spdx3.json` (124 KB) is a trimmed copy:
- 6 recipes (busybox, glibc as libc6+ldconfig, openssl, libxml2, base-files, packagegroup-core-boot) with their licences and VEX;
- one installed package without its element.
There are no files and no local paths.
## Tests
Unit tests (`yocto_spdx3.rs`, `yocto_build.rs`):
- components, versions, CPE, licence, `Built`, the package grouping;
- fixed and not-affected per recipe;
- the dangling package;
- recognition by the first bytes;
- statement order with a glibc CVE settled not affected and a busybox CVE fixed.
CI only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
With create-spdx-3.0 (the default from Styhead 5.1, available in
Scarthgap) a build writes one JSON-LD document per image,
<image>.spdx.json. pipeline::yocto_spdx3 reads it into the same
BuiltImage as the SPDX 2.2 reader (#852):
- the image is the archive package output by the rootfs build; its
installed packages are that build's inputs (hasInput);
- each package's recipe is the build <recipe>:do_create_spdx:recipe that
outputs it; version, CPE and homepage come from the package, the
licence through hasConcludedLicense;
- the build's VEX: fixedIn becomes the fixed list, doesNotAffect a new
not_affected list with its justification and impact statement.
Built takes the not-affected statements after Yocto's cve-check verdict
and before the fixed list and the recipes. The scan recognises an SPDX
3 document among the build outputs by its @context. The 2.2 reader's
component construction is shared (yocto_spdx::component).
The fixture is a trimmed copy of a real Scarthgap 5.0.21
core-image-minimal (qemuarm64) built with create-spdx-3.0: six recipes,
their licences and VEX, and one installed package without its element.
guide/yocto: what to upload for SPDX 3.0; tier 2 is done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang
merged commit 3d7deee4a8 into main2026-11-05 00:30:36 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
#150: SPDX 3.0. Tracker #167.
Why
From Styhead (5.1) on, Yocto writes the image SBOM as SPDX 3.0 JSON-LD (
create-spdx-3.0), and Scarthgap can already do so. #852 reads only SPDX 2.2.What
pipeline::yocto_spdx3reads<image>.spdx.json, one graph per image, into the sameBuiltImageas #852:software_Packagewith purposearchive, output (hasOutput) of the rootfsbuild_BuildhasInputpackages (purposeinstall)build_Build<recipe>:do_create_spdx:recipe→hasOutputsoftware_packageVersion,externalIdentifiercpe23,software_homePagehasConcludedLicense→simplelicensing_LicenseExpressionsecurity_Vulnerability+fixedInfixeddoesNotAffect(+security_justificationType,security_impactStatement)not_affectedBuiltImage.not_affectedis empty for SPDX 2.2.Built::statementsorder: Yocto's cve-check verdict, then the SPDX 3.0 not-affected statement (justification mapped onto our VEX justifications), then the fixed list, then the recipe in the tree.read_build_outputsrecognises an SPDX 3 document by its@contextbefore the cve-check check (both are JSON). The run note names all three accepted forms.yocto_spdx::component,ComponentFacts) with no change in output.license()ispub(crate).guide/yocto): what to upload for SPDX 3.0, and the tier table now reads tier 2 as done (SPDX 2.2/3.0, cve-check, the kernel report from #858, with or without layers from #857).Sample
ferrite(Scarthgap 5.0.21,core-image-minimal, qemuarm64), rebuilt withcreate-spdx-3.0. Nothing recompiled: 3,702 of 5,680 tasks came from the cache, the rest were SPDX tasks. The image document is 6.5 MB and has 9,663 elements, including 100 installed packages, 252 fixed and 81 not-affected assessments.The fixture
fixtures/yocto/core-image-minimal-qemuarm64.rootfs.spdx3.json(124 KB) is a trimmed copy:There are no files and no local paths.
Tests
Unit tests (
yocto_spdx3.rs,yocto_build.rs):Built, the package grouping;CI only.
🤖 Generated with Claude Code