-
Notifications
You must be signed in to change notification settings - Fork 186
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 license mapping for SPDX format #281
Comments
Tabling until we can figure out if tern can aggregate SPDX documents produced by other tools. |
I am currently having the same problem, i want to import tern to dependency-track but most licenses are not detected correctly. i currently start building a license map which maps LicenseID to the appropriate spdx license field |
@makefu This project was created to address this issue: https://github.com/spdx/package-licenses-mapping. It's going to take a little while to create the mappings to all known licenses. PRs welcome :) |
@nishakm one issue i encountered when i started my own mapping is that a couple of LicenseIDs are not accurate enough to map to a single SPDX identifier (e.g. "gpl","lgpl+","openldap", "cc-by" or even "gplv2 with exceptions" as there are different exceptions possible). At least this is what i encountered rpm-based containers. As soon as there is some content in the repository i will consider creating PRs to add my findings 👍 |
The licenses in the SPDX tag-value SBOM output currently still use custom licenses what reference a definition like these examples:
This makes it quite a challenge for automated tools to interpret package licenses from this SBOM format, although the information appears to be available in the default Tern JSON output. Are there any plans to address this, or perhaps make life easier for automated tools that rely on SPDX input by providing the approximate SPDX license identifier as "licenseName" field? |
Sorry, can you clarify what information "appears to be available in the default Tern JSON output" that's not available in the SPDX reports?
See discussion above for challenges surrounding this. A mapping needs to exist before Tern can draw conclusions about what SPDX license might correspond to the custom licenses found. Is the example you provided an excerpt of licenses from a debian-based image by chance? Debian images get their license info using the debian-inspector library by parsing debian copyrights as debian package licenses are not available to collect using the package manager. Because these licenses are parsed from copyright text, its not always a straightforward task to translate them to SPDX licenses and this is where we see the most variance between the license text and what the corresponding SPDX license might be. However, this is also true for other base images. Looking at the Perhaps @pombredanne can weigh in if there's plans/it's possible to map debian licesnes found via debian-inspector to SPDX licenses? UPDATE: Looks like there's been lots of discussion on this already here: spdx/package-licenses-mapping#1 |
In the end we ended up dropping most mappings we were using in ScanCode, as they are in most cases not enough. See: aboutcode-org/scancode-toolkit#1895 (comment) which I am repasting partially here:
|
Describe the Feature
Currently the default way to list the licenses is using the LicenseID and adding some text to it.
This can be augmented my using a mapping of known interpretations of these license strings.
This issue in spdx-tools-python enables this: spdx/tools-python#106
Once resolved, use this module to map out license strings to SPDX license formats.
The text was updated successfully, but these errors were encountered: