Skip to content

west: spdx: allow to generate for different SPDX versions #90753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025

Conversation

kartben
Copy link
Collaborator

@kartben kartben commented May 28, 2025

When support for SPDX 2.3 was added, it effectively dropped support for SPDX 2.2, which in retrospect was a bad idea since SPDX 2.2 is the version that is the current ISO/IEC standard.

This commit adds a --spdx-version option to the west spdx command so that users can generate SPDX 2.2 documents if they want.

Default is 2.3 given that's effectively what shipped for a few releases now, including latest LTS, but it could be argued it should be 2.2 as per my comment above re: it being the ISO standard.

@kartben kartben force-pushed the zpdx_22_23 branch 4 times, most recently from 2f73b5d to 5caf163 Compare June 2, 2025 08:12
@kartben kartben marked this pull request as ready for review June 2, 2025 15:32
@pdgendt
Copy link
Collaborator

pdgendt commented Jun 2, 2025

Could we try to get #90444 merged first?

@kartben kartben force-pushed the zpdx_22_23 branch 2 times, most recently from c91542b to 4a3a19e Compare June 2, 2025 18:26
@kartben
Copy link
Collaborator Author

kartben commented Jun 2, 2025

Could we try to get #90444 merged first?

I just rebased on main :)

pdgendt
pdgendt previously approved these changes Jun 3, 2025
kartben added 4 commits June 3, 2025 10:37
As reported by sonarqube, "String formatting should be used correctly"

Signed-off-by: Benjamin Cabé <[email protected]>
File passes all ruff linter checks so no exclude rules needed anymore

Signed-off-by: Benjamin Cabé <[email protected]>
Add missing error handling of some of the calls to writeSPDX().

Signed-off-by: Benjamin Cabé <[email protected]>
When support for SPDX 2.3 was added, it effectively dropped support for
SPDX 2.2, which in retrospect was a bad idea since SPDX 2.2 is the
version that is the current ISO/IEC standard.
This commit adds a `--spdx-version` option to the `west spdx` command
so that users can generate SPDX 2.2 documents if they want.
Default is 2.3 given that's effectively what shipped for a few releases
now, including latest LTS.

Signed-off-by: Benjamin Cabé <[email protected]>
Copy link

sonarqubecloud bot commented Jun 3, 2025

@kartben
Copy link
Collaborator Author

kartben commented Jun 9, 2025

@swinslow @carlescufi can you please have a look? Thanks!

Comment on lines +57 to +63
self.dbg(" --init is", args.init)
self.dbg(" --build-dir is", args.build_dir)
self.dbg(" --namespace-prefix is", args.namespace_prefix)
self.dbg(" --spdx-dir is", args.spdx_dir)
self.dbg(" --spdx-version is", args.spdx_version)
self.dbg(" --analyze-includes is", args.analyze_includes)
self.dbg(" --include-sdk is", args.include_sdk)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could've used the f-strings here:
self.dbg(" --init is {args.init}")

@kartben kartben merged commit be504b0 into zephyrproject-rtos:main Jun 10, 2025
43 checks passed
@kartben kartben deleted the zpdx_22_23 branch June 12, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants