zephyr/scripts/west_commands/zspdx
Steve Winslow c2ae5b3bbf west: spdx: Exclude files not present after build
The list of files which are included in the `build.spdx` SPDX SBOM document
is based on the files recorded as build artifacts based on the CMake
file-based API metadata response.

In some situations, such as the case indicated in #42072, a build artifact
may be reported by CMake but no such file is present on the system
following the build. This results in the `build.spdx` SPDX SBOM being
invalid, as a result of trying to provide metadata for a non-existent
file (and specifically being unable to provide its checksum).

This commit fixes this bug by omitting files from `build.spdx` if they
do not exist on disk after the build is complete, even if the CMake
metadata claims that they should. The resulting SPDX document should
then be valid.

Fixes #42072

Signed-off-by: Steve Winslow <steve@swinslow.net>
2022-03-24 14:54:20 +01:00
..
__init__.py
cmakecache.py
cmakefileapi.py
cmakefileapijson.py everywhere: fix typos 2022-03-18 13:24:08 -04:00
datatypes.py
getincludes.py
licenses.py
sbom.py
scanner.py west: spdx: Exclude files not present after build 2022-03-24 14:54:20 +01:00
spdxids.py
util.py
walker.py west: spdx: Exclude files not present after build 2022-03-24 14:54:20 +01:00
writer.py west: spdx: Fix missing field in build results 2022-01-26 18:15:33 +01:00