You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmz007 36ed224bac
Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
1 year ago
..
cmd Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
projectmetadata Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
testfs Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
Android.bp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.md Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
condition.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
condition_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
conditionset.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
conditionset_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
doc.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
go.mod Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
go.sum Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
graph.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
noticeindex.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_policy.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_policy_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolve.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolve_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolvenotices.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolvenotices_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolveprivacy.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolveprivacy_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolveshare.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_resolveshare_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_shareprivacyconflicts.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_shareprivacyconflicts_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_shipped.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_shipped_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_walk.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
policy_walk_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
readgraph.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
readgraph_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
resolution.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
resolutionset.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
resolutionset_test.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
test_util.go Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago

README.md

Compliance

Package compliance provides an approved means for reading, consuming, and analyzing license metadata graphs.

Assuming the license metadata and dependencies are fully and accurately recorded in the build system, any discrepancy between the official policy for open source license compliance and this code is a bug in this code.

Naming

All of the code that directly reflects a policy decision belongs in a file with a name begninning policy_. Changes to these files need to be authored or reviewed by someone in OSPO or whichever successor group governs policy.

The files with names not beginning policy_ describe data types, and general, reusable algorithms.

The source code for binary tools and utilities appears under the cmd/ subdirectory. Other subdirectories contain reusable components that are not compliance per se.

Data Types

A few principal types to understand are LicenseGraph, LicenseCondition, and ResolutionSet.

LicenseGraph

A LicenseGraph is an immutable graph of the targets and dependencies reachable from a specific set of root targets. In general, the root targets will be the artifacts in a release or distribution. While conceptually immutable, parts of the graph may be loaded or evaluated lazily.

Conceptually, the graph itself will always be a directed acyclic graph. One representation is a set of directed edges. Another is a set of nodes with directed edges to their dependencies.

The edges have annotations, which can distinguish between build tools, runtime dependencies, and dependencies like 'contains' that make a derivative work.

LicenseCondition

A LicenseCondition is an immutable tuple pairing a condition name with an originating target. e.g. Per current policy, a static library licensed under an MIT license would pair a "notice" condition with the static library target, and a dynamic license licensed under GPL would pair a "restricted" condition with the dynamic library target.

ResolutionSet

A ResolutionSet is an immutable set of AttachesTo, ActsOn, Resolves tuples describing how license conditions apply to targets.

AttachesTo is the trigger for acting. Distribution of the target invokes the policy.

ActsOn is the target to share, give notice for, hide etc.

Resolves is the set of conditions that the action resolves.

For most condition types, ActsOn will be the target where the condition originated. For example, a notice condition policy means attribution or notice must be given for the target where the condition originates. Likewise, a proprietary condition policy means the privacy of the target where the condition originates must be respected. i.e. The thing acted on is the origin.

Restricted conditions are different. The infectious nature of restricted often means sharing code that is not the target where the restricted condition originates. Linking an MIT library to a GPL library implies a policy to share the MIT library despite the MIT license having no source sharing requirement.

In this case, one or more resolution tuples will have the MIT license module in ActsOn and the restricted condition originating at the GPL library module in Resolves. These tuples will AttachTo every target that depends on the GPL library because shipping any of those targets trigger the policy to share the code.

Processes

ReadLicenseGraph

The principal means to ingest license metadata. Given the distribution targets, ReadLicenseGraph populates the LicenseGraph for those root targets.

NoticeIndex.IndexLicenseTexts

IndexLicenseTexts reads, deduplicates and caches license texts for notice files. Also reads and caches project metadata for deriving library names.

The algorithm for deriving library names has not been dictated by OSPO policy, but reflects a pragmatic attempt to comply with Android policy regarding unreleased product names, proprietary partner names etc.

projectmetadata.Index.MetadataForProjects

MetadataForProjects reads, deduplicates and caches project METADATA files used for notice library names, and various properties appearing in SBOMs.