Skip to content
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

Use SPDX expressions for License and Default-License #22

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

dcbaker
Copy link
Collaborator

@dcbaker dcbaker commented Nov 13, 2023

Currently CPS specifies a custom recursive array based syntax for licenses, but uses SPDX license representations. Since the time this was originally specified, SPDX has become an ISO standard, and continued to gain traction in the Open Source world. Apart from being a standard, and more likely to be directly consumable by external tools, it simplifies a build system that wishes to build it's own SPDX license information, by simply returning (ExpressionA) AND (ExpressionB).

Fixes #6

@autoantwort autoantwort mentioned this pull request Nov 29, 2023
Copy link
Collaborator

@bretbrownjr bretbrownjr left a comment

Choose a reason for hiding this comment

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

Seems like a good place to start to me.

That being said, before we call CPS stable, I think we should get CPS reviewed by at least one person with some more experience implementing SBOM features in earnest. But this PR doesn't need to wait on that requirement in my opinion.

@mwoehlke
Copy link
Member

To be clear, we're requiring anyone that actually needs to parse license information to implement a lexer to do so? We're okay with that?

@autoantwort
Copy link
Contributor

I am okay with that. Most tools can simply interpret it as string and tools that want to do fancy stuff with licenses need to parse spdx license expressions. vcpkg for example already can do this and there are existing libraries for js, java, python or go.

Copy link
Member

@mwoehlke mwoehlke left a comment

Choose a reason for hiding this comment

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

Okay, I guess I'm being dragged (kicking and screaming, you understand 😉) into accepting this in principle. I saw some minor issues; see inline comments. Also, at least one of the commits seems to be obliterated by later ones; should this be squashed? (In general, I like fine-grained commits, but this might be a little too fine-grained.)

schema-supplement.rst Outdated Show resolved Hide resolved
schema-supplement.rst Outdated Show resolved Hide resolved
schema-supplement.rst Outdated Show resolved Hide resolved
@dcbaker dcbaker force-pushed the use-spdx branch 2 times, most recently from 0115bb1 to 0804cf3 Compare March 20, 2024 21:05
@dcbaker
Copy link
Collaborator Author

dcbaker commented Mar 20, 2024

I took your inline suggestions. I also squashed the last two commits into one, and dropped the commit that fixes the names of the GPL licenses.

@mwoehlke
Copy link
Member

I also squashed the last two commits into one, and dropped the commit that fixes the names of the GPL licenses.

Okay, the current split is fine. Thank you!

BTW, although the build is "succeeding", there's a warning:

schema-supplement.rst:36: WARNING: undefined label: 'license expression'

(See inline comment with suggested fix.)

@dcbaker
Copy link
Collaborator Author

dcbaker commented Mar 20, 2024

Oops, I replaced the wrong link with your suggestion! fixed now.

schema-supplement.rst Outdated Show resolved Hide resolved
schema-supplement.rst Outdated Show resolved Hide resolved
schema-supplement.rst Show resolved Hide resolved
schema-supplement.rst Outdated Show resolved Hide resolved
Currently, SPDX license identifiers are used, but a custom composition
syntax of nested lists is used. This patch replaces that custom syntax
with full SPDX expressions. SPDX has become an ISO standard since work
on CPS began, making it a good candidate for use in CPS.

For example, the expression in the documentation using the nested list
syntax `["CC-BY-4.0", ["GPL-2.0", "LGPL-3.0-or-later"]]` would be
written as: `CC-BY-4.0 AND (GPL-2.0-only OR LGPL-3.0-or-later)`.
Copy link
Member

@mwoehlke mwoehlke left a comment

Choose a reason for hiding this comment

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

👍, thank you!

@mwoehlke mwoehlke merged commit f1d0969 into cps-org:master Mar 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using SPDX license identifiers with custom logic operators seems odd
4 participants