Skip to content

go-mod-update-modules: identify licenses with licensecheck

Tim Orling openembedded-core 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7license_finder: keep all license files of the nearest directorymeta/lib/oe/license_finder.py+8 -60 replies
2/7licensecheck: add recipemeta/conf/distro/include/maintainers.inc meta/recipes-devtools/licensecheck/files/main.go meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb+81 -00 replies
3/7license_finder: do not match files that have no license textmeta/lib/oe/license_finder.py+7 -10 replies
4/7go-mod-update-modules: identify licenses with licensecheckmeta/classes-recipe/go-mod-update-modules.bbclass meta/lib/oe/license_finder.py+136 -00 replies
5/7go-mod-update-modules: add GO_MOD_LICENSE_STRICTmeta/classes-recipe/go-mod-update-modules.bbclass+13 -00 replies
6/7go-mod-update-modules: name unidentified licenses with a LicenseRefmeta/classes-recipe/go-mod-update-modules.bbclass+25 -30 replies
7/7oeqa/selftest/oelib: add tests for license_findermeta/lib/oeqa/selftest/cases/oelib/license_finder.py+146 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] go-mod-update-modules: identify licenses with licensecheck

go-mod-update-modules identifies the license files of Go module dependencies by hash. Variant license texts, several licenses in one file and several license files in one directory end up as spdx=Unknown, which fails do_populate_lic, or are left out.

This series adds licensecheck, the license detection library of pkg.go.dev, and an opt-in GO_MOD_LICENSE_SCANNER = "licensecheck" that scans each license file with it. Hash matching stays the default. It also:

- keeps every license file of the nearest directory
- stops files with no license text from matching "Proprietary"
- adds GO_MOD_LICENSE_STRICT, to fail do_update_modules on a license that is not identified
- otherwise names such a license LicenseRef-go-<module>-<file>, with NO_GENERIC_LICENSE, so that the recipe builds

Tested on qemux86-64: licensecheck and licensecheck-native build, and the oelib.license_finder, distrodata test_maintainers and recipetool test_recipetool_create_go selftests pass. For yq, hash matching leaves 5 of 30 license files unidentified (MPL-2.0, BSD-2-Clause, MIT, Apache-2.0, BSD-3-Clause variants); licensecheck identifies all 5. With either result, yq builds and do_create_spdx passes.

AI-Generated: Uses Claude Code (Claude Opus 5.5, Claude Fable 5.2)

Tim Orling (7):
license_finder: keep all license files of the nearest directory
licensecheck: add recipe
license_finder: do not match files that have no license text
go-mod-update-modules: identify licenses with licensecheck
go-mod-update-modules: add GO_MOD_LICENSE_STRICT
go-mod-update-modules: name unidentified licenses with a LicenseRef oeqa/selftest/oelib: add tests for license_finder

 .../go-mod-update-modules.bbclass             |  84 +++++++++-
 meta/conf/distro/include/maintainers.inc      |   1 +
 meta/lib/oe/license_finder.py                 | 115 +++++++++++++-
 .../selftest/cases/oelib/license_finder.py    | 146 ++++++++++++++++++
 .../licensecheck/files/main.go                |  49 ++++++
 .../licensecheck/licensecheck_0.3.1.bb        |  31 ++++
 6 files changed, 416 insertions(+), 10 deletions(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/oelib/license_finder.py
 create mode 100644 meta/recipes-devtools/licensecheck/files/main.go
 create mode 100644 meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb
Signature · 1 line
2.56.1