Bug 4517 - SPDX license calculation tool
Summary: SPDX license calculation tool
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: Future
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
: 2275 (view as bug list)
Depends on: 4516
Blocks:
  Show dependency tree
 
Reported: 2013-05-20 18:25 UTC by Beth Flanagan
Modified: 2025-01-09 16:30 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Flanagan 2013-05-20 18:25:30 UTC
As someone concerned with the accuracy of LICENSE data, I would like an optional inherit that trys to determine the license of downloaded src. This should WARN when a recipe's stated license is not the determined license. This should ERROR when a license file is found that is not within the LICENSE_SRC_URI.
Comment 1 Beth Flanagan 2013-05-20 18:38:12 UTC
*** Bug 2275 has been marked as a duplicate of this bug. ***
Comment 2 Randy MacLeod 2022-12-22 16:07:52 UTC
We think that Alberto may have some code to help in this area.
https://summit.yoctoproject.org/yocto-project-summit-2022-11/talk/CPWETR/
Comment 3 Alberto Pianon 2022-12-23 08:03:42 UTC
(In reply to comment #2)
> We think that Alberto may have some code to help in this area.
> https://summit.yoctoproject.org/yocto-project-summit-2022-11/talk/CPWETR/

I might, actually :)

It depends on the kind of approach we want to use here: 

- local/offline check:
  - it would require the installation some (possibly heavy) external tool(s): does that fit into Yocto's "philosophy"? 
  - it may prove difficult to determine the *main* license of a *component* (single source files may have many different licenses) unless such information is already there in some format (eg. in a package.json file or in a single, unambiguous LICENSE or COPYING file) - but implementing a license check would make more sense precisely when this is *not* the case[^1]

- online check:
  - there is a number of possible available resources (eg. Software Heritage, Clearly Defined, ScanOSS, Debian project...): each one has a different scope, philosophy, etc.
  - the check depends on the availability of such (free) remote resource(s), which may have filters to prevent too many connections

In Oniro compliance project we use a mixed approach: offline + online check + (last but not least) an experienced audit team validating the results. One of the goals of the project is sharing validated results, but for now we just share them as downloadable SPDX artifacts for each release of Oniro, we still have to implement some web service where one can search stuff through public API. 

An idea could be to develop a local "License Oracle" with some simple API, that can be configured to use one or more modules/resources to determine component's main license(s), so that the optional inherit can just ask the oracle, without the need of adding too much logic into Yocto. Many modules we developed for the Oniro compliance toolchain may (and actually, have been originally designed to) be reused in a future "License Oracle" project (in Oniro, the "oracle" idea was originally proposed by Zygmunt Krynicki and Andrei Gherzan). 

Might it be the right time to start it?


[^1]: moreover, there are cases when provided information is simply wrong - eg. https://github.com/michaeloryl/saml-encoder-decoder-js/issues/2
Comment 4 Randy MacLeod 2025-01-09 16:30:32 UTC
Still mostly a good, nice to have, feature.
The SPDX data could be used.

Joshua Watt might check if we get an error from the SPDX code if there's a license identified there that is not in the recipe license list.