go-mod-update-modules: identify licenses with licensecheck
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | license_finder: keep all license files of the nearest directorymeta/ | +8 | 0 replies | |
| 2/7 | licensecheck: add recipemeta/ meta/ meta/ | +81 | 0 replies | |
| 3/7 | license_finder: do not match files that have no license textmeta/ | +7 | 0 replies | |
| 4/7 | go-mod-update-modules: identify licenses with licensecheckmeta/ meta/ | +136 | 0 replies | |
| 5/7 | go-mod-update-modules: add GO_MOD_LICENSE_STRICTmeta/ | +13 | 0 replies | |
| 6/7 | go-mod-update-modules: name unidentified licenses with a LicenseRefmeta/ | +25 | 0 replies | |
| 7/7 | oeqa/selftest/oelib: add tests for license_findermeta/ | +146 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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