From patchwork Mon Nov 16 16:08:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104397 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30989.1794845353761927360 for ; Mon, 16 Nov 2026 08:09:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=wlYyQ45i; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id EFC2C1A169D for ; Mon, 16 Nov 2026 16:09:11 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C76C76023F for ; Mon, 16 Nov 2026 16:09:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1D82511BC0D5C; Mon, 16 Nov 2026 17:09:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845351; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=63UKRsUAMNhEFRaDD3C2kk8yJztFO8phRJk/6OBRS1M=; b=wlYyQ45iMAraXVsZwtk9CAdaQDIGqlZ+C7CXykBDZtewQzkhnuvFmjDWvEgTnhRAaLSdC9 mS5iDCL8KposTLJKyf8jTVDmGIQ9vS4H4TCFnRPoCjFOr4QeH97ZW3ColaqSRgby2a/hYj D0xwzR1drRCzzL3wCYMtXEPpjJ6w+rVjMOXI57gIk8RB0now4Z11laGy6izU40ADuY0Zfc p1vP+W7cwLLWWPuvFyouRCpJyM4D+0UjYlqpSxSyqgXaPodqYwmWGvO8sHvomfUtML6R0O CSXkLD8usemmXLfhnks1OkmIJ0rOjRfpRzD86A6HzlYERUsVKBWjmuG7F04Wxg== From: Antonin Godard Date: Mon, 16 Nov 2026 17:08:59 +0100 Subject: [PATCH 01/13] lib/oe/path: rename "metadata" parameter to "d" MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-1-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=889; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=xuxTw7BM6wp9e2uzkdVZc6od/sfjSLubfUUjRQ1WS80=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqdUSWdTM2h+1EsSX9fg3PgaikriuvpICXiE EN9/qChHu+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnQAKCRDRgEFAKaOo NkKiD/4pgr/54jKTY1T1bxM4HGb9f+o2VjUZoR9xOnvH1QJVot/IRlge7GeDmnnId45y+drUlD9 Lu7beaCsI6GlLh/WwSEr1QUqJfQHi8RZR3QVXF8QzQaEd8WtsGeSxDaUAQ7FAeTA4M3pBj/A3WJ phiRdkt1uZx9eEmcKcK0Pf0kFFNfL3nX6aQGuVf9myHta8UZA2cdWZvA6jv4ZWOs7uzkThfpYMJ c0oZl+IFsCtVKXmwAx/1Ye7HTtYhK9XFRQNpNiQkoQBsOci+cjifCSn+RA+gw2GLufk4wiowE44 UyjpsktAgWOVzYhtII3EWnnjLSwh9J+Nw7SpVB4mzn3ZZHQ2E1qPC2hE2AeQ1jMvHWmQB772xiZ ZaKYxsEzc1UZGm/bl0v4NJnJJItlXWsCvocaPcd7A4xT+dLr2Brxewjp48vyz7WmOzDDsNI3RCu 7hB5yPkkyPmfHhZM7hANPU2pIBL4QxkeovkTDaqpyjIr4jrhMXMJlQJ899/gOHqSBmU0giXXOM+ tCWLT4571+8McAreIf/gdoTNQ4wJ1t499qHjYikS3BECHPFEyDl6FdZLhuuoIP94JtEoBGE6NPF AR7Je5n4BJHs+stgKGGIZxDLgGKLwZCozoUORrLiNEzZMiXPCLT2cv7oriOwQeFp7q1Q3Z7Sq7Y h2Q5o4dBLC3scbg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250351 Using metadata for this argument is confusing, as almost any other function in the oe library uses "d" to denote the datastore. Rename it to "d". Signed-off-by: Antonin Godard --- meta/lib/oe/path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 88d256f00b..8fe5bbc7fb 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -81,9 +81,9 @@ def replace_absolute_symlinks(basedir, d): os.symlink(base, path) @bb.parse.vardepsexclude("TOPDIR") -def format_display(path, metadata): +def format_display(path, d): """ Prepare a path for display to the user. """ - rel = relative(metadata.getVar("TOPDIR"), path) + rel = relative(d.getVar("TOPDIR"), path) if len(rel) > len(path): return path else: From patchwork Mon Nov 16 16:09:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104399 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30990.1794845354150093144 for ; Mon, 16 Nov 2026 08:09:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=UDGYuHS7; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 878D31A169E for ; Mon, 16 Nov 2026 16:09:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 534966023F for ; Mon, 16 Nov 2026 16:09:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A508311BC118D; Mon, 16 Nov 2026 17:09:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845352; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=erSVqWI78lEnhpLf5UUPNQfFpKsZAeF7SptVYVYEBhU=; b=UDGYuHS7/qVCSMCgYqTjrHqmBvJGYRSsHxXaGk6iY5lcnfR9JjTnR+EWgoJWTv0ZryK0UK nIXv4AUguAr1ZaKYxdiRTR9JoAeG7omzVyF+1dvNL/F/78MP4uPDggdf3gntrh1yJbuVqs uloSERrzhxLjQKOvv0As/bCiq8O5O6WXotw42+mnSvdOdMpuP21K+WWOGzPTr3bJKYuYB/ Pnb2lMKHzra9+WivoFYcOM9eojReOcNU1CLNhgsXneQcgMkrHg4FQNUAK/n6m+LWennqs9 5M1p659jXf6ta2RaHfeODxGZ5HAp0SuB5CTHLTzEkLVzqQh/jntL2fOko3TFog== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:00 +0100 Subject: [PATCH 02/13] oe/path: simplify replace_absolute_symlinks() signature MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-2-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1274; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=q7pMTPCD5vnTHQe370SEIfvRBunRiQ+NtLjn/hH9tZ4=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqeML78+LPk6oa+bo1b+QHZUNmGLnsRNYG1M XSCML4irrSJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqngAKCRDRgEFAKaOo NpmAEACZvqW3LF2DoDjHFnDaXXaPmY6E+Xwwrh2xF3AJD7wHUoMEaWfBaVn6ODfp0gJ0Ki6nJEL rCM8GIUFOaI1P1fGkt4pFv/hz6PEl4hF5A61Pv1+jMZB6p2HKOoZaSbWiju36wnyd0NraO0wyHZ pJhq58ArrUuuHCRYnykirbqcdlEGG4oCZ1na3HbOIpq3dO71+jmywfO8USKdbrbfwwdIMSXi/IA PRTrokwVpVmcDV26BPkfhCmHGLjlaV+MrW/gutjXFBIeS/GWk1BTsixquo2fFZB4W5/ypBMpDKO 5fFiN1DoVf+sV1XLpa73T5gO1Wh0asG/UdT4A0qhdNE7yhrsL7pE2XpP87HfQhrjFjlxWre/n3z ktF1BQt9sNjGADL6Bzj8rbt1Fim8nZsNXHVZdkSPp9EwZNnlz1gVJK9swsLOA/BAkkoQksvNcqM 2ukQuk9vcdA59+u9J+vseCmUn4d+d+sF0HG2FTec0heJzu/6HNB2ILQooNL2An/kY2N3fWsw8Zt EJIjQw4TTQE3RLM9j/PF9i2PZikE7GVpDSwvTXbrM9dtSCakgnWKXc/xrIqHftbWPGcskY/1iB0 JcZkPmeWopZOUFh5QQRbuwD8CAMrsXJLqghVFMrD7k4PjvYAnLcg9sXic+h0vTBoZIVbhTahHdx ZE7efhHvxyRzgqg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250352 In replace_absolute_symlinks(), the datastore (d) argument is never used. Remove it. Signed-off-by: Antonin Godard --- meta/classes/relative_symlinks.bbclass | 2 +- meta/lib/oe/path.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes/relative_symlinks.bbclass b/meta/classes/relative_symlinks.bbclass index 9ee20e0d09..d2279028f2 100644 --- a/meta/classes/relative_symlinks.bbclass +++ b/meta/classes/relative_symlinks.bbclass @@ -7,5 +7,5 @@ do_install[postfuncs] += "install_relative_symlinks" python install_relative_symlinks () { - oe.path.replace_absolute_symlinks(d.getVar('D'), d) + oe.path.replace_absolute_symlinks(d.getVar('D')) } diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 8fe5bbc7fb..366ab9720a 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -59,7 +59,7 @@ def make_relative_symlink(path): os.remove(path) os.symlink(base, path) -def replace_absolute_symlinks(basedir, d): +def replace_absolute_symlinks(basedir): """ Walk basedir looking for absolute symlinks and replacing them with relative ones. The absolute links are assumed to be relative to basedir From patchwork Mon Nov 16 16:09:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104401 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30992.1794845354804845014 for ; Mon, 16 Nov 2026 08:09:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=x62nqn6N; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 28EF21A169F for ; Mon, 16 Nov 2026 16:09:13 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id EAC1D6023F for ; Mon, 16 Nov 2026 16:09:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 375C211BC146D; Mon, 16 Nov 2026 17:09:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845352; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ryEfwLen0B/rVC6M1HewAeLDnPzdGYMrzQRUfP4UTIs=; b=x62nqn6N9z6tNmJ70wBOwsHGfZM4omQyq0fTfOwJbycyycM8GdwbR1GoBNXU9fWfKAAgvj UaIq+p5FM9IP9mvFFKxM45g1T2t1W/ZS8vHW0zMRuzBxsqhqjwGxADe7cVaTP7Wv6uIStJ goLZhF5Y+S/vz9BFzNjvRIUHIQEOiw9loENAhKXV5218pE90rULxwvGirsxeAPLwy7G8uc V9TkabVsbZwbQLotZVYV/jdgk88Dh1aAL2dfcbS8z+gR/wWWqy1h1Xp3Jdn0vSQqM5G/uy yGuA7Jgs4c8Mwh2TzFQfci0E9qHaBdgqXc0+Dyc5U51L4UxRRH2tOVCAPLWnvg== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:01 +0100 Subject: [PATCH 03/13] lib/oe/utils: simplify str_filter*() signatures MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-3-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=800; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=/ZSj1SvhnKiO8WCpuTuwHTmmhLETnM5GIMmCoRXN01U=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqew7sqb1Lx1gVXVoeHgcVscwslWxaehTEpk LGOrpa4p2iJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqngAKCRDRgEFAKaOo No77EACPe/ky9gDPrbLlJ21iAEsG1jYVrx8uvJ0WGPPnBcQ4pTYgCyoRNvmRwmvZvS8ZBAvqbHN UE1XIE0Kqb2KeaJc9Eg/xZGdJ4HJBwO206TBrwN8KOhYat17aIe2o7hkq3acYJUPzaCgwvbhgPW TOJ3mswZB2cj5MTAKVu1B9+pSNAeBt420v/e26tt6FN5KLK3fPy9X9rrvj8y8KIpyrmXLOUVdCI sYbAANQ5cVNG/VA4WC7QKvqp8663sN7TZ75ndMhmk1ZOpoORXK4gGX8DFiDyVjLwBfLm5ARmYAK 0O+u1P0Ag0D9DaLuRWMwIBcoqeoBNqAJaVcfYVPVti3QEHHJiHLxdrb4ECpbuA85Zq5QWqAIcLN +f0inPEDyL3Sk3y9rpUdqFc3pvMSNJxtxxPL9n59jT3OhipJmeGDK2UAf9WHW0CkS5E2ovCDZKp x0JFeQ7PIv0l0sO8TFhmN6yOKzfMd+73OQFNI/fg39mp8TV29txqOR/tIAkT4CElbHosUMUu0NR 2yEwOeyDvbR/K8MiPW9Lo1uhd8uQ7tIZGX/4leRK4KJpisQDWtZVfcjrnO5zQ47AgnN5AwVOmXP Ht0VhZEEgbpKMCkONZhB5Z3PDMAhYWjB0f3NmT3E8Qy7kZGlqGIVcoJRpjUObQVQ5N7AjmUFtut ffMafiq3pohjSrw== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250353 In the str_filter*() functions, the datastore (d) argument is never used. Remove it. Signed-off-by: Antonin Godard --- meta/lib/oe/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 66f6323add..5d4f4056f7 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -132,11 +132,11 @@ def prune_suffix(var, suffixes, d): return var -def str_filter(f, str, d): +def str_filter(f, str): from re import match return " ".join([x for x in str.split() if match(f, x, 0)]) -def str_filter_out(f, str, d): +def str_filter_out(f, str): from re import match return " ".join([x for x in str.split() if not match(f, x, 0)]) From patchwork Mon Nov 16 16:09:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104403 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30993.1794845355184849057 for ; Mon, 16 Nov 2026 08:09:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=pbFobBUr; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 9144F1A16A1 for ; Mon, 16 Nov 2026 16:09:13 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 61EA06023F for ; Mon, 16 Nov 2026 16:09:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C65E511BC17FB; Mon, 16 Nov 2026 17:09:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845353; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=hyxQjLpkhfDwko0vCWvsgY1ltOi+RMZDFstg+0CBEfI=; b=pbFobBUrBmsUmMZsKcnJNNzA9+H8pLe20KEq+fNh1/D+G8Lo2j7Jx/m3NHuT+qTwXPmio/ iZ1FX2nhMQxhzeZ8/69VP5EDi/LuLLjeWhN/LKnvPon2iUqOJeD+tD/5lOaOSrj2rY6KAo pSKdi8AHF/uDex/iod0JPNIjVTF/QVoyUCtCMQkUBwj+G53LApkCchL3SF+wr1+50n9CSN CkeGzVP2iYnWMiP+5znwCuvE9O9P7btVk3A063CFNFGA/IvdxMfqPuwhe0P27yVdjnUCpr lbyEZmHy+ZFYWojgiV+AU8O7pzd9e2/P/THW/b4k3IYLDQfi6L5TnrcVlpV92A== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:02 +0100 Subject: [PATCH 04/13] lib/oe/utils: drop all_multilib_tune_list MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-4-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1633; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=+RyAN+gimrAfLw/L/Dz0wxeRzQC4D1Vmog+h0vlgx0E=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqeWkWvKpfVj5+U2JPDya36E+C4M180UK5pB 44dE+lYBA+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqngAKCRDRgEFAKaOo NhV5EACk5qDya2tsnC0vJLPH08LlibjyQOH9zJ0xbZAgU0FvQ/fjm2n7PF3D8vtMeDi/ThkDZJr 3KSPbjddVGB2Q8khMYZBgyy0jkGDJii7CVTLG0Wny7IiADNCH6lojIItP1sZ0J9Ae1eCgSLWzcD 7MQHhUxF37uuW0ZdI4CzPD2FHhftMvIWtsjiAAT571BGYl9zt+iRwRi/EGCmyIw2Qtu6/5d/+7u XYHrCAET8906+x3aQb/E+AqAYQh7FNrXqQW2SnFnx0LEBigBGHZadL7rcgtfrt/NNFO1OAKMy/3 +tjEp8G2juy4dP5X/WbX/aSf8+Lian7AAFuIyiEf5MVGckeGnc3qD7qFGqj1n55yPt2eKCVwIpw e4SS3RHx7AF5hGJOJGHL2WMj+3cjHycbcrl2gnizsKQ/RMZVTTvYeGTv+X9+QAThZ7MOqePzk9B tmYRdQuuKzL8t/rHbG3IyqHVrBU+Bw80/ext4dgXV6L0S3lcdbl6o5ETutbJNgilhfyodxyi4nx TMwfaTAry6epMZ4zxKpGIDxIbh7t5xeV1vcCB1DXHbrFaa6d6rVnQC1AUnMqC8G9cobLh2ton5N G0P1Yjbnc2EM8QX9d40dlT1wdmTGQDk1OgAvhJO3IF/a3uVNfvI37PazD5pbLPeHS1nbwROwQ2Z cTTYHAeFJzf3n4Q== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250354 The last user of all_multilib_tune_list was prelink, which was dropped in 2022 with 23c0be78106f ("prelink: Drop support for it"). There are no other users of this function, and the current function is broken due to its usage of oe.utils.get_multilib_datastore(...) which should be replaced by get_multilib_datastore(...) directly. Drop it. Signed-off-by: Antonin Godard --- meta/lib/oe/utils.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 5d4f4056f7..a17938803e 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -601,25 +601,6 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' ret = values return " ".join(ret) -def all_multilib_tune_list(vars, d): - """ - Return a list of ${VAR} for each variable VAR in vars from each - multilib tune configuration. - Is safe to be called from a multilib recipe/context as it can - figure out the original tune and remove the multilib overrides. - """ - values = {} - for v in vars: - values[v] = [] - values['ml'] = [''] - - variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] - for item in variants: - localdata = oe.utils.get_multilib_datastore(item, d) - values[v].append(localdata.getVar(v)) - values['ml'].append(item) - return values - def extend_variants(d, var, extend, delim=':'): """Return a string of all bb class extend variants for the given extend""" variants = [] From patchwork Mon Nov 16 16:09:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104395 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30994.1794845356512341234 for ; Mon, 16 Nov 2026 08:09:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=Qgg41OCg; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 538BE1A16A2 for ; Mon, 16 Nov 2026 16:09:14 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 19CB66023F for ; Mon, 16 Nov 2026 16:09:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 44BCE11BC183B; Mon, 16 Nov 2026 17:09:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845353; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=odUslp78jxejskfKYFTLdAj8mz5TXhN3w8EuRAOQtA4=; b=Qgg41OCg2bTJ5CQmht9KkmB01BZwhuJn+poRefvdyeGPrCCkDHx5hdm3r4dXqzY2i8EPVS Zm8hWR/27RDrHmEfjgNlrnuGFYNrd1OQUswdHU75GMK9xR4Ttl5L1L7Jd9+gMM1BLSdZTl hviarulk/OW7dcBun4CAtOgugq/Tkm/Mw51Llcgmv0+MX+3BdLsoRbXRMTH8F7Fv+/7RfV jO2iZ1wSmfeZo8LX5pMljikFoGm3feBGXKeHNL4XdjmngpcRrnWPnm1lfyXlwR9Q9LMvSz azX0BQ/zb2iKSlaksyucXiP7fpvViZI+T1UgqLJeUrB7Yx3wgnL3nYoJPukg2g== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:03 +0100 Subject: [PATCH 05/13] lib/oe: move oe.types.{is_x86,qemu_use_kvm} to oe.qemu MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-5-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6357; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=5g75g5G32gbghO0JyjWQauFPgsQQZcnvbSy6uApnX7U=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqeBUuc/CNRuHYOnyqypvUpdzf4f14gzqShe Qlrrl21UISJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqngAKCRDRgEFAKaOo NlNBD/97QxFHXma8amPZagp54ggsLBV2EvwAaaKO5VtFTzjuyPfR5yn/rTcnCpovLQGpAj0NOvN kIYq4Q84hrTtU6tn+fFcIGlANb7hpgo4pkrK8VVKR8jawvjEsZJ6ZUMSznjpDZNjpLv8wAUQUsv nVmteDL1Uo30u+uNyvr6qQZVIQuozJaYIZQK7JOCXpqz47Zc+yoO1qZYR7/fs71tphGMZ3aYKf4 L7IIHhRqxZhvsUYcsleTjhCvmfhG60Et3wRa++Fgqe632OjTRHjTo/PUByihWNcfzRQUonguZ1w 79u2zIOTHE6GggdLVwz/KmmVPOONrAqK0kp/mJlsTCjfgulRedvwNgxfIFv7B0aRjkNgrn3pZ05 sw6tr2UNGL0M6U8deOUNqBRS9P5NHEEoC7QrA01mi7/+LgMNCvUQZaoTykXurYWGRdFdv3ICMVi KyThkz+EwW8JfbN+qso7zDM1FDDFA5OFXkmCwTNaMKgLU/94/Bj41ZC5RxOn2bXuAL5+XAGLu5s KyGwVKqGCvwVj1L3h/Uo6B3xGL2wRag4Q3VEs7HKZl5s9TZv10mnP8qxCqbrzczKYqekrE8DmxI aOmwsoPfslYSZpqqkiBJDK08xO15xXaHqvkBG24ev2Zypop5n4GQgckG4np1aCTuTP1+MNOJbGl vS7fRTXZRxL2Rog== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250356 The oe.types library represents OpenEmbedded types such as booleans, integers, etc. which is unrelated to what these two functions do: is_x86() checks if a given arch matches the x86 architecture, and qemu_use_kvm() is used to return True to enable KVM based on the current target architecture. Move these two functions to oe.qemu which is more appropriate. Adapt usage in OE-Core as a consequence. Signed-off-by: Antonin Godard --- meta/classes-recipe/testimage.bbclass | 2 +- meta/lib/oe/qemu.py | 24 ++++++++++++++++++++++++ meta/lib/oe/types.py | 23 ----------------------- meta/lib/oeqa/selftest/cases/efibootpartition.py | 2 +- meta/lib/oeqa/selftest/cases/runqemu.py | 2 +- meta/lib/oeqa/selftest/cases/uki.py | 2 +- meta/lib/oeqa/targetcontrol.py | 2 +- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass index 9909c928cd..0c1a55a4c9 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass @@ -288,7 +288,7 @@ def testimage_main(d): boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")) # Get use_kvm - kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) + kvm = oe.qemu.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) # Get OVMF ovmf = d.getVar("QEMU_USE_OVMF") diff --git a/meta/lib/oe/qemu.py b/meta/lib/oe/qemu.py index 769865036c..abe2745b10 100644 --- a/meta/lib/oe/qemu.py +++ b/meta/lib/oe/qemu.py @@ -52,3 +52,27 @@ def qemu_run_binary(d, rootfs_path, binary): base_libdir = rootfs_path + d.getVar("base_libdir", False) return qemu_wrapper_cmdline(d, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary + +def is_x86(arch): + """ + Check whether ``arch`` is ``x86`` or ``x86_64``, return ``True`` if it is, + ``False`` otherwise. + """ + if arch.startswith('x86_') or re.match('i.*86', arch): + return True + else: + return False + +def qemu_use_kvm(kvm, target_arch): + """ + Enable kvm if target_arch == build_arch or both of them are x86 archs. + """ + + use_kvm = False + if kvm and boolean(kvm): + build_arch = os.uname()[4] + if is_x86(build_arch) and is_x86(target_arch): + use_kvm = True + elif build_arch == target_arch: + use_kvm = True + return use_kvm diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py index b929afb1f3..c4b338921b 100644 --- a/meta/lib/oe/types.py +++ b/meta/lib/oe/types.py @@ -163,26 +163,3 @@ def path(value, relativeto='', normalize='true', mustexist='false'): raise ValueError("{0}: {1}".format(value, os.strerror(errno.ENOENT))) return value - -def is_x86(arch): - """ - Check whether arch is x86 or x86_64 - """ - if arch.startswith('x86_') or re.match('i.*86', arch): - return True - else: - return False - -def qemu_use_kvm(kvm, target_arch): - """ - Enable kvm if target_arch == build_arch or both of them are x86 archs. - """ - - use_kvm = False - if kvm and boolean(kvm): - build_arch = os.uname()[4] - if is_x86(build_arch) and is_x86(target_arch): - use_kvm = True - elif build_arch == target_arch: - use_kvm = True - return use_kvm diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index fcfcdaf7e4..0899d57c0b 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -17,7 +17,7 @@ class GenericEFITest(OESelftestTestCase): image = "core-image-minimal" runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or "" cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params) - if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): + if oe.qemu.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): cmd += " kvm" self.write_config(""" diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index bfa76812ae..bdd5ae1bc3 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py @@ -34,7 +34,7 @@ class RunqemuTests(OESelftestTestCase): self.fstypes += " wic.vmdk wic.qcow2 wic.vdi wic.zst" self.cmd_common = "runqemu nographic snapshot" - kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) + kvm = oe.qemu.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) if kvm: self.cmd_common += " kvm" diff --git a/meta/lib/oeqa/selftest/cases/uki.py b/meta/lib/oeqa/selftest/cases/uki.py index fc31fb767a..6283df540a 100644 --- a/meta/lib/oeqa/selftest/cases/uki.py +++ b/meta/lib/oeqa/selftest/cases/uki.py @@ -21,7 +21,7 @@ class UkiTest(OESelftestTestCase): image = "core-image-minimal" runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or "" cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params) - if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): + if oe.qemu.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): cmd += " kvm" self.write_config(""" diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py index 1deea2e5ce..23b26bc2b5 100644 --- a/meta/lib/oeqa/targetcontrol.py +++ b/meta/lib/oeqa/targetcontrol.py @@ -108,7 +108,7 @@ class QemuTarget(BaseTarget): dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") if not dump_dir: dump_dir = os.path.join(d.getVar('LOG_DIR'), 'runtime-hostdump') - use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) + use_kvm = oe.qemu.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) # Log QemuRunner log output to a file import oe.path From patchwork Mon Nov 16 16:09:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104393 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30995.1794845356605390303 for ; Mon, 16 Nov 2026 08:09:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=OOY3oop6; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id EBD691A16A3 for ; Mon, 16 Nov 2026 16:09:14 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BCB996023F for ; Mon, 16 Nov 2026 16:09:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E17DF11BC0317; Mon, 16 Nov 2026 17:09:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845354; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5eqxINrBEUOe71bmf86eapWyGqhkQBY/vOQ6q9B4P1g=; b=OOY3oop6a9d3pk9rxf+0i4qmG/SpZip67fu9i8+6loJOthfPEcFfRoCXV7h31IGMBHV4Cf BYNzJC5dWZFKkKlIxxWrDlq6LtOQYmTRRiu4HASWbnEKx6totUf1NNdeGkPE+clUOT2fY5 0SotLh1dotObkNAjetX6p1cXFAg/kZIGHNm3edXfX0STCCZ+e5P0njEJsez892hOPnNDzC CyzzoOW2UPZ0XgLWg6Fi9JHMAb+I1oSbVJEDSTzi2Z1lK8Lk/uPys8F5LhTB/2LnBQPU1l 14zBS8mvnk+7yuusOu48TlthR0pyzoKxBsOLXUYthSF6H2ufqz0L6M4n7JWzGQ== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:04 +0100 Subject: [PATCH 06/13] lib/oe/data: improve docstring for typed_value MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-6-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1534; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=mGk+jWHlWPMXrvba/NZcs0/5NVDOS/m3IVz+VO5iiGk=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqeG7x7YxhiqT1Rdt8sAmxi79Dj8fLBQIKZq +VxfQ/6pd+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqngAKCRDRgEFAKaOo NlbTD/4kjI+7QoDZPj261qP5JrzUEYL9A33lAPLeYU54j2oWywNWtGOMnQj18D7V+ela9gqvlJv 3ijA2rIhcbJZjFe+RDXB5hjrFohr8/pIJc3+K3Dr5O4dKTk9tCe2IudM9RVlpgzLPiTUpbO8AYz 7gOrCD1dogMYNLTCJQIHlRxotal7zOgfKhAC2JAOL3t4aRF7hoi5GzB6QLWprEJCLTaNzGV5MTn nqvbnCqedn5JQr1wtp3FwCUl4pqZHHFqCB2u6ve1js2sA5hyVUOXje4KbsVA8z/GxgmVCizFq7K L7YckU5/gw3tienfKxk8NkBHJP7Xhnyrtb9ZEQe0b/0qzMJX8TS90kW+7+Lxppase02EJzj0ypy fnFtHEElARayMQQDIlIchJxvaJw+dONktVC0PYAg6kAQHtKYXjkFoTv3lsgkwsOQPuwvAB0f1Hg uABHyT69FR/fqCTVjqN/WWDtF/WPlimt3ZdlIa658aUH9huIhv/h8vN/X0uJD2fvJqkhxxWNFtp cfFLEV61zh1j5RvmZNYpnsLJETNShdQzUWNezJUSGRf4UUMmSL2ZuJMcWeGWXOOro4wTGYq5h/n XapuooQBc9Ec3E8WIdgcsd72FndgYoMj4HHAnqs5f8sL6sZ9t4c1rw9a6qAtZv6YxwycPb0w6P9 o9KuaJ9uFMOSpzg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250355 Improve the docstring of oe.data.typed_value() with an example and details about its parameters. Signed-off-by: Antonin Godard --- meta/lib/oe/data.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py index 37121cfad2..e9ca87dc16 100644 --- a/meta/lib/oe/data.py +++ b/meta/lib/oe/data.py @@ -8,8 +8,32 @@ import json import oe.maketype def typed_value(key, d): - """Construct a value for the specified metadata variable, using its flags - to determine the type and parameters for construction.""" + """ + Construct a value for the specified metadata variable, using its flags + to determine the type and parameters for construction. + + For example, consider the following definition for ``FOO``:: + + FOO = "\\ + /path/to/one \\ + /path/to/two \\ + /path/to/three \\ + " + FOO[type] = "list" + + Then this value can be iterated as follows: + + .. code-block:: python + + for line in oe.data.typed_value("FOO", d): + # ... + + Take ``key`` as the variable name and return the object, for which the + type depends on the ``type`` variable flag of the variable. + + See :py:mod:`oe.types` for more information on OpenEmbedded types. + """ + var_type = d.getVarFlag(key, 'type') flags = d.getVarFlags(key) if flags is not None: From patchwork Mon Nov 16 16:09:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104396 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.31636.1794845357078760590 for ; Mon, 16 Nov 2026 08:09:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=WxvWAPEX; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7EAB11A169C for ; Mon, 16 Nov 2026 16:09:15 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4C8E86023F for ; Mon, 16 Nov 2026 16:09:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9102D11BC0D5C; Mon, 16 Nov 2026 17:09:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845354; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5eZCc3AdH/ZoNFBOU9VFpsnJRGE9u1X+WEiihLqjyaY=; b=WxvWAPEXrkUQXkVbdNXPK4GPCdofKOkBSK/TcdDe0grnUXxRWfHaQT4IhMU2r41MYlDd+v vnbdg9UpPZ82vqQ5VNkS9a0hws1y9ZO2+4+hNcpA9Yv5B6peS0pWGYUsjueRhrOjiYhkeV YtbBSXO3+PoxhHBWx6f5vkUbqVPVQeWBkZtCKkEiSc3qIbAs9ElufsrkC3vXylbyHzEcNA K5UEUXb8JZP6VX8Mjt4G4tAw0PKL/tDuNOPnZ8wGWE0/WcQLHttq6V8OwTw46vaREFf9N0 mPzr0LyidUkubAEPBBoAV/Mh6SGcFvuSehALVZf49vM6R3g9WheNPXYC2YumFQ== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:05 +0100 Subject: [PATCH 07/13] lib/oe/go: detail map_arch() parameter MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-7-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=976; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=XcEyZAOjR3hj+4RgSZm9l9g6PfrNuh4CPWLUdIOiTgE=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqfDymKV3oE7Ht13dAL0xfvhuwSUDjIrZ0CP 87QdTUrdjGJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnwAKCRDRgEFAKaOo NosfD/9llY0FJsDu1PvPND2Fn0Ms6rwK2Fs6HSzZq3w+408OTT/s6RB6DqL5xepLbE5VHPjkZbx QS2iK3srbRlJos3bTqVVjUiz2CjoySgRz/Xj0owhmG29DRd6JmoCzMe79r/DUtlDVJ97LqyGAk8 yeX/ePjQrhMY3u+kliuDeJjJcQn86Awrp2CizvW8GXY6CP/U37PHxISsRo6wD9rpqYlsIMag8rr i5pvKWAV0lfCFDQcInafy/0s384NsHKT3u0k9mE2iY/BPbHIX0d6PSDhTvtWJeSp7OSKm9K1kru f9hG9ZOQsZnhZElqnnAG+6rRlSmCyyh8epEeQqm2s4RQpRTC3FViZn2eL+VAGM7eE0vBw+OQGUo gXbBLl5bfsVoKoSSIxkRW0T22VMFq6+KNGH9dK09Wmu/hF+dPRJ+n5dgxcAVajE1XhtRZvLSCWY ihVvPm/TCJYwT3xaIOwOMqbQeHS1lFXB9P8wmq8Zt0eX+71cJR5Sk/1hvA4nqTY4lac9cGvXxoN vT2OnQBD2fjaJikOoOsOoj5FHhekRENohfiOBbWEwLb2tHc3fOlXUv9TGH64R4o6IVVOxvVlT00 GxreIOEdBqDcf287kvJR58meCW0++QtAhQMZgEEHmGZcfRDhXjPNrDxlHj2mbHpXGpabJWlUpXh dpBDBv7s6b+30yA== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250357 Detail the architecture parameter for map_arch(), which should match TUNE_ARCH. Signed-off-by: Antonin Godard --- meta/lib/oe/go.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/go.py b/meta/lib/oe/go.py index cbcf80f0b1..2a2cb7e75a 100644 --- a/meta/lib/oe/go.py +++ b/meta/lib/oe/go.py @@ -8,8 +8,11 @@ import re def map_arch(a): """ - Map our architecture names to Go's GOARCH names. - See https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go for the complete list. + Take ``a``, the architecture name used in OpenEmbedded (see the + :term:`TUNE_ARCH` variable), and return a string for the mapped architecture + name from Go's ``GOARCH`` names (see + https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go + for the complete list). """ if re.match('i.86', a): return '386' From patchwork Mon Nov 16 16:09:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104398 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30996.1794845357645232928 for ; Mon, 16 Nov 2026 08:09:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=lNmWL03P; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 131711A169D for ; Mon, 16 Nov 2026 16:09:16 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D526F6023F for ; Mon, 16 Nov 2026 16:09:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 14F7211BC118D; Mon, 16 Nov 2026 17:09:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845355; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=mOZVTJO0tHxsgzCcAmy0WwL5XJ/AGNkBXwhcxCI9JFA=; b=lNmWL03P73CGXyUANLhBhURB8i2Jfavv3BaM6iG+Zd/zFy8CvgEGB+w1RF4DJFdHdI3OX/ 70y/MPCsJ7PpPVARb29Sqd0d5nAKs/7YFS7AKP3m+vcBnhsvn89wPeW9z0DP1f0pvjEY8D st4JcaKehcZsGbksIylpykcCEp7Xd8tOpgh1L4AJx7btcfTSQAQ6N/SLnFC3pMo1LC6hmm GF7SIpHupfZR+do9hAS+5IOvRCXOxoK2VSIUR5MNuNiA3hQagWS5t6aBbBEb24bZeGP4sh CCs9jNJ82DT9CLtcfInQ7ZoG4GA4nEiginHOAEFvTozFyqkedWIZyMaTE1Gnjg== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:06 +0100 Subject: [PATCH 08/13] lib/oe/kernel: convert comments to docstrings and improve MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-8-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2300; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=/yYCp1M22XeRIT2Y21p45vhIwKetUPxykt7Tg1C/NEY=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqfnAOXiM8TpG3goBtvMLR1QerKuXIGYWd05 Bvm3s1gpweJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnwAKCRDRgEFAKaOo NvLnD/9ojDbgYramBCMwQi2BGJuHFJvEHavr4Kfb7yKhqe9Amjz3GFkRpNYNBe02ZA7dtse74yG fyhsUuXh4J3tGCput98QGGGs+B4DUFfqWaZk5TYZB6pkrRi+Z2KBSwhQwwT7mInKUGipiyyJ4P4 UYGAdUlPkYsBmlCjWXkRKDL39IclIqjaJX+itcCyxJ/yDZehGJeY8PhWPoshFZv+N0f4gMQp4VC LJdAUvi0eE7ysbuVdCbhSoIc4k+zm/yPTwN6dawJ0Aw3UgfsCPTN/AWFGngTqWGoPAeAQMlhAbm sw5bx7MNJ7VsF1IF/rBMo5jqGOArFs98PKIHCV0I4ig3pPwJuT+4YswdkVVGNPtuZGMPIUaa4WW Mw8+8ynMCQNp5e3WsRvwyo1+MD/VGaBXhxNivb9QaqYaceHThc/PKvLJ3bhdOfvuOv6rPwifAFt 5mcAmIuaFDnYQt9S5poZXI7t8TGzTZBjLSPC/HGsYp+8hBEXZsl7GTXmqdvFKxDKhgpWt8xrOoe xNiBsA2EW5+0vyjRTqTiVIBNtofCyHBW6nXPKivU7s6aUyuk4GA7rwZmmTutmlMv3yFJYzGeN10 2/C2u1HATN/Tbh+1MFZTvnnLAaXhsQopBLxB4JuZYtZZUWVBWZ28MBD7FZJ/aF//b2i8/10nmMd RW+xMvk1HVeDzdw== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250358 Most functions in this module were comments. Move them to docstrings so we can use this data in documentation modules such as Sphinx. Improve the docstrings by detailing the parameters and return value. Signed-off-by: Antonin Godard --- meta/lib/oe/kernel.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py index 624eace10e..5c94a5df90 100644 --- a/meta/lib/oe/kernel.py +++ b/meta/lib/oe/kernel.py @@ -7,10 +7,13 @@ import os import re -# Return a value for the ARCH environment variable for kernel compilation (including -# modules). return value must match one of the architecture directories -# in the kernel source "arch" directory def map_kernel_arch(d): + """ + Take ``d`` (the :term:`datastore`) to get the value of :term:`TARGET_ARCH` + and return a value for the ``ARCH`` environment variable for kernel + compilation (including modules). Return value must match one of the architecture + directories in the kernel source "arch" directory. + """ a = d.getVar('TARGET_ARCH') valid_archs = ["alpha", "cris", "ia64", "i386", "x86", "m68knommu", "m68k", "ppc", "powerpc", @@ -39,13 +42,20 @@ def map_kernel_arch(d): return a bb.error("cannot map '%s' to a linux kernel architecture" % a) -# Return a value for the -A parameter to u-boot's mkimage -# This would be the value from the table in boot/image.c:uimage_arch def map_uboot_arch(d): + """ + Take ``d`` (the :term:`datastore`) to get the value of :term:`TARGET_ARCH` + and return a value for the ``-A`` parameter to U-Boot's ``mkimage``. + This would be the value from the table in ``boot/image.c:uimage_arch``. + """ return map_kernel_arch(d) -# parse kernel ABI version out of def get_version_headers(p): + """ + Take ``p``, the root of the kernel build directory and parse the kernel + ABI version out of ````, and return a string containing + the ABI version, if found. If not found, return ``None``. + """ fn = p + '/include/linux/utsrelease.h' if not os.path.isfile(fn): # after 2.6.33-rc1 From patchwork Mon Nov 16 16:09:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104394 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.31638.1794845358417016109 for ; Mon, 16 Nov 2026 08:09:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=gTHU4EO7; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id C1EA71A169E for ; Mon, 16 Nov 2026 16:09:16 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9897C6023F for ; Mon, 16 Nov 2026 16:09:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A5A5D11BC146D; Mon, 16 Nov 2026 17:09:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845356; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=2P2RJ31q0ldhDBzgtw1+Nk/OGYcOeta3DLpnBu7Q3T8=; b=gTHU4EO70CfwKxqAZVZSlGTYbCdDpaUhZhATfQlljYaEwvX6CWvmnABDmzW79cN7I8S+Tm wM/1t5i0YrwxQwwC79snGMNPoa3vlu2J9ynuHLTlkdgTRDIo9hbCHkwIEKHR5lQkQx9CAu r48WNUgDjmK7vSz7/zSkfr+rMWicYVA5T5dUYNcHe5ufDV3gWB/lJlj8/3DpX4R7fFjCp7 EsD2a50EISyEsLoak5mpVsvuB6fGMHOQ+kj6U9sK0yWYboskNtVY1agG0UOMGNRGSkEJei TwXa6ENq64z8CW2JkO8X+FnR1kq6P/SEf0I/MxcyECtZW3mbnN36JXnIOA9YAg== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:07 +0100 Subject: [PATCH 09/13] lib/oe/lsb: improve docstrings MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-9-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1452; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=9bizxj7JyfSyb5wsBal2KqGjeqHll3MR3ML1Il9E94E=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqfLK57+K34XL8AlhwnzJES0jVjGHZUi064A IMtxhhomqqJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnwAKCRDRgEFAKaOo NqZjD/4gAOjq1pvSXgonio3EQizhSI3tk55hLwDSmePN2928+a5LankqCcmcuAcEPrgnW3L9k8V 8VbHNQzvFaY7vvDehVPLCIhnuR2EHnHn2TGSbJ6avksNmmZFJHfzfB+h6WMykTMuyKXujXbOJdB i0vjidMv00agpI24fWBOAiSA/Qi304S02ascNyAShNVlrARXSPQ/ALv94DCAa41GMXezYT8yPd2 yol1275RlxPks4e5jZTCn+GyedkwSPG8ig9PgHXpbLsXpmkuLTcv8Dd5YpFYOwerBx268ZurvOz KioKXxjvYUGPTuytxIzMvd7dAj/+Ui7qKIa/aZ+j59L9e2uFgJNlhRr0voMAPk8xvUtClbuylgJ LkufWuRtYflrAeAfu2DZECVmo1NbYWNUBxqOKJqV8viGBrwOhZu+ySiakpmIBXLudiGsnBZT5vP MT/I550OpKVPH1qp9nm0AGXd5xXxtAF6iMNnFOZqKtSWICpYQkNZ7b4K37EC8nlG7q9hD0lE2gH svg6PST5+wlrSvmR+iLK9w7PobMi8TOS3bbDF6jxa8fBNQ1u5gNhU+1gJsi7SIO4I5whQ5UBWPX Dn3nMFimbzg6k9LaS4re+7V16KfvfmJ5zQ8YjJZUxyvpr+3C9jR2I2fXPeDj+1JMYDGVrOzRfhR Yp9Ia3gZAwlJLkA== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250359 Improve docstrings by detailing the parameters and return values of functions in this module. Signed-off-by: Antonin Godard --- meta/lib/oe/lsb.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py index 1283cefaaf..8f43301484 100644 --- a/meta/lib/oe/lsb.py +++ b/meta/lib/oe/lsb.py @@ -7,7 +7,13 @@ import os def get_os_release(): - """Get all key-value pairs from /etc/os-release as a dict""" + """ + Get all key-value pairs from the :term:`Build Host`'s ``/etc/os-release`` + as a dictionary. + + Return a Python dictionary mapping keys from ``/etc/os-release`` to their + values. + """ data = {} if os.path.exists('/etc/os-release'): @@ -21,8 +27,14 @@ def get_os_release(): return data def distro_identifier(d=None): - """Return a distro identifier string based upon /etc/os-release - with optional adjustment via a hook""" + """ + Return a distro identifier string based upon the :term:`Build Host`'s /etc/os-release + with optional adjustment via a hook defined by ``LSB_DISTRO_ADJUST``. + See the value of :term:`SANITY_TESTED_DISTROS` for a list of valid distro identifiers. + + Can optionally take ``d`` (the :term:`datastore`) to read the value of + ``LSB_DISTRO_ADJUST``. + """ import re From patchwork Mon Nov 16 16:09:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104402 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30997.1794845359175366255 for ; Mon, 16 Nov 2026 08:09:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=vOdDwV+s; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 883311A169F for ; Mon, 16 Nov 2026 16:09:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5C0D46023F for ; Mon, 16 Nov 2026 16:09:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 65B7E11BC183B; Mon, 16 Nov 2026 17:09:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845356; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jsA2sGlT1Y5arjPXNvX/ATEa0+ks+/GOb75cYJZlWfI=; b=vOdDwV+st07x09iOrrzGl7VlMaHVei6rPlwW9rGKEH2ORj/P0n1sOA8Vb0xuVJw/Q9yuIz Hoj8OT/csfQ7Gh5N+Qt02djZuizWHxbrIHFvW3Qa/3L225yoewpgylHtPkaCAwIsW33mdU C7EsT5T8yXwvCc0fWisWQptkN6eBpoFNYmuE7DNvq6GL6FiwBNq5hmDnN5YlPkJ9IegEs+ 5VDJcSnnKEwVTKdW/zxhqh3kgmZHbJIvSHtmOHP3L8N6W9tXbRyNeAitfI6PvrUTPDecEA MBGThlTxPvoTmttz7GRcdrEDvZNncyn0yA7UPs/Yi06bNrCCoQrP0gDMBJu4FA== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:08 +0100 Subject: [PATCH 10/13] lib/oe/path: improve docstrings MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-10-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=10208; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=OnkJrvIfB1HI3QOthLDmNOZbc+smthWPpwTdOfVo+KI=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqf4Y7niR3lh52I9w8lrTiR5ZQ+UltCpuSD/ X0wpe684NiJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnwAKCRDRgEFAKaOo NiMnD/4nXKaPX6xkrTYsg/BnqN/2Ps9UjoTaogq6zyfExOdtJgym0S/ndkt9qRphBcR09mNvbcy HPuZ38pc7xwUzDwH+8irsowbL01FLyrPj6dAw6twTWId9E6wxKMGRR3D9seZqtH+wnoJaiUoRbk QXpdRCiLSvXMVVtHf+f5/opjpNcOjx2LU5hUytXbTgwR09MrBK8eUCD64c8aS16++r0sAVmdc15 oWk3J1dmGp9Im1/8EfkSx8c10485fA1LSEV21i2/yiugD0eB0CH/PbboPXI2YXUNhAsbDf3TCtU KsUEJ6ujapTlGfG0lmv+Rvbq8wYfA+DeggwGPRTAKRoQBr0e62lOFmvlZc21sG2E89Ltk+60WeL IF7pBUx/lWDiUNvEv/9XUkJhVOfsscEWk2XHSHuxFle2syQvsg9sHQ2CxevWLkgJPgXDXVstGvc CP3nKknjw9GVwwSdefAFqkCVDVpgPPBVh5NNrZDIzjenw4lpUb0ulIhBFizySGXDkC30aj8iYaC /i32BvsOkrc0Qe5Qw/dZYjvlvEbSK+5c+K6eeoJPaagz6fvMyouOUA56ood4vy+mwkrtRGk717W Dcb6X6BN96/bczJrAm4hRMfaLPmQ9/pbP6am+fy42Q6dAjhOONu1bikuhO/4t7GqMFT8O/BZlXi ZpAH2vhl0lKLPAQ== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250360 Improve docstrings by detailing the parameters and return values of functions in this module. Give examples when possible to make the understanding easier. Signed-off-by: Antonin Godard --- meta/lib/oe/path.py | 148 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 112 insertions(+), 36 deletions(-) diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 366ab9720a..5122fcb08e 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -14,26 +14,54 @@ import os.path import bb.parse def join(*paths): - """Like os.path.join but doesn't treat absolute RHS specially""" + """ + Like :py:func:`os.path.join` but do not treat absolute RHS specially. + Use :py:func:`os.path.normpath` after joining paths with slashes (``/``). + + Take ``*paths`` which represent the paths to join and return the joined + paths as a string. + """ return os.path.normpath("/".join(paths)) def relative(src, dest): - """ Return a relative path from src to dest. + """ + Return a relative path from ``src`` to ``dest``. + + Examples: + + .. code-block:: python - >>> relative("/usr/bin", "/tmp/foo/bar") - ../../tmp/foo/bar + >>> oe.path.relative("/usr/bin", "/tmp/foo/bar") + ../../tmp/foo/bar - >>> relative("/usr/bin", "/usr/lib") - ../lib + .. code-block:: python - >>> relative("/tmp", "/tmp/foo/bar") - foo/bar + >>> oe.path.relative("/usr/bin", "/usr/lib") + ../lib + + .. code-block:: python + + >>> oe.path.relative("/tmp", "/tmp/foo/bar") + foo/bar """ return os.path.relpath(dest, src) def make_relative_symlink(path): - """ Convert an absolute symlink to a relative one """ + """ + Convert an absolute symbolic link ``path`` and convert it to a relative one. + + No return value. + + For example, if ``/path/to/dir/link`` points to ``/path/to/other/target``, + then: + + .. code-block:: python + + >>> oe.path.make_relative_symlink("/path/to/dir/link") + + Converts the symlink to ``../other/file``. + """ if not os.path.islink(path): return link = os.readlink(path) @@ -61,10 +89,12 @@ def make_relative_symlink(path): def replace_absolute_symlinks(basedir): """ - Walk basedir looking for absolute symlinks and replacing them with relative ones. - The absolute links are assumed to be relative to basedir - (compared to make_relative_symlink above which tries to compute common ancestors - using pattern matching instead) + Walk ``basedir`` looking for absolute symlinks and replacing them with relative ones. + The absolute links are assumed to be relative to ``basedir``. + (compared to :py:func:`oe.path.make_relative_symlink` which tries to compute + common ancestors using pattern matching instead). + + No return value. """ for walkroot, dirs, files in os.walk(basedir): for file in files + dirs: @@ -82,7 +112,13 @@ def replace_absolute_symlinks(basedir): @bb.parse.vardepsexclude("TOPDIR") def format_display(path, d): - """ Prepare a path for display to the user. """ + """ + Prepare ``path`` for display to the user: the path is converted to be + relative to :term:`TOPDIR`, which is obtained thanks to ``d`` (the + :term:`datastore`). + + Return the formatted path as a string. + """ rel = relative(d.getVar("TOPDIR"), path) if len(rel) > len(path): return path @@ -100,7 +136,13 @@ def copytree(src, dst): subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) def copyhardlinktree(src, dst): - """Make a tree of hard links when possible, otherwise copy.""" + """ + Replicate the ``src`` directory into ``dst`` and replace files with + hardlinks when possible, otherwise copy them (some filesystems do not + support hardlinks). + + No return value. + """ bb.utils.mkdirhier(dst) if os.path.isdir(src) and not len(os.listdir(src)): return @@ -141,7 +183,12 @@ def copyhardlinktree(src, dst): copytree(src, dst) def copyhardlink(src, dst): - """Make a hard link when possible, otherwise copy.""" + """ + Make a hard link of ``src`` into ``dst`` when possible, otherwise copy + (some filesystems do not support hardlinks). + + No return value. + """ try: os.link(src, dst) @@ -150,12 +197,15 @@ def copyhardlink(src, dst): def remove(path, recurse=True): """ - Equivalent to rm -f or rm -rf + Equivalent to ``rm -f`` or ``rm -rf`` (when ``recurse`` is ``True``). + NOTE: be careful about passing paths that may contain filenames with wildcards in them (as opposed to passing an actual wildcarded path) - - since we use glob.glob() to expand the path. Filenames containing + since we use :py:func:`glob.glob` to expand the path. Filenames containing square brackets are particularly problematic since the they may not actually expand to match the original filename. + + No return value. """ for name in glob.glob(path): try: @@ -167,7 +217,12 @@ def remove(path, recurse=True): raise def symlink(source, destination, force=False): - """Create a symbolic link""" + """ + Create a symbolic link ``destination`` pointing to ``source``. + Optionally force it with ``force=True``. + + No return value. + """ try: if force: # Remove the exact destination path. Do not route this through @@ -191,8 +246,12 @@ def relsymlink(target, name, force=False): symlink(os.path.relpath(target, os.path.dirname(name)), name, force=force) def find(dir, **walkoptions): - """ Given a directory, recurses into that directory, - returning all files as absolute paths. """ + """ + Given a directory ``dir``, recurse into that directory, + ``yield``'ing all files as absolute paths. + + No return value. + """ for root, dirs, files in os.walk(dir, **walkoptions): for file in files: @@ -251,12 +310,15 @@ def __realpath(file, root, loop_cnt, assume_dir): return (file, is_dir) def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False): - """ Returns the canonical path of 'file' with assuming a - toplevel 'root' directory. When 'use_physdir' is set, all - preceding path components of 'file' will be resolved first; + """ + Return the canonical path of ``file`` with assuming a + toplevel ``root`` directory. When ``use_physdir`` is set, all + preceding path components of ``file`` will be resolved first; this flag should be set unless it is guaranteed that there is - no symlink in the path. When 'assume_dir' is not set, missing - path components will raise an ENOENT error""" + no symlink in the path. When ``assume_dir`` is not set, missing + path components will raise an ``ENOENT`` error. Limit the recursion to + ``loop_cnt`` when recursively resolving paths. + """ root = os.path.normpath(root) file = os.path.normpath(file) @@ -288,10 +350,11 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False) def is_path_parent(possible_parent, *paths): """ - Return True if a path is the parent of another, False otherwise. + Return ``True`` if one or more paths (passed with ``*paths``) have + ``possible_parent`` as their parent, ``False`` otherwise. Multiple paths to test can be specified in which case all specified test paths must be under the parent in order to - return True. + return ``True``. """ def abs_path_trailing(pth): pth_abs = os.path.abspath(pth) @@ -309,12 +372,23 @@ def is_path_parent(possible_parent, *paths): return True def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=False): - """Search a search path for pathname, supporting wildcards. + """ + Search a search ``path`` for ``pathname``, supporting wildcards. - Return all paths in the specific search path matching the wildcard pattern - in pathname, returning only the first encountered for each file. If - candidates is True, information on all potential candidate paths are - included. + ``path`` should be a colon-separated list of paths. If not passed, the + ``PATH`` environment is used. + + Return all paths as a list in the specific search path matching the wildcard pattern + in ``pathname``, returning only the first encountered for each file. + + If ``candidates`` is True, information on all potential candidate paths are + included as two-element tuples: first element is the matched candidates, + second element is the list of other matches. + + ``mode`` is passed to :py:func:`os.access` to control what the matched + files should have as attributes (executable, readable, etc.). + + When ``reverse`` is ``True``, reverse the search path before iterating. """ paths = (path or os.environ.get('PATH', os.defpath)).split(':') if reverse: @@ -342,9 +416,11 @@ def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=F return files def canonicalize(paths, sep=','): - """Given a string with paths (separated by commas by default), expand - each path using os.path.realpath() and return the resulting paths as a - string (separated using the same separator a the original string). + """ + Given a string with paths ``paths`` (separated by commas by default, but + controllable by ``sep``), expand each path using :py:func:`os.path.realpath` + and return the resulting paths as a string (separated using the same + separated as the original string). """ # Ignore paths containing "$" as they are assumed to be unexpanded bitbake # variables. Normally they would be ignored, e.g., when passing the paths From patchwork Mon Nov 16 16:09:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104392 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30999.1794845360012783304 for ; Mon, 16 Nov 2026 08:09:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=IUyjNque; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 69BED1A169C for ; Mon, 16 Nov 2026 16:09:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 40BEC6023F for ; Mon, 16 Nov 2026 16:09:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2309E11BC1D59; Mon, 16 Nov 2026 17:09:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845357; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=kL4XUrFpaWAuCFa90k7rXqJvO0Nl9ZUsmiJUgKsYuQg=; b=IUyjNqueytHnN2W3ExAw1L8oca9c6Snfsii7AiOt6jwICHABwQC2XOpznqC4Vn9HevAOyp BFt3x5A8fXyE2SGKbJZ/FYaT+VxpajuWzT7tZqUBpvSjWq6E3bEfNrWWhjafF5GWnYqF5Z qT56+tMYkb6H0Y/3wXWdkmlFz4wYcAanpkqINWzqeBqKg3sp0FJsyILIRRZzMUpysChgmR yyRdFRj5jiB+Jd+kbD9QyMZGzGZ4ZknTReBwHtu2mSwPp3tV+aS/rOFtVKQ284c2PCj1sh 9xAv8cRxZEW9At2g5JLRoUxBkRZGW1iHyL/dPUBy7/UNYcz9i2GrqHWTaPYbLw== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:09 +0100 Subject: [PATCH 11/13] lib/oe/purl: improve docstrings MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-11-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1169; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=g55l8H44eXAQHJ9PIcT+oB//nMHnSnuSmj7UrSh79AQ=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqfPe8mDhoJCwRmG8Q/IzlUpz5+ZSy4dxM2s 67/jfXs2LSJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqnwAKCRDRgEFAKaOo NqwGD/4y0jjdfYl9y0N4VW0XeXethwlq3jNcoektr1hhbKJ0GZnYhMto7rMPyvjqGdH5gAmyekW n5q2V0oXN3kmoVDMok6YorGzv/KfipNMnWP+FqMo0J76dvpJ1SCIE4P9ST2VHRsHkgZBr1tG16L BzEbviid9vi6/Kv/oke+o46egLidT9nv0Nq+VOw/9j9zKsvmuBpO533V2UBvoVwD67ZNgnd0j2B vMttYPQCfc72j+nYUn9PwvKyhm0T1tfuCqn6SgXGon8WEyfj6u6xEfB5cv/3eg6oFoNHxSyw2Qm Hq+jzf4lh0eZV0wtTI50LqIEv/TgSft+mRnzcdHqNWXjSfo8V19+nVEDjQm8bZ1GuosN7bFMFf5 /5G9JTnLu/jvWwVUy05EU/HUbd+8BTBOS5UxNiEAEtneMbV9ZKpYrqzkQnDreWoAt5v/Gn55Dyh Meop/d7gvdflU1AdgtgfHv82s/D6XasIliQJKWIrMQ+VuhSaGvIU/YF+/o1mpEghwHl8HksCFTL x1X/A8K2pDjBjgcabO56t+n0wy6P67LkPtnbwXfIi1w4q5/l6SDjL+DWKQIDLMFEnUkCd2BL3hR Vh0PWDUYAXRfLg226KYg7xQ6cHGf3ycQNkGcsMtP+OCtnlZCTtjfV3DRa9fBrrBGdpQeTMKrG6c tlDoE5MbjlqNyfg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250361 Improve docstrings by detailing the parameters and return values of functions in this module. Signed-off-by: Antonin Godard --- meta/lib/oe/purl.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meta/lib/oe/purl.py b/meta/lib/oe/purl.py index 2f92a23596..ed158d7f81 100644 --- a/meta/lib/oe/purl.py +++ b/meta/lib/oe/purl.py @@ -11,16 +11,17 @@ PREFIX = "pkg:yocto" def quote(s): """ - Returns the percent encoded version of the string, suitable for including - in a PURL field + Return the percent encoded version of the string ``s``, suitable for inclusion + in a PURL field. """ return urllib.parse.quote(s, safe="") def get_base_purl(d): """ - Returns the base PURL for the current recipe (that is, the PURL without any - additional qualifiers) + Return the base PURL for the current recipe (that is, the PURL without any + additional qualifiers), using ``d`` (the :term:`datastore`) to access the recipe's + variables. """ layername = d.getVar("FILE_LAYERNAME") bpn = d.getVar("BPN") From patchwork Mon Nov 16 16:09:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104400 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.31641.1794845360735889736 for ; Mon, 16 Nov 2026 08:09:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=ukGFRoGO; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 148DB1A169D for ; Mon, 16 Nov 2026 16:09:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D33B46023F for ; Mon, 16 Nov 2026 16:09:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 17FBB11BC118D; Mon, 16 Nov 2026 17:09:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845358; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=8qEAWc2cWQzSh223RxAqSrZFaQW5qUKJl3lWFC82Bxs=; b=ukGFRoGO4vbvbD9tTi+Iwq/92rRS9zeclbJ+KE7NlZ/Zst0OaGqPSxUx22nFTVjYsniqEx Xy5bGn2LEA8Wjvczaas8q4HcFaKm5g8PY91xqWvOP7KMuHgM7YiamqIueXRNxnPmyyRw8R oWo3vaELNwhqJQoNPSAS7gxsojdbCUPhTM54+fuFX1XLuuNxBfj3ZVguVjNWO/3xPZ/Sd9 LvuReuZqlDAMnNdvObTaDgLVAENZRQTGCAwOnUtV2C+E73sMlVUrTKhB0B6OyFXHqhYSbK TIRVtBhKWYieInWfljFm/KDeaZTNOv23cQ0tI/oQTgh9lby23UBNUGxLDIQMgw== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:10 +0100 Subject: [PATCH 12/13] lib/oe/utils: improve docstrings MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-12-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=16208; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=RraaA46hyYsoYJKNW3lBdXrM1Q4O1h9BUXHyYDZQ8yA=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqgEJ61S+rF3Wf+ZyFYvmaPZA8eFCQ9AuPIL JfhIhJ+SY+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqoAAKCRDRgEFAKaOo NugBD/941/NXwk2a3tlQ+1FM19gLA6zlAdgu/kH01B9Mz/XFtheidkueDA6sdmHZCxLshUnep7c R275QCgvS5x9XdJ8H9ogPR+Ai8BDxFnIJPYuB6csCEKPgug1Wb5UUXoSQNGQKBWrPVO1bE8C84Y C+mFgBrErQt7Bxc3quho8/YacDtBMegzkZVbKU3sMfO0cUVyLO7BHXFoMFiPgRBUeTOqoSVhwZ1 7s1hCmM/jLYTfaN1ZEYexmK1X09rrTySE1LkrdWz2mii4S5mOR/fsQ/KpfQSPxWr0spHNkBHhXO wNTJgd6ou5oid0nLJoeZQPVXSdSQKNWRm61VX+ohgxn3AWcmCblqTfcTm9ZqhAt/M49bRn1nS4H oixNgsk3e0tcVFxH92WlXd3xfCeP1Fm/wu+kc2Imo7HjRQ/fqcMJCUxq/IK0Ywv4DkXXu18/+xT rPyx3rYNElaz1B/b4541IdzShZ+kWrQMbgr7lKNU/zSd4/LJNukuWTLfmqwMZZOQl1iNOB8JtTZ RH71liyCfqUp711wQcwWaf4rcwZgPkk+XDAorq2o/OK08FnohWAh2kB1OPvMmYU0pSbdPmRTMkg lyPRT5gPC9IF+hMhRgetdKnkEw3T/cRt5rf+cYZTZ95wWPwYGMwkIFHylcne0MKKBi0H/yR21Qy TV9QP8JamOo0eRQ== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250362 Improve docstrings by detailing the parameters and return values of functions in this module, or adding the docstring entirely when it wasn't present and it made sense to document this function. Signed-off-by: Antonin Godard --- meta/lib/oe/utils.py | 235 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 190 insertions(+), 45 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index a17938803e..caa4dd4301 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -13,6 +13,11 @@ import bb.parse from bb import multiprocessing def read_file(filename): + """ + Read a file under the path ``filename`` and return the content of the + file. In case of :py:class:`IOError`, return an empty string. In case + of other exceptions, return ``None``. + """ try: f = open( filename, "r" ) except IOError as reason: @@ -24,18 +29,32 @@ def read_file(filename): return None def ifelse(condition, iftrue = True, iffalse = False): + """ + If ``condition`` is ``True``, return the value of ``iftrue``, else + return the value of ``iffalse``. + """ if condition: return iftrue else: return iffalse def conditional(variable, checkvalue, truevalue, falsevalue, d): + """ + If the value of ``variable`` (obtained using ``d``, the :term:`datastore`) + equals the value of ``checkvalue``, return the value of ``truevalue``, else + return the value of ``falsevalue``. + """ if d.getVar(variable) == checkvalue: return truevalue else: return falsevalue def vartrue(var, iftrue, iffalse, d): + """ + Check if the value of ``var`` (obtained using ``d``, the :term:`datastore`) + passed to :py:func:`oe.types.boolean` returns ``True`` and return the value + of ``iftrue`` if it does, otherwise return the value of ``iffalse``. + """ import oe.types if oe.types.boolean(d.getVar(var)): return iftrue @@ -43,12 +62,25 @@ def vartrue(var, iftrue, iffalse, d): return iffalse def less_or_equal(variable, checkvalue, truevalue, falsevalue, d): + """ + Check if the value of ``variable`` (obtained using ``d``, the + :term:`datastore`) is inferior or equal to ``checkvalue``, and return the + value of ``truevalue`` if it is, otherwise return the value of + ``falsevalue``. Both ``checkvalue`` and the value of ``variable`` are + converted to :py:type:`float` numbers before comparison. + """ if float(d.getVar(variable)) <= float(checkvalue): return truevalue else: return falsevalue def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): + """ + Check if the value of ``variable`` (obtained using ``d``, the + :term:`datastore`) is inferior or equal to ``checkvalue`` using + :py:func:`oe.utils.vercmp_string`, and return the value of + ``truevalue`` if it is, otherwise return the value of ``falsevalue``. + """ result = bb.utils.vercmp_string(d.getVar(variable), checkvalue) if result <= 0: return truevalue @@ -56,6 +88,13 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): return falsevalue def both_contain(variable1, variable2, checkvalue, d): + """ + Check whether the value of the variables ``variable1`` and ``variable2`` + (obtained using ``d``, the :term:`datastore`) both contain all the values in + ``checkvalue``. ``variable1``, ``variable2`` and ``checkvalue`` are + treated as space-separated lists (``checkvalue`` can be a space-separated + string, or directly a Python list). + """ val1 = d.getVar(variable1) val2 = d.getVar(variable2) val1 = set(val1.split()) @@ -71,14 +110,21 @@ def both_contain(variable1, variable2, checkvalue, d): def set_intersect(variable1, variable2, d): """ - Expand both variables, interpret them as lists of strings, and return the - intersection as a flattened string. + Take the values of ``variable1`` and ``variable2`` (obtained using ``d``, + the :term:`datastore`), convert them from space-separated lists to Python + sets, and return the intersection as a space-separated list. + + For example:: + + FOO = "a b c" + BAR = "b c d" + + Then: - For example: - s1 = "a b c" - s2 = "b c d" - s3 = set_intersect(s1, s2) - => s3 = "b c" + .. code-block:: python + + >>> oe.utils.set_intersect("FOO", "BAR", d) + "b c" """ val1 = set(d.getVar(variable1).split()) val2 = set(d.getVar(variable2).split()) @@ -86,21 +132,37 @@ def set_intersect(variable1, variable2, d): def set_difference(variable1, variable2, d): """ - Expand both variables, interpret them as lists of strings, and return the - difference as a flattened string. + Take the values of ``variable1`` and ``variable2`` (obtained using ``d``, + the :term:`datastore`), convert them from space-separated lists to Python + sets, and return a space-separated list of the elements in ``variable1`` + that are not in ``variable2``. + + For example:: + + FOO = "a b c" + BAR = "b c d" + + Then: + + .. code-block:: python + + >>> oe.utils.set_difference("FOO", "BAR", d) + "a" + + If "*" is present in the value of ``variable2`` (not part of a larger + identifier), this is interpreted as "remove all entries": + + For example:: + + FOO = "a b c" + BAR = "*" - For example: - s1 = "a b c" - s2 = "b c d" - s3 = set_difference(s1, s2) - => s3 = "a" + Then: - If '*' is present as a separate token (not part of a larger identifier) in - the second operand, this is interpreted as "remove all entries": - s1 = "a b c" - s2 = "*" - s3 = set_difference(s1, s2) - => s3 = "" + .. code-block:: python + + >>> oe.utils.set_difference("FOO", "BAR", d) + "" """ val1 = d.getVar(variable1) if not val1: @@ -120,8 +182,12 @@ def set_difference(variable1, variable2, d): return " ".join(sorted(val1 - val2)) def prune_suffix(var, suffixes, d): - # See if var ends with any of the suffixes listed and - # remove it if found + """ + See if the variable ``var`` ends with any of the suffixes listed and + remove it if found. + + Also remove the :term:`MLPREFIX` prefix if present in ``var``. + """ for suffix in suffixes: if suffix and var.endswith(suffix): var = var[:-len(suffix)] @@ -133,19 +199,41 @@ def prune_suffix(var, suffixes, d): return var def str_filter(f, str): + """ + Take ``str``, as a space-separated list of values, and return a + space-separated list of all the values matching the regular expression ``f`` + using :py:func:`re.match`. + """ from re import match return " ".join([x for x in str.split() if match(f, x, 0)]) def str_filter_out(f, str): + """ + Take ``str``, as a space-separated list of values, and return a + space-separated list of all the values *not* matching the regular expression ``f`` + using :py:func:`re.match`. + """ from re import match return " ".join([x for x in str.split() if not match(f, x, 0)]) def build_depends_string(depends, task): - """Append a taskname to a string of dependencies as used by the [depends] flag""" + """ + Append a taskname ``task`` to a space-separated list of dependencies stored in + ``depends`` as used by the ``[depends]`` variable flag: + + .. code-block:: python + + >>> oe.utils.build_depends_string("dep1 dep2 dep3", "task") + "dep1:task dep2:task dep3:task" + """ return " ".join(dep + ":" + task for dep in depends.split()) def inherits(d, *classes): - """Return True if the metadata inherits any of the specified classes""" + """ + Return ``True`` if the metadata (obtained from ``d``, the + :term:`datastore`) inherits *any* of the specified classes in + ``*classes`` (internally uses :py:func:`bb.data.inherits_class`). + """ return any(bb.data.inherits_class(cls, d) for cls in classes) def filter_default_features(varname, d): @@ -174,10 +262,12 @@ def set_class_filter(var, features_var, filter_var, d): def parallel_make_value(pm): """ Return the integer value for the number of parallel threads to use when - building, scraped out of given string. If no parallelization option is - found, returns empty string + building, scraped out of given string ``pm``. If no parallelization option is + found, return an empty string. + + For example if ``pm`` is "-j 10", this will return 10 as an integer. - e.g. if string is "-j 10", this will return 10 as an integer. + This function is used by :py:func:`oe.utils.parallel_make`. """ # look for '-j' and throw other options (e.g. '-l') away while pm: @@ -196,10 +286,13 @@ def parallel_make_value(pm): def parallel_make(d, makeinst=False): """ Return the integer value for the number of parallel threads to use when - building, scraped out of PARALLEL_MAKE. If no parallelization option is - found, returns empty string + building, scraped out of :term:`PARALLEL_MAKE`. If no parallelization option is + found, return an empty string. - e.g. if PARALLEL_MAKE = "-j 10", this will return 10 as an integer. + For example if ``PARALLEL_MAKE = "-j 10"``, this will return 10 as an integer. + + The ``makeinst`` boolean can be set to ``True`` if the value should be + obtained from :term:`PARALLEL_MAKEINST` instead. """ if makeinst: pm = (d.getVar('PARALLEL_MAKEINST') or '').split() @@ -210,15 +303,19 @@ def parallel_make(d, makeinst=False): def parallel_make_argument(d, fmt, limit=None, makeinst=False): """ Helper utility to construct a parallel make argument from the number of - parallel threads specified in PARALLEL_MAKE. + parallel threads specified in :term:`PARALLEL_MAKE`. - Returns the input format string `fmt` where a single '%d' will be expanded - with the number of parallel threads to use. If `limit` is specified, the + Return the input format string ``fmt`` where a single ``%d`` will be expanded + with the number of parallel threads to use. If ``limit`` is specified, the number of parallel threads will be no larger than it. If no parallelization - option is found in PARALLEL_MAKE, returns an empty string + option is found in :term:`PARALLEL_MAKE`, return an empty string. + + For example if ``PARALLEL_MAKE = "-j 10"`` then: - e.g. if PARALLEL_MAKE = "-j 10", parallel_make_argument(d, "-n %d") will return - "-n 10" + .. code-block:: python + + >>> parallel_make_argument(d, "-n %d") + "-n 10" """ v = parallel_make(d, makeinst) if v: @@ -229,8 +326,9 @@ def parallel_make_argument(d, fmt, limit=None, makeinst=False): def packages_filter_out_system(d): """ - Return a list of packages from PACKAGES with the "system" packages such as - PN-dbg PN-doc PN-locale-eb-gb removed. + Return a list of packages from :term:`PACKAGES` (obtained using ``d``, the + :term:`datastore`) with the "system" packages such as ``${PN}-dbg``, ``${PN}-doc``, + or ``${PN}-locale-en-gb`` removed. """ pn = d.getVar('PN') pkgfilter = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev', '-src', '-lic')] @@ -248,8 +346,13 @@ def getstatusoutput(cmd): def trim_version(version, num_parts=2): """ - Return just the first of , split by periods. For - example, trim_version("1.2.3", 2) will return "1.2". + Return just the first ``num_parts`` parts of ``version``, split by periods + (``.``). For example: + + .. code-block:: python + + >>> oe.utils.trim_version("1.2.3", 2) + "1.2" """ if type(version) is not str: raise TypeError("Version should be a string") @@ -276,6 +379,11 @@ def execute_pre_post_process(d, cmds): @bb.parse.vardepsexclude("BB_NUMBER_THREADS") def get_bb_number_threads(d): + """ + Return the value of :term:`BB_NUMBER_THREADS` (using ``d``, the + :term:`datastore`). If undefined, return the value of + :py:func:`os.cpu_count` or 1 if the former returns ``None``. + """ return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1) def multiprocess_launch(target, items, d, extraargs=None): @@ -362,6 +470,10 @@ def multiprocess_launch_mp(target, items, max_process, extraargs=None): return results def squashspaces(string): + """ + Return the input ``string`` with every occurrence of two or more whitespace + replaced by only one whitespace. + """ import re return re.sub(r"\s+", " ", string).strip() @@ -466,13 +578,16 @@ def get_multilib_datastore(variant, d): return localdata def sh_quote(string): + """ + Return a shell-escaped version of ``string`` using :py:func:`shlex.quote`. + """ import shlex return shlex.quote(string) def directory_size(root, blocksize=4096): """ - Calculate the size of the directory, taking into account hard links, - rounding up every size to multiples of the blocksize. + Calculate and return the size of the directory ``root``, taking into account + hard links, rounding up every size to multiples of ``blocksize``. """ def roundup(size): """ @@ -500,8 +615,14 @@ def directory_size(root, blocksize=4096): total += roundup(getsize(root)) return total -# Update the mtime of a file, skip if permission/read-only issues + def touch(filename): + """ + Update the ``mtime`` of a file under the path ``filename``, + skip if permission/read-only issues. + + No return value. + """ try: os.utime(filename, None) except PermissionError: @@ -572,12 +693,21 @@ def base_set_filespath(path, d): return ":".join(filespath) def check_app_exists(app, d): + """ + Using :py:func:`bb.utils.which`, check if the program used by the command + stored in ``app`` exists. + """ app = d.expand(app).split()[0].strip() path = d.getVar('PATH') return bool(bb.utils.which(path, app)) def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '): - """Return a string of all ${var} in all multilib tune configuration""" + """ + Return a space-separated list of ``var`` in all multilib tune configurations. + ``unique`` removes repetitions in the string. ``need_split`` should be set + if the input ``var`` is a ``delim``-separated list that should be split + (otherwise an iterable object can be passed with ``need_split=False``). + """ values = [] variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] for item in variants: @@ -602,7 +732,22 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' return " ".join(ret) def extend_variants(d, var, extend, delim=':'): - """Return a string of all bb class extend variants for the given extend""" + """ + Return a space-separated string of all BitBake class extend variants + for the given ``extend``, extracted from the ``delim``-separated entries of + the value of ``var`` (obtained using ``d``, the :term:`datastore`). + + For example, consider the following assignment:: + + MULTILIBS = "multilib:lib32 multilib:lib64" + + Then: + + .. code-block:: python + + >>> oe.utils.extend_variants(d, "MULTILIBS", "multilib") + "lib32 lib64" + """ variants = [] whole = d.getVar(var) or "" for ext in whole.split(): From patchwork Mon Nov 16 16:09:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 104404 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.31000.1794845361462592564 for ; Mon, 16 Nov 2026 08:09:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=Q0QavLs1; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id CE64B1A169E for ; Mon, 16 Nov 2026 16:09:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9C92C6023F for ; Mon, 16 Nov 2026 16:09:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B39E111BC1D5B; Mon, 16 Nov 2026 17:09:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1794845359; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=K9vqxC7/GR8rrcO0d73uqh9wtkq3wV5GlDaFBnc9bQo=; b=Q0QavLs1HjvxtbimdMjxQpaCz6v5mum/GT0sOezyMRFfUYimrTTwgGvdQaodWIPTeHDUbG C0tiGusbXzNDerJlLFvLFkSV2xL+Mz/ysPxGqnWaMnSlTWVHP5A6I0GNKngSqoTnghaWSH gnDXr475MHsD1sxX2KH9Tum09WrmMqv9AfgA8MjJ+uO4t3TFno52PsUgjX6/0vYE/JkQJS UWeE2lZ8B+rRjT1jsRdbc/e2xyf7QAX/Tpaar6YtkEw7Lrz+bwUNVywLnffW84t7yahivp S/29UJjv3aQxs71Uv65iDtiH2YvneBT5pVPVSFk45ifQbeZN6X4spDuIZgYi5w== From: Antonin Godard Date: Mon, 16 Nov 2026 17:09:11 +0100 Subject: [PATCH 13/13] lib/oe/types: improve docstrings MIME-Version: 1.0 Message-Id: <20261116-oe-lib-docstrings-v1-13-0c894f6a1064@bootlin.com> References: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> In-Reply-To: <20261116-oe-lib-docstrings-v1-0-0c894f6a1064@bootlin.com> To: openembedded-core@lists.openembedded.org Cc: Antonin Godard , Thomas Petazzoni X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6165; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=EquptDBtbWWTWm35qxhC54W6EXdjj3ku2SES4CUs9Ac=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBq+yqgZeVbc1S+wH07kHMrAxpSfkX4GVa0QT1bz egYyJhJDbGJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCavsqoAAKCRDRgEFAKaOo NuClEACwkvD4apW6y2m9QqlfVtsVG5+jmnFNwlwKwYLdFzY3Svoka0MnTJcX6Gwn64DivPAQAOs /fcyS6qvJHO7vehL1fWId3+IiDMldPWrwQ2Yl0BpOcAIwXyU6Tc5qx6SgRPDnZ5xT3ZPWy2UABm YjT4WG2vXj0AUdJaG9L9kamY47ymYpSRFoUqqKyA3LatLdDk2J0sXGzO6z5cs8fP1pxu7q1UWwC 3zoOAftwBG6iLHfRqd1tx4sDGhllHAFzUGfRq2oqBIvT12c5TyeDlSWQU7PbIvPMJIVbciQtV3s 6Avy/KnovsFq8445iZh3nxNY3K10HO9yqK74T2DRAdLr0n9V0Dc16JK1NAzqasAHCRzt+DcA+77 +MwYjgV45HD86s4K5AyXtiB65PjP0bppShAQZjutyR2/38HKhuWGkh6gSlFXxwdKJkiCD+nsqDp fcWTY/NHE37vZ8z1BO2Mo/fMAYkjoeSxHEfZmO/ZYl2s/1h5NOFwpbMOGAhiskX4hg1cNQHbEhl QdckJbkDMYawhz1vqj/EHqLdojL2k90+1EwLNyLZnfxt9XlU1BdbghBxa/QfMr4R2iQXDe5rdYS +UYNyo8egds0ZvaOJqos5r7kzz0mOcJUsn+CyspXtSFH9WQT4+TUHsNo3AdA6ezWNgd1Qfs4ThN qThb7fBDhiJLJlA== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 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 ; Mon, 16 Nov 2026 16:09:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250363 Improve docstrings by detailing the parameters and return values of OpenEmbedded types. Give usage examples for each of the type. Signed-off-by: Antonin Godard --- meta/lib/oe/types.py | 143 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 127 insertions(+), 16 deletions(-) diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py index c4b338921b..7fe9e9d8a4 100644 --- a/meta/lib/oe/types.py +++ b/meta/lib/oe/types.py @@ -75,14 +75,34 @@ class NoMatch(object): NoMatch = NoMatch() def regex(value, regexflags=None): - """OpenEmbedded 'regex' type + """ + OpenEmbedded 'regex' type. Acts as a regular expression, returning the pre-compiled regular - expression pattern object. To use this type, set the variable type flag - to 'regex', and optionally, set the 'regexflags' type to a space separated - list of the flags to control the regular expression matching (e.g. - FOO[regexflags] += 'ignorecase'). See the python documentation on the - 're' module for a list of valid flags.""" + expression pattern object from the string ``value``. + + To use this type, set a BitBake variable ``type`` flag + to ``regex``, and optionally, set the ``regexflags`` flag to a space-separated + list of the flags to control the regular expression matching. + + The variable can then be used with :py:func:`oe.data.typed_value`. + + For example:: + + FOO = "^foo[0-9]+$" + FOO[type] = "regex" + FOO[regexflags] += "ignorecase" + + Then: + + .. code-block:: python + + if re.match(oe.data.typed_value("FOO", d), somevalue): + ... + + See the Python documentation on the :py:mod:`re` module for a list of + valid flags. + """ flagval = 0 if regexflags: @@ -106,10 +126,29 @@ def regex(value, regexflags=None): (value, exc.args[0])) def boolean(value): - """OpenEmbedded 'boolean' type + """ + OpenEmbedded 'boolean' type. + + To use this type, set a BitBake variable ``type`` flag + to ``boolean``, and its value depending on the expected behavior: - Valid values for true: 'yes', 'y', 'true', 't', '1' - Valid values for false: 'no', 'n', 'false', 'f', '0', None + - To return ``True``: ``yes``, ``y``, ``true``, ``t`` or ``1``. + - To return ``False``: ``no``, ``n``, ``false``, ``f``, ``0`` or ``None``. + + The variable can then be used with :py:func:`oe.data.typed_value`. + + For example:: + + FOO = "yes" + FOO[type] = "boolean" + + Then: + + .. code-block:: python + + if oe.data.typed_value("FOO", d): + # condition is met as FOO = "yes" so becomes "True" + ... """ if value is None: return False @@ -128,20 +167,56 @@ def boolean(value): raise ValueError("Invalid boolean value '%s'" % value) def integer(value, numberbase=10): - """OpenEmbedded 'integer' type + """ + OpenEmbedded 'integer' type. + + To use this type, set a BitBake variable ``type`` flag + to ``integer``, and its value to an integer string. Optionally, the + ``numberbase`` flag can be set (defaults to base 10). + + The variable can then be used with :py:func:`oe.data.typed_value`. + + For example:: + + FOO = "13" + FOO[type] = "integer" + + Then: - Defaults to base 10, but this can be specified using the optional - 'numberbase' flag.""" + .. code-block:: python + + if oe.data.typed_value("FOO", d) > 12: + # condition is met as FOO = "13" and 13 > 12 + ... + """ return int(value, int(numberbase)) _float = float def float(value, fromhex='false'): - """OpenEmbedded floating point type + """ + OpenEmbedded 'float' type. + + To use this type, set a BitBake variable ``type`` flag + to ``float``, and its value to a floating number string. Optionally, the + ``fromhex`` flag can be set to "true" to use Python's built-in + :py:func:`float.fromhex` (defaults to "false"). + + The variable can then be used with :py:func:`oe.data.typed_value`. + + For example:: - To use this type, set the type flag to 'float', and optionally set the - 'fromhex' flag to a true value (obeying the same rules as for the - 'boolean' type) if the value is in base 16 rather than base 10.""" + FOO = "1.23" + FOO[type] = "float" + + Then: + + .. code-block:: python + + if oe.data.typed_value("FOO", d) > 1: + # condition is met as FOO = "1.23" and 1.23 > 1 + ... + """ if boolean(fromhex): return _float.fromhex(value) @@ -149,6 +224,42 @@ def float(value, fromhex='false'): return _float(value) def path(value, relativeto='', normalize='true', mustexist='false'): + """ + OpenEmbedded 'path' type. + + To use this type, set a BitBake variable ``type`` flag + to ``path``, and its value to a path. Optionally, the following variable + flags can be defined: + + - ``relativeto``: another path string to join to the variable's value, with + :py:func:`os.path.join`: + + .. code-block:: python + + os.path.join(relativeto, value) + + - ``normalize``: a boolean string ("true" by default) that normalizes the + path with :py:func:`os.path.normpath`. + + - ``mustexist``: a boolean string ("false" by default) that ensures the + path to the file/directory exists, otherwise raises + :py:class:`ValueError`. + + The variable can then be used with :py:func:`oe.data.typed_value`. + + For example:: + + FOO = "src/pyproject.toml" + FOO[type] = "path" + FOO[relativeto] = "${S}" + + Then: + + .. code-block:: python + + >>> print(oe.data.typed_value("FOO", d)) + ".../path/to/source/src/pyproject.toml" + """ value = os.path.join(relativeto, value) if boolean(normalize):