Bug 4516

Summary: SPDX License Manifests for Images
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Beth Flanagan <elizabeth.flanagan>
Component: configurationAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, elizabeth.flanagan, holger.behrens, mark.hatle, n3npq, randy.macleod, sgw
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 4517    

Description Beth Flanagan 2013-05-20 18:21:50 UTC
This enhancement addresses two issues.

1. As someone interested in license compliance I would like a full SPDX compliant documentation for an image. This should include: every file on an image. every file within an sdk. Basically, if it's something we could distribute, we should generate an entry for it. 

A few notes on this. First, this should be something that is optional as generating these files will be time/space concerns. Also, we need to check to see if the src of the package actually has an rdf file to utilize. If so, we should utilize that. 

2. I want an SPDX compliant manifest for an image that I could put on an image. This manifest should include the ability to link to the above files on an external web server.

I played with doing some of this manifest work a while ago (see: http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=eflanagan/license_manifest) but it certainly needs more work.
Comment 1 Beth Flanagan 2013-05-20 18:37:13 UTC
*** Bug 1778 has been marked as a duplicate of this bug. ***
Comment 2 Mark Hatle 2013-05-20 20:31:59 UTC
Do you want the manifests to be source based?  I.e. based on the SPDX description of the sources used to generate a given recipe/package?

Or do you expect further processing to derive the exact sources used to generate the file(s), and then collate those sources into a single SPDX that describes the package, image or SDK?
Comment 3 Beth Flanagan 2013-05-20 20:59:34 UTC
I can see a few use cases here:

1. I have access to a web repository of all SPDX docs for files within the packages that my image could contain. I don't want to take the time to generate all of this, so my manifest contains an entry for the package with entries for the files for the package and links to the SPDX files.

2. I want to use the metadata to create the SPDX for the packages and create a manifest that would link to this either through a http or file URI.

3. I want SPDX swabber to ignore the metadata, derive the license from the exact sources and use this to generate the manifest.
Comment 4 Mark Hatle 2013-05-20 21:07:48 UTC
The typical case that I am aware of is that a recipe can point to an SPDX that describes all of the files/sources that recipe uses.

The packages inherit this value, and simply references or includes this file.

The image / SDK then references each of the file(s) referenced by the packages that were used.

This gives a full description of all of the sources that could have been used to generate the binaries in the package(s) and thus the image/SDK.

It does NOT give an accurate description of the license of an individual binary, or the image/SDK.  Instead it gives a view of the superset of files/license for everything.
Comment 5 Beth Flanagan 2013-05-20 22:58:42 UTC
This should function not to horribly different from sstate cache/mirror when generating low-def data. The first run will of course be slow, but subsequent runs can utilize the cache and only update src that has been updated. 

Let me hash this out my idea of the use model. (this is me thinking out loud, please don't take this as anything other than that)

I run the yocto project infrastructure/autobuilder system. The autobuilder produces a lot of artifacts used by developers. Download mirrors, sstate mirror, adt repository. I would like to produce an SPDX data mirror. 

I would like to have something like this in my config:

SPDX_DATA_MIRROR = "http://spdx.yoctoproject.org/"
SPDX_DATA_DIR = "/var/www/spdx.yoctoproject.org/"
GENERATE_SPDX_DATA = "1"

# can be license to just rely on LICENSE. 
# If anything else we attempt to inherit the named bbclass.
# This allows for third party plugins

SPDX_DATA_FIDELITY = "fossology" 

During a stage in the build, we would check the SPDX_DATA_MIRROR. If the PN/PV existed:

http://spdx.yoctoproject.org/[a-z]/${PN}/${PV}/files/(rdf of every file)
                                               checksum

and some checksum hadn't changed (probably utilize SRC_URI[md5sum] or something) then we would do nothing. If it had changed, and we had set GENERATE_SPDX_DATA = "1" we would generate the new SPDX data for each file and dump it into:

/var/www/spdx.yoctoproject.org/${PN}/${PV}

We'd then utilize SPDX_DATA_MIRROR to point each entry in our manifest to the appropriate area.
Comment 6 Jeff Johnson 2015-03-25 21:49:14 UTC
I have been looking for a proof-of-concept
implementation in rpm of "metatag" (i.e. like licensing)
attached to files for several years.

I would like to be able to attach (i.e. through
something like a digest on content, or a digest
on the source files compiled/linked into a library/executable)
a licensing tag.

I would then like to apply transitive closure across
the metatarsi to objectively determine that (say)
    A file that claims to be LGPL does not use any GPL* licensed code

Interested? Mark Hatle knows how to contact me as <jbj@rpm5.org>
Comment 7 Jeff Johnson 2015-03-25 21:52:02 UTC
Ick "metatags" not "metatarsi"
Comment 8 Randy MacLeod 2023-04-13 15:08:45 UTC
Fixed by  meta/classes/create-spdx.bbclass. Open a new ER if there are gaps.
Comment 9 Randy MacLeod 2025-02-14 16:46:32 UTC
bulk change to add Saul's non-WR address.
Comment 10 Randy MacLeod 2025-02-14 16:48:26 UTC
Bulk change: Remove Saul's old WR address.