Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH wrynose 0/4] spdx: fix the compiled-sources filter
@ 2026-09-17  4:24 kazuyoshi_akiyama
  2026-09-17  4:24 ` [PATCH wrynose 1/4] spdx_common: simplify get_patched_src() implementation kazuyoshi_akiyama
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: kazuyoshi_akiyama @ 2026-09-17  4:24 UTC (permalink / raw)
  To: openembedded-core
  Cc: Kazuyoshi Akiyama, Benjamin Robin, Richard Purdie,
	Mathieu Dubois-Briand

SPDX_INCLUDE_COMPILED_SOURCES is meant to filter all source files down to
only the ones that were compiled before adding them to the SBOM,
but on wrynose it doesn't work.
add_package_files() is what picks which files go into the SBOM.
It walks ${SPDXWORK} itself to get file paths,
then keeps only the ones that match the list of compiled sources
returned by get_compiled_sources().
get_compiled_sources() just returns what save_debugsources_info() stored,
and that data uses paths rooted at ${TARGET_DBGSRC_DIR}
(= /usr/src/debug/${PN}/${PV}), not the ${SPDXWORK}-rooted paths
add_package_files() compares against.
So the list get_compiled_sources() returns never matches
what add_package_files() is comparing,
and almost every file ends up marked as not compiled.
This happens for every recipe except the kernel,
which has its own special-cased path.

This isn't just a matter of the SBOM missing the right files.
sbom-cve-check uses the same match result to decide whether
a vulnerable file was actually built, for its vulnerability triage.
If the match count is always zero, that triage doesn't work either.
On yocto-6.0.2 we confirmed the misjudgment affects cpio and perl.

master already has this fixed,
and this backport brings that fix to wrynose.
b567c2f0d9 is the commit that fixes it.
Everything else in the series is a prerequisite for that patch.
Backporting b567c2f0d9 along with its prerequisites
brings wrynose's behavior in line with master.
With this, compiled sources get counted correctly,
and sbom-cve-check's triage works correctly too.

On wrynose (genericx86-64, core-image-full-cmdline),
the match rate goes from effectively zero to 93.9%.

One thing changes.
What the SBOM records as a source file name changes too.
aa44a0f0eb re-unpacks under UNPACKDIR instead of WORKDIR,
so a recorded source file name changes
(e.g. sources/acl-2.3.2/... becomes acl-2.3.2/...).
This is a change to SBOM metadata only.
The actual build output is unaffected.
Anyone diffing SBOMs across LTS point releases will see it.

Signed-off-by: Kazuyoshi Akiyama <kazuyoshi_akiyama@jp.honda>
---
Benjamin Robin (4):
      spdx_common: simplify get_patched_src() implementation
      spdx_common: modify UNPACKDIR instead of WORKDIR in get_patched_src()
      spdx_common: In get_patched_src() ensure kernel dir name to be ${BP}
      package: no longer modify paths in save_debugsources_info()

 meta/lib/oe/package.py      |  54 +++++++++----------
 meta/lib/oe/spdx30_tasks.py |   1 -
 meta/lib/oe/spdx_common.py  | 125 +++++++++++++++++++++++++++-----------------
 3 files changed, 101 insertions(+), 79 deletions(-)
---
base-commit: 9da814ca3685ada3fce46b8987f04ed3d57247b7
change-id: 20260917-backport-wrynose-8fa831054074

Best regards,
--  
Kazuyoshi Akiyama <kazuyoshi_akiyama@jp.honda>



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-08 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17  4:24 [PATCH wrynose 0/4] spdx: fix the compiled-sources filter kazuyoshi_akiyama
2026-09-17  4:24 ` [PATCH wrynose 1/4] spdx_common: simplify get_patched_src() implementation kazuyoshi_akiyama
2026-09-17  4:24 ` [PATCH wrynose 2/4] spdx_common: modify UNPACKDIR instead of WORKDIR in get_patched_src() kazuyoshi_akiyama
2026-09-17  4:24 ` [PATCH wrynose 3/4] spdx_common: In get_patched_src() ensure kernel dir name to be ${BP} kazuyoshi_akiyama
2026-09-17  4:24 ` [PATCH wrynose 4/4] package: no longer modify paths in save_debugsources_info() kazuyoshi_akiyama
2026-09-26  9:19 ` [OE-core] [PATCH wrynose 0/4] spdx: fix the compiled-sources filter Yoann Congal
2026-09-28  8:56   ` Benjamin Robin
2026-09-28  9:39     ` KAZUYOSHI AKIYAMA (秋山 和慶)
2026-09-30 15:44       ` Yoann Congal
2026-10-08 13:50 ` Yoann Congal
2026-10-08 17:01   ` Yoann Congal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox