From patchwork Tue Sep 22 09:23:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 98894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED433C982FF for ; Tue, 22 Sep 2026 09:24:33 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5968.1790069065279229309 for ; Tue, 22 Sep 2026 02:24:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=f_l_k@t-online.de header.s=20260216 header.b=uDyUqDpk; spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout02.t-online.de (Postfix) with SMTP id D1AEAEA15 for ; Tue, 22 Sep 2026 11:24:21 +0200 (CEST) Received: from intel-corei7-64.fritz.box ([84.163.38.249]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1x8wjb-3frliK0; Tue, 22 Sep 2026 11:24:19 +0200 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][PATCH 1/5] gcr: initialize libgcrypt from the secret exchange Date: Tue, 22 Sep 2026 11:23:32 +0200 Message-ID: <20260922092411.262885-1-f_l_k@t-online.de> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1790069059-E8FF6986-AE6F0886/0/0 CLEAN NORMAL X-TOI-MSGID: d1cc0d63-4fb8-484e-aff7-be756409a21e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-online.de; s=20260216; t=1790069061; i=f_l_k@t-online.de; bh=Lw1XFfAyDxTGGE6B2q2xkV4sLc16b7/kPMVkQN1COg8=; h=From:To:Subject:Date; b=uDyUqDpkTLhUCJ+uw8TCfGf9BJ6EURobDJhS3LBP3kTgi1UHj7LfS/0nQGtf1jRLh LwCJlvMGty/XFqjnN5Hd+PvIizQQjdByrU+e9+/D0cnSdO4Z5KsB8LK4T3tjN0+SDJ 3VVsQUQ2eFp34LxWfnOZv8+Smda4yvByoinI0j19cn54NoRsGT3I7p2ts7psgQL9l6 jK6eLU/UFCEF2x/4Aows0qL0dtV5uJmTIqXdFI2EpmxXesAFtHOiYL3ELv4iAjodcZ ETb+wtZrZ5QRM11gvWVI6mb8Zg0ROaHadAqEnyJ00MjGIO7eNw5LkJeeoQ+ArlgPJD XBpDQAz+oEnPA== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Sep 2026 09:24:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246398 gnome-shell logs a libgcrypt warning on the first keyring prompt: Libgcrypt warning: missing initialization - please fix the application gcr3 initialized libgcrypt from GcrSecretExchange's class_init; gcr 4 dropped that call, and _gcr_initialize_library() is only reached from the certificate, parser and importer paths, never from the prompt path. The guard in that function is inverted on top of it, so even when it is called the first caller returns without initializing anything. The secret exchange itself works either way, but libgcrypt then runs without the egg secure memory allocators, which puts passwords into ordinary swappable heap instead of locked pages. AI-Generated: Uses Claude Code Signed-off-by: Markus Volk --- ...e-libgcrypt-from-the-secret-exchange.patch | 81 +++++++++++++++++++ meta/recipes-gnome/gcr/gcr_4.4.1.bb | 1 + 2 files changed, 82 insertions(+) create mode 100644 meta/recipes-gnome/gcr/gcr/0001-gcr-initialize-libgcrypt-from-the-secret-exchange.patch diff --git a/meta/recipes-gnome/gcr/gcr/0001-gcr-initialize-libgcrypt-from-the-secret-exchange.patch b/meta/recipes-gnome/gcr/gcr/0001-gcr-initialize-libgcrypt-from-the-secret-exchange.patch new file mode 100644 index 0000000000..3a55cf30aa --- /dev/null +++ b/meta/recipes-gnome/gcr/gcr/0001-gcr-initialize-libgcrypt-from-the-secret-exchange.patch @@ -0,0 +1,81 @@ +From e8b729cc6ceddd22b5160f27396cf07cecd977ad Mon Sep 17 00:00:00 2001 +From: Markus Volk +Date: Tue, 15 Sep 2026 18:24:45 +0200 +Subject: [PATCH] gcr: initialize libgcrypt from the secret exchange + +gnome-shell logs this on the first keyring prompt: + + gnome-shell: Libgcrypt warning: missing initialization - please fix the application + +gcr3 initialized libgcrypt from the class_init of GcrSecretExchange +(gcr/gcr-secret-exchange.c:847). That call is gone in gcr 4, leaving +only _gcr_initialize_library(), which is reached from the certificate, +parser and importer paths but never from the prompt path. + +On top of that the guard in _gcr_initialize_library() is inverted, in +gcr3 as much as in gcr 4: + + static gint gcr_initialize = 0; + if (g_atomic_int_add (&gcr_initialize, 1) == 0) + return; + +g_atomic_int_add() returns the value from before the addition, so the +first call returns without ever reaching egg_libgcrypt_initialize() and +only the second one initializes anything. + +This is not what breaks the keyring - the secret exchange was tested +against both gcr3 and gcr 4 and transfers the secret correctly either +way - but libgcrypt then runs without the egg secure memory allocators, +so passwords end up in ordinary swappable heap instead of locked pages. + +Fix the guard and initialize from the secret exchange again. + +Upstream-Status: Pending + +AI-Generated: Uses Claude Code (Claude Opus 5) +--- + gcr/gcr-library.c | 3 ++- + gcr/gcr-secret-exchange.c | 9 +++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/gcr/gcr-library.c b/gcr/gcr-library.c +index 560772b..9d03f25 100644 +--- a/gcr/gcr-library.c ++++ b/gcr/gcr-library.c +@@ -125,7 +125,8 @@ _gcr_initialize_library (void) + { + static gint gcr_initialize = 0; + +- if (g_atomic_int_add (&gcr_initialize, 1) == 0) ++ /* Initialize on the first call, do nothing on every call after it */ ++ if (g_atomic_int_add (&gcr_initialize, 1) != 0) + return; + + #ifdef WITH_GCRYPT +diff --git a/gcr/gcr-secret-exchange.c b/gcr/gcr-secret-exchange.c +index 943b2af..3e5f889 100644 +--- a/gcr/gcr-secret-exchange.c ++++ b/gcr/gcr-secret-exchange.c +@@ -21,6 +21,8 @@ + + #include "gcr-secret-exchange.h" + ++#include "gcr-internal.h" ++ + #include "egg/egg-crypto.h" + #include "egg/egg-dh.h" + #include "egg/egg-fips.h" +@@ -817,6 +819,13 @@ gcr_secret_exchange_class_init (GcrSecretExchangeClass *klass) + klass->decrypt_transport_data = gcr_secret_exchange_default_decrypt_transport_data; + klass->encrypt_transport_data = gcr_secret_exchange_default_encrypt_transport_data; + ++ /* ++ * The exchange is the only part of the library that some callers ever ++ * touch - gnome-shell through keyring.js for one - so initialize ++ * libgcrypt here as well. gcr3 did this and gcr-4 dropped it. ++ */ ++ _gcr_initialize_library (); ++ + /** + * GcrSecretExchange:protocol: + * diff --git a/meta/recipes-gnome/gcr/gcr_4.4.1.bb b/meta/recipes-gnome/gcr/gcr_4.4.1.bb index 93028d2497..aedbe60b69 100644 --- a/meta/recipes-gnome/gcr/gcr_4.4.1.bb +++ b/meta/recipes-gnome/gcr/gcr_4.4.1.bb @@ -17,6 +17,7 @@ inherit gnomebase gi-docgen vala gobject-introspection lib_package UPSTREAM_CHECK_REGEX = "gcr-(?P\d+\.\d+\.(?!9\d+)\d+(\.\d+)?)" SRC_URI[archive.sha256sum] = "c4442c15d4330f17a1f5194df08c576877af68412ab2521446a93bd5e24c931b" +SRC_URI += "file://0001-gcr-initialize-libgcrypt-from-the-secret-exchange.patch" PACKAGECONFIG ??= "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'vapi', '', d)}" PACKAGECONFIG[ssh_agent] = "-Dssh_agent=true,-Dssh_agent=false,libsecret" From patchwork Tue Sep 22 09:23:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 98891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF9EDC98302 for ; Tue, 22 Sep 2026 09:24:33 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5969.1790069065279392513 for ; Tue, 22 Sep 2026 02:24:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=f_l_k@t-online.de header.s=20260216 header.b=q64+FjKP; spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout02.t-online.de (Postfix) with SMTP id F3D3EDEE7 for ; Tue, 22 Sep 2026 11:24:21 +0200 (CEST) Received: from intel-corei7-64.fritz.box ([84.163.38.249]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1x8wjc-3frliL0; Tue, 22 Sep 2026 11:24:20 +0200 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][PATCH 2/5] cpan: survive the Makefile that MakeMaker rebuilds under us Date: Tue, 22 Sep 2026 11:23:33 +0200 Message-ID: <20260922092411.262885-2-f_l_k@t-online.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922092411.262885-1-f_l_k@t-online.de> References: <20260922092411.262885-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1790069060-AB7FD986-B4CF83EA/0/0 CLEAN NORMAL X-TOI-MSGID: 35b5e735-3703-4b42-8003-449bae020004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-online.de; s=20260216; t=1790069061; i=f_l_k@t-online.de; bh=C8doxuExPyQal2YIFzMaqwq3wFbqWxOZ2H+eG9we/7o=; h=From:To:Subject:Date:In-Reply-To:References; b=q64+FjKP9mw4vNA42Ussts/NILjxlVb5jak1FuK3HTmvAkJKMxWScs0Fvs+8HoInY DCtQDMV/BLxg7aoTlx+BfUTPRBnqQVfBfihAB3eQ+WWKJCtO5XOrPiQgdtF/GTjm0d f6jofT9fTetJTqiWueZfPvGMAcSZjK1hGSK8NpHmea07S+Doa4O21SivzWHOSXJg5g 0ABgKLsNctTUZ1avkIdovYRGVFrVtdb/kq6COWoXqpZf430iqnljHbnDuBW6MCJut+ sIiXrfKgkFyuc217CWhwnZLzDAgqVoyVgrGWsHZ0xIUbMg+a0UCVsox3QOOrcQ0Roq 4VieJv+rs/Vjw== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Sep 2026 09:24:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246397 ExtUtils::MakeMaker makes the generated Makefile depend on Config.pm and config.h from the perl it was configured against. do_prepare_recipe_sysroot stages those files fresh on every run, so their mtime can end up newer than a Makefile written by a do_configure that is still valid. make then regenerates the Makefile, prints "Please rerun the make command" and exits non-zero, which fails do_compile or do_install. Run make a second time in that case, which is what MakeMaker asks for; a run that fails for any other reason fails again. Also drop a stale Makefile before Makefile.PL runs, so a configure in a used work directory does not start from old settings. Reproduced with liburi-perl by touching Config.pm and config.h in the recipe sysroot and forcing do_install: it failed before the change and succeeds after it. AI-Generated: Uses Claude Code (Claude Opus 5) Signed-off-by: Markus Volk --- meta/classes-recipe/cpan.bbclass | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/cpan.bbclass b/meta/classes-recipe/cpan.bbclass index dbf44da9d2..0f7384786f 100644 --- a/meta/classes-recipe/cpan.bbclass +++ b/meta/classes-recipe/cpan.bbclass @@ -23,6 +23,10 @@ export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/" export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/" cpan_do_configure () { + # A Makefile left behind by an earlier configure run would be used with the + # settings it was generated with, so start from the Makefile.PL every time. + rm -f Makefile + yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS} # Makefile.PLs can exit with success without generating a @@ -57,12 +61,17 @@ do_configure:append:class-nativesdk() { -e 's:LD_RUN_PATH ?= ?"?[^"]*"?::g' } +# ExtUtils::MakeMaker regenerates the Makefile when the staged perl has become +# newer than it, and then exits asking for make to be rerun. Do that instead of +# failing the task; a run that fails for any other reason fails again. cpan_do_compile () { - oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}" + oe_runmake_call PASTHRU_INC="${CFLAGS}" LD="${CCLD}" || \ + oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}" } cpan_do_install () { - oe_runmake DESTDIR="${D}" install_vendor + oe_runmake_call DESTDIR="${D}" install_vendor || \ + oe_runmake DESTDIR="${D}" install_vendor for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT done From patchwork Tue Sep 22 09:23:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 98890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFAA8C982FA for ; Tue, 22 Sep 2026 09:24:33 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5967.1790069065259960480 for ; Tue, 22 Sep 2026 02:24:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=f_l_k@t-online.de header.s=20260216 header.b=oYC6rHVs; spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout02.t-online.de (Postfix) with SMTP id 0EEA3E792 for ; Tue, 22 Sep 2026 11:24:22 +0200 (CEST) Received: from intel-corei7-64.fritz.box ([84.163.38.249]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1x8wjc-3frliM0; Tue, 22 Sep 2026 11:24:20 +0200 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][PATCH 3/5] spdx_license: give UnknownId a name Date: Tue, 22 Sep 2026 11:23:34 +0200 Message-ID: <20260922092411.262885-3-f_l_k@t-online.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922092411.262885-1-f_l_k@t-online.de> References: <20260922092411.262885-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1790069060-88FF6986-0401A1B1/0/0 CLEAN NORMAL X-TOI-MSGID: 0dd23829-b047-4489-8914-a6453a9ec46f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-online.de; s=20260216; t=1790069062; i=f_l_k@t-online.de; bh=mQS0fyh8kxTLJiagmdWHRlxnlYW+eCbaOAGAOD/JYv8=; h=From:To:Subject:Date:In-Reply-To:References; b=oYC6rHVs4vHiuShNv8orSS7NQFvw/WYMcY9BKYdxnWZ3oFLhe2a9NU45snbcDxK5P r1ovUJVaHXyqh/vA2sv8xpPoGYyF6owAWEoqIlVzxSb5ai99DEf8KK74PM/GDwy36V cC76SmfzG42ehLSkUCkgbJLtX5Nrldw8kE0rG2fUQBAlEKgpSOEZaLXWQtDwWfbCqW 2nV58rmXKCTiDJAaJIqcwKqPizIjTabqyT9OLjhrxTYa/0eO22nL2KboCq80iHPTZ8 +OqyZz09JR7WsTn3NDzWblPrtzEU4grDAHkmNKeZhELnHWR0e9JGdfTTfA/3fdEa2q hJKE0hoMEPSAA== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Sep 2026 09:24:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246396 A LICENSE that contains an unknown identifier, as go-mod-update-modules writes it for modules whose license it could not classify, made do_populate_lic fail with an AttributeError in get_license_path instead of the license-exists QA error. Give UnknownId the same name property as LicenseId and ExceptionId so the lookup can fail gracefully. AI-Generated: Uses Claude Code (Claude Fable 5.1) Signed-off-by: Markus Volk --- meta/lib/oe/spdx_license.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/lib/oe/spdx_license.py b/meta/lib/oe/spdx_license.py index 1e201f21d5..7369eca9ef 100644 --- a/meta/lib/oe/spdx_license.py +++ b/meta/lib/oe/spdx_license.py @@ -240,6 +240,10 @@ class Identifier(Node): class UnknownId(Identifier): + @property + def name(self): + return self.ident + @classmethod def reduce(cls, stack, lookahead): if not check_stack_types(stack, [Token]): From patchwork Tue Sep 22 09:23:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 98893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2385CC98305 for ; Tue, 22 Sep 2026 09:24:34 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5998.1790069065278896704 for ; Tue, 22 Sep 2026 02:24:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=f_l_k@t-online.de header.s=20260216 header.b=YQvaRrwU; spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout02.t-online.de (Postfix) with SMTP id 1DE3BDF95 for ; Tue, 22 Sep 2026 11:24:22 +0200 (CEST) Received: from intel-corei7-64.fritz.box ([84.163.38.249]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1x8wjc-3frliN0; Tue, 22 Sep 2026 11:24:20 +0200 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][PATCH 4/5] license_finder: normalise license texts before hashing Date: Tue, 22 Sep 2026 11:23:35 +0200 Message-ID: <20260922092411.262885-4-f_l_k@t-online.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922092411.262885-1-f_l_k@t-online.de> References: <20260922092411.262885-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1790069060-CAFFA986-3C599A31/0/0 CLEAN NORMAL X-TOI-MSGID: d37d016a-ff01-4d6f-8cc1-af3a41ee01cd DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-online.de; s=20260216; t=1790069062; i=f_l_k@t-online.de; bh=zb+mgCNRfU2BWRhsVmBhdpDWRzVc+kXlDQj24U5RiNE=; h=From:To:Subject:Date:In-Reply-To:References; b=YQvaRrwU2AT0vlGkuJxYQwoX9xyc6PWTvGLwIHxt7LqwqswNzA6+hXbuJHg4h9slX xn2v7DCsqIWsND35o/MiMpftlJj0iaK4AwgocCRlWAwoavP4J6YyfIZQjfMamkEo+w 1gCfMDjoz4GloDz7ZUCAnTik8FerirBr/VNk06ic9Cl/5FV2l/LXmVay7wBHpvve4h MTfQxb6buc7gf66kpxLzuXr0gMr7fOThaFy2HzIc+mHBiJuPkFoT+wTGGWjOtOul4+ Fy+kRLm6S3760k21lOlNd5pF3OgBRbweXDPDCILA02NyuGUjBEP/ywcFMjzbbjgvb8 UrXlP1bmoKU8Q== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Sep 2026 09:24:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246400 Matching by the md5 of a lightly crunched text missed most of the common BSD, MIT, ISC, MPL-2.0 and Apache-2.0 copies in a Go module tree: list markers, punctuation, case, the copyright holder's name in the BSD advertising clause, the party in the ISC disclaimer and the Apache-2.0 appendix all changed the hash. Compare the lower-cased word stream instead, strip those variable parts, and only treat a line as a license title at the top of the file. For rclone's 256 module license files this brings the unrecognised ones down from 57 to 25, the rest are dual-license files or texts with additions. The canonical licenses are hashed in sorted order and the first name wins so that formatting twins map to a stable name. license-hashes.csv also holds hashes of texts crunched the old way, for example the short Apache-2.0 boilerplate notice, so the old algorithm stays as a third lookup step and none of the existing entries is lost. AI-Generated: Uses Claude Code (Claude Fable 5.1) Signed-off-by: Markus Volk --- meta/lib/oe/license_finder.py | 61 +++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/meta/lib/oe/license_finder.py b/meta/lib/oe/license_finder.py index 9c217cf891..b500f3a599 100644 --- a/meta/lib/oe/license_finder.py +++ b/meta/lib/oe/license_finder.py @@ -46,40 +46,52 @@ def _crunch_known_licenses(d): lic_dirs = [d.getVar('COMMON_LICENSE_DIR')] + (d.getVar('LICENSE_PATH') or "").split() for lic_dir in lic_dirs: - for fn in os.listdir(lic_dir): + for fn in sorted(os.listdir(lic_dir)): path = os.path.join(lic_dir, fn) if not os.path.isfile(path): continue # Hash the exact contents md5value = bb.utils.md5_file(path) - md5sums[md5value] = fn - # Also hash a "crunched" version + md5sums.setdefault(md5value, fn) + # Also hash a "crunched" version. Some licenses only differ + # in formatting, the first name in sort order wins for those. md5value = _crunch_license(path) - md5sums[md5value] = fn + md5sums.setdefault(md5value, fn) return md5sums -def _crunch_license(licfile): +def _crunch_license(licfile, legacy=False): ''' Remove non-material text from a license file and then calculate its md5sum. This works well for licenses that contain a copyright statement, but is also a useful way to handle people's insistence upon reformatting the license text slightly (with no material difference to the text of the license). + + With legacy set, the text is crunched the way it was before the word + stream normalisation, which is what the hashes in license-hashes.csv + were made with. ''' import oe.utils # Note: these are carefully constructed! - license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') + if legacy: + license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') + else: + license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?([A-Z0-9].{0,14})? ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') license_statement_re = re.compile(r'^((This (project|software)|.{1,10}) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$') copyright_re = re.compile(r'^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') disclaimer_re = re.compile(r'^ *\*? ?All [Rr]ights [Rr]eserved\.$') email_re = re.compile(r'^.*<[\w\.-]*@[\w\.\-]*>$') header_re = re.compile(r'^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') tag_re = re.compile(r'^ *@?\(?([Ll]icense|MIT)\)?$') - url_re = re.compile(r'^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') + if legacy: + url_re = re.compile(r'^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') + else: + url_re = re.compile(r'^ *[#\*]* *https?:\/\/[\w\.\/\-]+\.?$') + list_marker_re = re.compile(r'^(\(?[0-9a-zA-Z]{1,2}[\.\)]|[\*\-•o]) +') lictext = [] with open(licfile, 'r', errors='surrogateescape') as f: @@ -97,9 +109,11 @@ def _crunch_license(licfile): continue elif url_re.match(line): continue - elif license_title_re.match(line): + # Titles and statements are only dropped at the top of the + # file, further down they are wrapped sentences of the text + elif (legacy or len(lictext) < 3) and license_title_re.match(line): continue - elif license_statement_re.match(line): + elif (legacy or len(lictext) < 3) and license_statement_re.match(line): continue # Strip comment symbols line = line.replace('*', '') \ @@ -108,6 +122,9 @@ def _crunch_license(licfile): line = line.replace('sub-license', 'sublicense') # Squash spaces line = oe.utils.squashspaces(line.strip()) + # Drop list markers, "1." and "*" are used interchangeably + if not legacy: + line = list_marker_re.sub('', line) # Replace smart quotes, double quotes and backticks with single quotes line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'') # Unify brackets @@ -115,9 +132,30 @@ def _crunch_license(licfile): if line: lictext.append(line) + text = ' '.join(lictext) + if legacy: + return hashlib.md5(text.encode('utf-8', errors='ignore')).hexdigest() + + # Only the words matter, not case or punctuation + text = text.lower() + text = text.replace('and/or', 'and') + text = re.sub(r'https?://\S+', ' ', text) + text = re.sub(r'[^a-z0-9]+', ' ', text).strip() + # The Apache-2.0 appendix is instructions, not license terms, and + # the end marker is often left out + text = re.sub(r' appendix how to apply the apache license to your work.*? limitations under the license', '', text) + text = text.replace(' end of terms and conditions', '') + # Names of copyright holders in the BSD advertising clause and the + # ISC disclaimer, and the extra paragraph reference in X11-style MIT + text = re.sub(r'neither the name of .*? nor the names of', 'neither the name of nor the names of', text) + text = text.replace('copyright owner', 'copyright holder') + text = re.sub(r'\b(the authors?|isc|the copyright holders?) disclaims?\b', 'the author disclaims', text) + text = re.sub(r'shall (the authors?|isc|the copyright holders?) be liable', 'shall the author be liable', text) + text = text.replace('permission notice including the next paragraph shall', 'permission notice shall') + m = hashlib.md5() try: - m.update(' '.join(lictext).encode('utf-8')) + m.update(text.encode('utf-8')) md5val = m.hexdigest() except UnicodeEncodeError: md5val = None @@ -183,6 +221,9 @@ def match_licenses(licfiles, srctree, d, extra_hashes={}): if not license: crunched_md5 = _crunch_license(resolved_licfile) license = md5sums.get(crunched_md5, None) + if not license: + crunched_md5 = _crunch_license(resolved_licfile, legacy=True) + license = md5sums.get(crunched_md5, None) if not license: rel_fn = os.path.relpath(licfile, srctree + "/..") license = oe.spdx_license.UnknownId("Unknown") From patchwork Tue Sep 22 09:23:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 98892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDF75C982F1 for ; Tue, 22 Sep 2026 09:24:33 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5997.1790069065259918692 for ; Tue, 22 Sep 2026 02:24:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=f_l_k@t-online.de header.s=20260216 header.b=Gewrrq/7; spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd72.aul.t-online.de (fwd72.aul.t-online.de [10.223.144.98]) by mailout02.t-online.de (Postfix) with SMTP id 2C4A2E9D0 for ; Tue, 22 Sep 2026 11:24:22 +0200 (CEST) Received: from intel-corei7-64.fritz.box ([84.163.38.249]) by fwd72.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1x8wjc-3frliO0; Tue, 22 Sep 2026 11:24:20 +0200 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][PATCH 5/5] go-mod-update-modules: include the generated files from the class Date: Tue, 22 Sep 2026 11:23:36 +0200 Message-ID: <20260922092411.262885-5-f_l_k@t-online.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260922092411.262885-1-f_l_k@t-online.de> References: <20260922092411.262885-1-f_l_k@t-online.de> MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1790069060-E97F9986-0496B2EA/0/0 CLEAN NORMAL X-TOI-MSGID: 443ec9a8-3117-46bb-8843-d0d525fb0b81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-online.de; s=20260216; t=1790069062; i=f_l_k@t-online.de; bh=/1D7qFwD+8GCj14cq3Va6OzIdr/TN596daE7ATugo68=; h=From:To:Subject:Date:In-Reply-To:References; b=Gewrrq/7QrJrEmn8bZ6QjrQXtY7PyFAPV87nAFbPFcF7JZaA3h0JFHiICNcbCSru2 4mcUbQLsX79Tq2jusjUpKk9Kda5Ei7afbB0bE1OLy5qB7AwulhSyJIqCBfvzLBvE0l u23ZpAlI/THenpd1TX5xxYG1Hwlib7FhOmmJIMFg3GbHdkll1Ow7oT6Zjwi7nYZ3P/ VvS+MvVtH+33C45BWQPWslmMuYDn30ss91HBp5lvhtYZbCXWbXcWN0FgUw5qbr8Adv i78dczIAENFAwcAgaVKXpkNdCLmtq+5pcigi6xdzknKrhMhoju7xGFYAgQyF5ezP1C g/T/IyBGpbY5w== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Sep 2026 09:24:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246399 A new recipe could not be parsed before its first update_modules run because it had to require the two generated files itself. Include them from the class instead, relative to the recipe, so a missing file is tolerated until the task has written it. AI-Generated: Uses Claude Code (Claude Fable 5.1) Signed-off-by: Markus Volk --- meta/classes-recipe/go-mod-update-modules.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/go-mod-update-modules.bbclass b/meta/classes-recipe/go-mod-update-modules.bbclass index 3a0f0a3377..bae9e47c0d 100644 --- a/meta/classes-recipe/go-mod-update-modules.bbclass +++ b/meta/classes-recipe/go-mod-update-modules.bbclass @@ -10,7 +10,12 @@ do_update_modules[network] = "1" # -licenses.inc will append LICENSE and LIC_FILES_CHKSUM with the found licenses # in the modules. # -# These files are machine-generated and should not be modified. +# These files are machine-generated and should not be modified. They are +# included here so that a new recipe parses before they have been generated +# by the first run of the update-modules task. + +include ${FILE_DIRNAME}/${BPN}-licenses.inc +include ${FILE_DIRNAME}/${BPN}-go-mods.inc python do_update_modules() { import subprocess, tempfile, json, re, urllib.parse