<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4517</bug_id>
          
          <creation_ts>2013-05-20 18:25:30 +0000</creation_ts>
          <short_desc>SPDX license calculation tool</short_desc>
          <delta_ts>2025-01-09 16:30:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>configuration</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          <dependson>4516</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Beth Flanagan">elizabeth.flanagan</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>alberto</cc>
    
    <cc>bluelightning</cc>
    
    <cc>elizabeth.flanagan</cc>
    
    <cc>JPEWhacker</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>wmills</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33161</commentid>
    <comment_count>0</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2013-05-20 18:25:30 +0000</bug_when>
    <thetext>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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33165</commentid>
    <comment_count>1</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2013-05-20 18:38:12 +0000</bug_when>
    <thetext>*** Bug 2275 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94585</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-12-22 16:07:52 +0000</bug_when>
    <thetext>We think that Alberto may have some code to help in this area.
https://summit.yoctoproject.org/yocto-project-summit-2022-11/talk/CPWETR/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94598</commentid>
    <comment_count>3</comment_count>
    <who name="Alberto Pianon">alberto</who>
    <bug_when>2022-12-23 08:03:42 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; We think that Alberto may have some code to help in this area.
&gt; 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&apos;s &quot;philosophy&quot;? 
  - 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 &quot;License Oracle&quot; with some simple API, that can be configured to use one or more modules/resources to determine component&apos;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 &quot;License Oracle&quot; project (in Oniro, the &quot;oracle&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100589</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-01-09 16:30:32 +0000</bug_when>
    <thetext>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&apos;s a license identified there that is not in the recipe license list.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>