opam lint: Add support for the full SPDX license expression when checking the license#4768
Merged
kit-ty-kate merged 2 commits intoocaml:masterfrom Aug 10, 2021
Merged
opam lint: Add support for the full SPDX license expression when checking the license#4768kit-ty-kate merged 2 commits intoocaml:masterfrom
kit-ty-kate merged 2 commits intoocaml:masterfrom
Conversation
1 task
03507a1 to
8d76894
Compare
Member
Author
|
This PR requires #4770 to be merged first. I've updated the description for a summary of the changes. This is ready to review. Current checklist for merging this includes:
|
mooreryan
added a commit
to mooreryan/bio_io
that referenced
this pull request
Mar 12, 2022
The current opam release cannot handle full SPDX license parsing. Work around it for now by specifying licenses in a list. See ocaml/opam#4768 for more info.
yawaramin
added a commit
to yawaramin/ocaml-decimal
that referenced
this pull request
Jul 29, 2023
As opam<2.2.0 doesn't support PSF-2.0 license and only 2.1.5 is released as non-alpha at the time of writing. Per ocaml/opam#4768
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4598 and #4747
Implementation details at https://github.com/kit-ty-kate/spdx_licenses
Currently during linting, opam checks that the license field is a valid SPDX license. However:
The best one can do is to use the list format to say un implicit AND/OR (e.g.
license: ["MIT" "ISC"]) and simply ignore the warning when the license isn't supported.This PR fixes all of those issues by allowing the complete SPDX license syntax: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
The syntax supports:
LicenseRef-custom-name)Compared to the current state, apart from the new feature added, this changes:
WITHoperator is parsed. Currently opam parses it in a case-insensitive manner, but the SPDX standard requires it to be case-sensitive (see https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#case-sensitivity). So licenses such asLGPL-2.1-or-later with OCaml-LGPL-linking-exceptionwill have to be renamedLGPL-2.1-or-later WITH OCaml-LGPL-linking-exceptionto fit the standard.