Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4082.1796096965042216298 for ; Mon, 30 Nov 2026 19:49:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=GJP0yIjL; spf=pass (domain: konsulko.com, ip: 209.85.214.169, mailfrom: tim.orling@konsulko.com) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2f0414c1062so67094505ad.2 for ; Mon, 30 Nov 2026 19:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1796096964; x=1796701764; 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=eT7FnU6d9ac93qKLpEsYnpi8A1FUUv1QyvlAKsf3deM=; b=GJP0yIjLFGv/IrRx+CzicVowE44Y4EjSp42azDCFdbD89xuNtUxkHSGL7973rPSszL PcYaXjVKPhaARJcCruPbjaCPWayQGI4Hl2dh4EniaD41Q4S2TD3c/b7CCWiNt1viDWU/ 5D2yFPj/cet9XLzFtBWakRx8NT3R8YzdNYArM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796096964; x=1796701764; 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=eT7FnU6d9ac93qKLpEsYnpi8A1FUUv1QyvlAKsf3deM=; b=IdBWwt/07Tv056eUspsrTh9jmUztbU7z0eYTKTOinaazWOixZypHIWQWQdQEzNmgSs hXHPkPysL41RHlJ0rPt0cZGiEbB3x/IRz7sq5JRJn9mGAtbDiMQoeZevbzvqxi0yMsCk SMrnjwUZiKdy0L1/oPAuEEnFYZ0FJkoyLvTbnYuVJ+pdhgpBw2ZuDVobhKoZTCA4mo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002:a17:902:ec8b:b0:2e9:7ff5:5462 with SMTP id d9443c01a7336-2f03f1187f6mr308642215ad.22.1796096964436; Mon, 30 Nov 2026 19:49:24 -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 d9443c01a7336-2f0742996aesm143935145ad.11.2026.11.30.19.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 19:49:24 -0800 (PST) From: Tim Orling To: openembedded-core@lists.openembedded.org Cc: Tim Orling , Bruce Ashfield Subject: [PATCH 5/7] go-mod-update-modules: add GO_MOD_LICENSE_STRICT Date: Mon, 30 Nov 2026 19:49:08 -0800 Message-ID: <20261201034910.25521-6-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 Content-Transfer-Encoding: 8bit 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/251661 Content-Type: text/plain; charset="utf-8" A license file that is not identified only gives a warning, which is easy to miss in an upgrade. Add GO_MOD_LICENSE_STRICT. Set to "1", do_update_modules fails without writing the files, and lists the unidentified files and the md5,SPDX lines to complete and add to a license-hashes.csv. AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling --- meta/classes-recipe/go-mod-update-modules.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meta/classes-recipe/go-mod-update-modules.bbclass b/meta/classes-recipe/go-mod-update-modules.bbclass index bcb80e130d..030099fb0f 100644 --- a/meta/classes-recipe/go-mod-update-modules.bbclass +++ b/meta/classes-recipe/go-mod-update-modules.bbclass @@ -19,6 +19,10 @@ do_update_modules[network] = "1" GO_MOD_LICENSE_SCANNER ??= "" do_update_modules[depends] += "${@'licensecheck-native:do_populate_sysroot' if d.getVar('GO_MOD_LICENSE_SCANNER') == 'licensecheck' else ''}" +# Set to "1" to fail, without writing the files, when the license of a file is +# not identified. The error lists the hashes to add to a license-hashes.csv. +GO_MOD_LICENSE_STRICT ??= "0" + python do_update_modules() { import subprocess, tempfile, json, re, urllib.parse from oe.license_finder import find_licenses_up @@ -120,6 +124,15 @@ python do_update_modules() { bb.note(f"{lic_file}: no license beyond {' '.join(sorted(declared))}, left out") del lic_files[lic_file] + unknown = [(f, md5) for f, (node, md5) in lic_files.items() + if isinstance(node, oe.spdx_license.UnknownId)] + if unknown and bb.utils.to_boolean(d.getVar("GO_MOD_LICENSE_STRICT")): + bb.fatal("Licenses not identified, %s-licenses.inc not written:\n%s\n" + "Once each license is verified, add md5,SPDX lines like these to a " + "files/license-hashes.csv in a layer:\n%s" % ( + bpn, "\n".join(f" {f}" for f, _ in unknown), + "\n".join(sorted({f" {md5},Unknown" for _, md5 in unknown})))) + licenses = [] lic_files_chksum = [] for lic_file in lic_files: -- 2.56.1