Skip to content

SPDX generation does not seem to work according to the documentation #91182

@tijsmoree

Description

@tijsmoree

Describe the bug

The documentation states that for SPDX generation, we have to do the following (in case of the hello_world project):

  • west spdx -i -d BUILD_DIR/hello_world
  • west build -d BUILD_DIR/hello_world
  • west spdx -d BUILD_DIR/hello_world

With a pristine project (without the BUILD_DIR folder present), this does not work, because the third command errors without BUILD_DIR/CMakeCache.txt. I solved this issue by changing the second command to west build -d BUILD_DIR --domain hello_world instead.

Another problem I encountered, is that running west build -p will undo the west spdx -i. This means that running a pristine build negates the necessary precommand to enable SPDX file generation. I ran into this problem when I used the VSCode nRF Connect Add Build Configuration button and wanted to generate SPDX files afterwards by running west spdx -i and then rebuilding it. However, it does not rebuild, because it knows nothing changed, forcing me to build "pristinely", which also does not result in a build folder that can be used to generate SPDX files, because the west spdx -i was undone.

Regression

  • This is a regression.

Steps to reproduce

Open the hello_world example in nRF Connect SDK v2.8.0 (and remove the build folder if it exists), add the CONFIG_BUILD_OUTPUT_META=y configuration to the prj.conf file and run:

  • west spdx -i -d build/hello_world
  • west build -d build/hello_world --board nrf52840dk/nrf52840
  • west spdx -d build/hello_world

Relevant log output

parsing CMake Cache file
ERROR: CONFIG_BUILD_OUTPUT_META must be enabled to generate spdx files; bailing
ERROR: SPDX walker failed; bailing

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

  • Linux
  • Zephyr SDK v3.7.99-ncs1
  • nRF Connect SDK v2.8.0
  • nRF Connect SDK Toolchain v2.8.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug, or the PR is fixing a bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions