From patchwork Tue Nov 17 12:01:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 104627 Received: from mail-244106.protonmail.ch (mail-244106.protonmail.ch [109.224.244.106]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16177.1794916929135916046 for ; Tue, 17 Nov 2026 04:02:09 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@geanix.com header.s=protonmail header.b=Pl5jusW7; spf=pass (domain: geanix.com, ip: 109.224.244.106, mailfrom: sean@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1794916925; x=1795176125; bh=H2dsfelzAiNoT28/WPnEDf7Ssxabna14jZSAA1E/4jo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=Pl5jusW7wZwmv0wbms3vPWtZrBAOxsoS2Nu01s3WG4zWSDbQmK/yJQfNYhqC+wjRq z6vj1ENdzfhbsQLbLGQkO9Usyc5ZpvciXplyT2O1Rm1PcgfS7ikxZI8nrm0etx9QTt +MQpf0a7VB9Kt7hBqZDhK8qUH5H60AJd+pgF1v02hGpyW6rx+pWBHVwIRDtCiCwXUY keEFwUGUJ0pyIEluot8KCb5GCer0uzBKDTFTHgt+LArlVfsbX0fzsC34Hsn5l0lq0M 34YjUF4K6weDXm5Cs7ynudDjv90B+9jRmzjC69s+won+y0FH3jBrsyYeH3ZylkWOAp 55u2ZA+KUEdbQ== X-Pm-Submission-Id: 4jTNd74hWYz1DDLV From: Sean Nyekjaer To: openembedded-core@lists.openembedded.org Cc: Sean Nyekjaer Subject: [PATCH v2 1/3] lib/oe/license: factor out incompatible_license_check_needed() Date: Tue, 17 Nov 2026 13:01:53 +0100 Message-ID: <20261117120155.3986876-2-sean@geanix.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261117120155.3986876-1-sean@geanix.com> References: <20261117120155.3986876-1-sean@geanix.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, 17 Nov 2026 12:02:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250435 Move the check for recipes INCOMPATIBLE_LICENSE does not apply to (native, nativesdk, cross, cross-canadian and gcc-source) out of skip_incompatible_package_licenses() into its own function, so it can be reused when checking packages at image/SDK creation time. No functional change. AI-Generated: Claude Opus 5.5 (Claude Code) Signed-off-by: Sean Nyekjaer --- meta/lib/oe/license.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index e2a2bcc47d..035311d469 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py @@ -561,23 +561,28 @@ def filter_pkg_license_list(pkg, lst): return pkg_lst +def incompatible_license_check_needed(d, pn): + """ + Return False for recipes that INCOMPATIBLE_LICENSE does not apply to: + native, nativesdk, cross and cross-canadian recipes, and gcc-source. + """ + if pn.startswith("nativesdk-") or pn.startswith("gcc-source-"): + return False + for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", + "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", + "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: + if pn.endswith(d.expand(t)): + return False + return True + def skip_incompatible_package_licenses(d, pkgs): if not pkgs: return {} pn = d.getVar("PN") - check_license = False if pn.startswith("nativesdk-") else True - for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}", - "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}", - "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]: - if pn.endswith(d.expand(t)): - check_license = False - if pn.startswith("gcc-source-"): - check_license = False - bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split() - if not check_license or not bad_licenses: + if not incompatible_license_check_needed(d, pn) or not bad_licenses: return {} bad_licenses = expand_wildcard_licenses(d, bad_licenses) From patchwork Tue Nov 17 12:01:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 104626 Received: from mail-244107.protonmail.ch (mail-244107.protonmail.ch [109.224.244.107]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16176.1794916929039332957 for ; Tue, 17 Nov 2026 04:02:09 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@geanix.com header.s=protonmail header.b=mremi/iH; spf=pass (domain: geanix.com, ip: 109.224.244.107, mailfrom: sean@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1794916926; x=1795176126; bh=Iy42M1MGOEzSr2cDCrz1FzKpeqfZhEh4EH2rUOeqMqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=mremi/iH7kJ+/mgEXQ7hGOllHDQ234v/nv/WYXW3WInPy+v9Rw65FbKRWz4iIMUG/ GWvkfEe0pJY8kAT+LKNbd0fW82lvLiIk7Rpwqf45GP+RnMBlLvTCkLmVVqJoO3UeKm D5Bt84jxh9UqBd4ZpFKhsppS00VzmLokU54mu4B9MwaZUqt9szU41gKYMvjG/orec6 lvZD5x/gPIMturY7l+F4sm6cXl1jMQv7gv6jGljglUmDqk1wlLuj4YMPcnPWanDB6X ZbZLo5SWo2gKe0jvBsRJ/fxauMqiAdASirp9cgiUIjVqpPcyStpBPAAkyHXrHM7ptg hfUUpCaXnsRWA== X-Pm-Submission-Id: 4jTNd873jmz1DDLY From: Sean Nyekjaer To: openembedded-core@lists.openembedded.org Cc: Sean Nyekjaer Subject: [PATCH v2 2/3] license_image: don't apply INCOMPATIBLE_LICENSE to SDK host tools Date: Tue, 17 Nov 2026 13:01:54 +0100 Message-ID: <20261117120155.3986876-3-sean@geanix.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261117120155.3986876-1-sean@geanix.com> References: <20261117120155.3986876-1-sean@geanix.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, 17 Nov 2026 12:02:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250434 Since the SDK host and target sysroots are passed through write_license_files(), do_populate_sdk checks every nativesdk and cross-canadian package against the image's INCOMPATIBLE_LICENSE and fails, e.g. with INCOMPATIBLE_LICENSE = "GPL-3.0*": Some packages cannot be installed into the image because they have incompatible licenses: nativesdk-autoconf (GPL-3.0-or-later) At parse time skip_incompatible_package_licenses() exempts these recipes, so they are built and packaged, and only the SDK manifest step rejects them. Use incompatible_license_check_needed() in write_license_files() too, so host tools in the SDK are treated the same way. Target packages in the image and in the SDK target sysroot are still checked. Fixes: f757ae4dadab ("license_image: extend to SDK coverage") AI-Generated: Claude Opus 5.5 (Claude Code) Signed-off-by: Sean Nyekjaer --- meta/classes-recipe/license_image.bbclass | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/license_image.bbclass b/meta/classes-recipe/license_image.bbclass index 7d00b1ae53..728db8ae3a 100644 --- a/meta/classes-recipe/license_image.bbclass +++ b/meta/classes-recipe/license_image.bbclass @@ -128,16 +128,23 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs): pkg_allow_licenses = oe.license.filter_pkg_license_list(pkg, allow_licenses) + # Host tools in the SDK (nativesdk, cross-canadian) are not + # subject to INCOMPATIBLE_LICENSE, same as at parse time. + if oe.license.incompatible_license_check_needed(d, pkg_dic[pkg]["PN"]): + pkg_bad_licenses = bad_licenses + else: + pkg_bad_licenses = [] + if node: - if incompatible_licenses := oe.license.license_allowed(node, bad_licenses, pkg_allow_licenses): + if incompatible_licenses := oe.license.license_allowed(node, pkg_bad_licenses, pkg_allow_licenses): incompatible_packages.append("%s (%s)" % (pkg, ' '.join(n.to_string() for n in incompatible_licenses))) - elif incompatible_licenses := oe.license.license_allowed(node, bad_licenses, []): + elif incompatible_licenses := oe.license.license_allowed(node, pkg_bad_licenses, []): oe.qa.handle_error('license-exception', "Including %s with incompatible license(s) %s into the image, because it has been allowed by exception list." % (pkg, ' '.join(n.to_string() for n in incompatible_licenses)), d) (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ oe.license.manifest_licenses(d, pkg_dic[pkg]["LICENSE"], - bad_licenses, pkg_allow_licenses) + pkg_bad_licenses, pkg_allow_licenses) if not "IMAGE_MANIFEST" in pkg_dic[pkg]: # Rootfs manifest From patchwork Tue Nov 17 12:01:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 104625 Received: from mail-106111.protonmail.ch (mail-106111.protonmail.ch [79.135.106.111]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16286.1794916930378406461 for ; Tue, 17 Nov 2026 04:02:10 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@geanix.com header.s=protonmail header.b=eP7ZjMeD; spf=pass (domain: geanix.com, ip: 79.135.106.111, mailfrom: sean@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1794916927; x=1795176127; bh=DZFM8AP0bzBAP2gafMNvnUzUK9jBtpMzZE/FCgKuFkU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=eP7ZjMeDHVhBUqTl8TWgPz3BUSX0I/0xAXcuOTzmCt6YRC1zQ9kO+EsBFZBdecfdV ivopszEBpbsDxvTfYXb97wIdJNOs+Z4TvAn9TSrIgSBLzMkK9D3bOC7ILVzOcWkVUN LkAvQ30eZpasCCW6R4uOwgl7ypOe248SOdgCbp9bBr8tR4wBalsyneUBOTjnqqACXt qbbMoAhCgWYSKWG4KtgyRQDldxjuMeFyqxj2YACYmD6JOk9q3CMQL4gIMwkJSjjQ40 NHjnyAPCFajhSmK4dB+OQQwvZ4k/U6ph6gh7Iod5SOtsJ03ymxuLA37T5kHOSWlObV Eb+APgyZu5E+w== X-Pm-Submission-Id: 4jTNdB2lZyz1DDLk From: Sean Nyekjaer To: openembedded-core@lists.openembedded.org Cc: Sean Nyekjaer Subject: [PATCH v2 3/3] oeqa/selftest/incompatible_lic: build the SDK in NoGPL3 core-image-minimal test Date: Tue, 17 Nov 2026 13:01:55 +0100 Message-ID: <20261117120155.3986876-4-sean@geanix.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261117120155.3986876-1-sean@geanix.com> References: <20261117120155.3986876-1-sean@geanix.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, 17 Nov 2026 12:02:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250436 Also run do_populate_sdk in test_core_image_minimal, to check that SDK host tools (e.g. nativesdk-autoconf) are not checked against the image's INCOMPATIBLE_LICENSE. GCC-exception-3.1 and Autoconf-exception-macro are added to the exceptions, as the SDK target sysroot includes libgcc and xz-src. AI-Generated: Claude Opus 5.5 (Claude Code) Signed-off-by: Sean Nyekjaer --- meta/lib/oeqa/selftest/cases/incompatible_lic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py index 406f92e37b..eafe63ab77 100644 --- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py +++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py @@ -159,10 +159,12 @@ class NoGPL3InImagesTests(OESelftestTestCase): def test_core_image_minimal(self): self.write_config(""" INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*" +INCOMPATIBLE_LICENSE_EXCEPTIONS:pn-core-image-minimal = "GCC-exception-3.1 Autoconf-exception-macro" +ERROR_QA:remove:pn-core-image-minimal = "license-exception" require conf/distro/include/no-gplv3.inc """) - bitbake('core-image-minimal') + bitbake('core-image-minimal core-image-minimal:do_populate_sdk') @skipIfNotFeature('wayland', 'Test requires wayland to be in DISTRO_FEATURES') def test_core_image_full_cmdline_weston(self):