From patchwork Tue Dec 1 03:49:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 106687 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4083.1796096967018826951 for ; Mon, 30 Nov 2026 19:49:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=J4FSiWNZ; spf=pass (domain: konsulko.com, ip: 209.85.210.180, mailfrom: tim.orling@konsulko.com) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-8b5c3288e6cso4442805b3a.3 for ; Mon, 30 Nov 2026 19:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1796096966; x=1796701766; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dkPBzj0C5i9zpMG12KsJkIl2Msqcd9st4uQS9CT4l5I=; b=J4FSiWNZVWaA+SIZvO85oj0AdrDrMVL4vACTeGKFVU84c1F2PwaAXo3My8cLimBfMP PRoLxlIbiqaWdKOnZIR0+2Ou+NfmU9j+vGns/QeKin3nGYUuRbrKkZcG6cdE8AycMl98 s03NSYlmch/te9XrnAKiGilU0mdR7cr76aifs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796096966; x=1796701766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=dkPBzj0C5i9zpMG12KsJkIl2Msqcd9st4uQS9CT4l5I=; b=tlhpZdQ2rVmQfUHmhSS8mhe/4z3cjyA5cST4sI2bv2YslHxEEWHjaaMLkOU4S+oBfK kkrYVrcr+dTDlhn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3X9qMMUpDu1xNOsO7mrEaGS25USRT966gRT1 braJJ4IKU7zMnyobEsSkj5aQn4lyudKIk25B/9oJnx2WLcIPMQxp2u0Vu/2B/iQ/5H3U= X-Received: by 2002:a05:6300:8052:b0:3e2:827c:2fe2 with SMTP id adf61e73a8af0-4014a470489mr34459981637.1.1796096966424; Mon, 30 Nov 2026 19:49:26 -0800 (PST) Return-Path: Received: from localhost (c-24-20-171-118.hsd1.or.comcast.net. [24.20.171.118]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87353b333sm18709196b3a.40.2026.11.30.19.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 19:49:26 -0800 (PST) From: Tim Orling To: openembedded-core@lists.openembedded.org Cc: Tim Orling , Bruce Ashfield Subject: [PATCH 6/7] go-mod-update-modules: name unidentified licenses with a LicenseRef Date: Mon, 30 Nov 2026 19:49:09 -0800 Message-ID: <20261201034910.25521-7-tim.orling@konsulko.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201034910.25521-1-tim.orling@konsulko.com> References: <20261201034910.25521-1-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 03:49:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251662 A license file that is not identified was written as "Unknown", which has no license text, so do_populate_lic failed. Name it LicenseRef-go--, warn, and point NO_GENERIC_LICENSE at the module's own text, so that the recipe builds and its SBOM names the file. GO_MOD_LICENSE_STRICT still fails first. AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling --- .../go-mod-update-modules.bbclass | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/go-mod-update-modules.bbclass b/meta/classes-recipe/go-mod-update-modules.bbclass index 030099fb0f..9ec41c7b57 100644 --- a/meta/classes-recipe/go-mod-update-modules.bbclass +++ b/meta/classes-recipe/go-mod-update-modules.bbclass @@ -133,13 +133,31 @@ python do_update_modules() { bpn, "\n".join(f" {f}" for f, _ in unknown), "\n".join(sorted({f" {md5},Unknown" for _, md5 in unknown})))) + # Name a license that is not identified LicenseRef-go--, + # with NO_GENERIC_LICENSE pointing at the module's own text, as + # "Unknown" has no text and would fail do_populate_lic. + for lic_file, (node, md5) in list(lic_files.items()): + if not isinstance(node, oe.spdx_license.UnknownId): + continue + module, _, rest = lic_file.partition('@') + in_module = rest.partition('/')[2] + name = re.sub(r'[^A-Za-z0-9.-]+', '-', f"go-{unescape_path(module)}-{in_module}").strip('-') + node = oe.spdx_license.parse("LicenseRef-" + name) + bb.warn(f"{lic_file}: license not identified, using its own text as {node.to_string()}") + lic_files[lic_file] = (node, md5) + + lic_dirs = [d.getVar("COMMON_LICENSE_DIR")] + (d.getVar("LICENSE_PATH") or "").split() + no_generic = {} + for lic_file, (node, _) in lic_files.items(): + for ref in node.iter(): + if isinstance(ref, oe.spdx_license.LicenseRef) and not any( + os.path.isfile(os.path.join(ld, n)) for ld in lic_dirs for n in (ref.name, ref.ident)): + no_generic.setdefault(ref.name, f"pkg/mod/{lic_file}") + licenses = [] lic_files_chksum = [] for lic_file in lic_files: node, license_md5 = lic_files[lic_file] - if isinstance(node, oe.spdx_license.UnknownId): - bb.warn(f"Unknown license: {lic_file} {license_md5}") - licenses.append(node) lic_files_chksum.append( f'file://pkg/mod/{lic_file};md5={license_md5};spdx={urllib.parse.quote_plus(node.to_string())}') @@ -156,6 +174,10 @@ python do_update_modules() { for lic in sorted(lic_files_chksum, key=fold_uri): f.write(' ' + lic + ' \\\n') f.write('"\n') + if no_generic: + f.write('\n') + for name in sorted(no_generic): + f.write(f'NO_GENERIC_LICENSE[{name}] = "{no_generic[name]}"\n') # # Sources