From patchwork Wed Sep 10 16:56:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 69980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 169B3CA101F for ; Wed, 10 Sep 2025 16:56:43 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.24163.1757523402483562239 for ; Wed, 10 Sep 2025 09:56:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=qvOjJq0T; spf=softfail (domain: sakoman.com, ip: 209.85.210.173, mailfrom: steve@sakoman.com) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-77256e75eacso6401896b3a.0 for ; Wed, 10 Sep 2025 09:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1757523402; x=1758128202; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=P2E8Xah+NevlT/en1Le59hSqyMcWsGEXV1qmguU1AoA=; b=qvOjJq0TSefxu+wQ97nzmYHjaQAJ473/xnKUcuuRlN3/RC3MtlwuCKdlmP3GbffrJJ yD9AvhPg9XktDt0i+uZc+TKrlKfVhVvQxncHOGVxM4HC1RAxyosa6d3dpc+5vaGbs0OB XbxeMxMMU7g6UU1A1LY7NHfGzvlsJmA9veg9nA+dspOt41QXhs/4eDbzmzJ3DRkZtK7U yCkyYuhUDBxBUsOWRwSEDe8qWFp6zY4Hq9f2XW3LGLKeC/tyv4yKYOsDpM96W33Qw9a6 hMJg1lk4lvECCyvaBwD+pEXtI73x2Qdj7HuJBnnYC4YsQ8Lbr7PgNWeKNDoVYHNfEfDx 0Z2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757523402; x=1758128202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P2E8Xah+NevlT/en1Le59hSqyMcWsGEXV1qmguU1AoA=; b=P8YV8r/8Wcih6hsaAfCPTx75Jb3zoRCALrC+wZbxbbFtpc0aPeCfJ3AV9J9nSB5nDv MckGSyCtuq8U0UBTkHXQBvkZJ13vmOF9LYWRkA8y4cFMeBSB70xyFkEHdCBfG4KlWfsn m2sJ5MOCC3jICwJL9goot4fmFeoh+qiYOWUUvomcf7QAqa/nJvdcLr/deMTryZNCxSMq SxC04nky8XWSFsqJlxH3hZF9Rp9IegZFl+ai99/7ptgU5di1S8/s7pjuJVlxvzzfie+k lJRhw1HHl2kcB1y8d0kMkyUVuCcI/HXGXN07TkIVlI/xFAq4EuWlvzM2pn6j8bhlIYpJ Z1+g== X-Gm-Message-State: AOJu0YxkJ4usGsxJU7dUynQlk78L0Lvo3BI6WbSDnMwjldfJXBbMDmiz Z+/HAdCcsaUhCkNjYWe0ShCLLnfmDfNkPj/2RkkMaGv2ltVTqAwttqM1lhLHgwDa9SG/3bJvIKG x5pT6 X-Gm-Gg: ASbGnctSKM1Pii/VOt8MXEYsjVxVkALBG9CEkyE/+c7haIthog+AXOkMTyResZ87/IM IWLWKN7VvT0K4MVAGmJG1Pr87qKTlrqafj/VjfEDSU6cxYMVlnNfB9y+iT4sA2GSH9WINApw8sx rwU+0IbAEoAelc5HsEIKqLG8TGci6vkx8yDJkdkwX+8C3zsZvAEltdxQUxHDCueu8N9ST3wHIEJ 1wb3ZsgyQo4x93NTovU4p8VOz0C8v/VCbIJwXRMdPfRFUR3pqxWMk41AGuX7W4F9igXchIxJhrH 4zJwIVm3+oNXydPZe8BuyjLg0nz6xQwZAKalL08fJmqP7qFoDLK9Y9gGiNYPAQ2AuH8X9uJx6/y yd9tra82QSjSSfw== X-Google-Smtp-Source: AGHT+IEfx6atLT2prUeH1YR1VVPF/OspeLXqfcKKj+q0v1L7l55dX0Y/DpCeoM1Se8oIDnkMKCOvcQ== X-Received: by 2002:a05:6a21:6d9f:b0:24e:a19:7eb1 with SMTP id adf61e73a8af0-2533d5fec6bmr19018646637.6.1757523401302; Wed, 10 Sep 2025 09:56:41 -0700 (PDT) Received: from hexa.. ([2602:feb4:3b:2100:5b33:a32c:9e59:27d3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-77466118071sm5673608b3a.24.2025.09.10.09.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 09:56:41 -0700 (PDT) From: Steve Sakoman To: bitbake-devel@lists.openembedded.org Subject: [bitbake][scarthgap][2.8][PATCH 1/3] Use a "fork" multiprocessing context Date: Wed, 10 Sep 2025 09:56:33 -0700 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Sep 2025 16:56:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18004 From: Joshua Watt Python 3.14 changes the default multiprocessing context from "fork" to "forkserver"; however bitbake heavily relies on "fork" to efficiently pass data to the child processes. As such, make "fork" context in the bb namespace and use it in place of the normal multiprocessing module. Note that multiprocessing contexts were added in Python 3.4, so this should be safe to use even before Python 3.14 [YOCTO #15858] Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie Signed-off-by: Martin Jansa Signed-off-by: Steve Sakoman --- lib/bb/__init__.py | 28 ++++++++++++++++++++++++++++ lib/bb/asyncrpc/serv.py | 2 +- lib/bb/cooker.py | 2 +- lib/bb/server/process.py | 2 +- lib/bb/tests/support/httpserver.py | 4 ++-- lib/bb/utils.py | 4 +--- lib/hashserv/tests.py | 2 +- 7 files changed, 35 insertions(+), 9 deletions(-) diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py index cdec9e4d6..f59c2515b 100644 --- a/lib/bb/__init__.py +++ b/lib/bb/__init__.py @@ -37,6 +37,34 @@ class BBHandledException(Exception): import os import logging from collections import namedtuple +import multiprocessing as mp + +# Python 3.14 changes the default multiprocessing context from "fork" to +# "forkserver". However, bitbake heavily relies on "fork" behavior to +# efficiently pass data to the child processes. Places that need this should do: +# from bb import multiprocessing +# in place of +# import multiprocessing + +class MultiprocessingContext(object): + """ + Multiprocessing proxy object that uses the "fork" context for a property if + available, otherwise goes to the main multiprocessing module. This allows + it to be a drop-in replacement for the multiprocessing module, but use the + fork context + """ + def __init__(self): + super().__setattr__("_ctx", mp.get_context("fork")) + + def __getattr__(self, name): + if hasattr(self._ctx, name): + return getattr(self._ctx, name) + return getattr(mp, name) + + def __setattr__(self, name, value): + raise AttributeError(f"Unable to set attribute {name}") + +multiprocessing = MultiprocessingContext() class NullHandler(logging.Handler): diff --git a/lib/bb/asyncrpc/serv.py b/lib/bb/asyncrpc/serv.py index a66117aca..953c02ef3 100644 --- a/lib/bb/asyncrpc/serv.py +++ b/lib/bb/asyncrpc/serv.py @@ -11,7 +11,7 @@ import os import signal import socket import sys -import multiprocessing +from bb import multiprocessing import logging from .connection import StreamConnection, WebsocketConnection from .exceptions import ClientError, ServerError, ConnectionClosedError, InvokeError diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 6fce19b46..778cbb589 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -12,7 +12,7 @@ import sys, os, glob, os.path, re, time import itertools import logging -import multiprocessing +from bb import multiprocessing import threading from io import StringIO, UnsupportedOperation from contextlib import closing diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 76b189291..34b3a2ae9 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -13,7 +13,7 @@ import bb import bb.event import logging -import multiprocessing +from bb import multiprocessing import threading import array import os diff --git a/lib/bb/tests/support/httpserver.py b/lib/bb/tests/support/httpserver.py index 78f766005..03327e923 100644 --- a/lib/bb/tests/support/httpserver.py +++ b/lib/bb/tests/support/httpserver.py @@ -3,7 +3,7 @@ # import http.server -import multiprocessing +from bb import multiprocessing import os import traceback import signal @@ -43,7 +43,7 @@ class HTTPService(object): self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir, self.logger]) # The signal handler from testimage.bbclass can cause deadlocks here - # if the HTTPServer is terminated before it can restore the standard + # if the HTTPServer is terminated before it can restore the standard #signal behaviour orig = signal.getsignal(signal.SIGTERM) signal.signal(signal.SIGTERM, signal.SIG_DFL) diff --git a/lib/bb/utils.py b/lib/bb/utils.py index d2f11e437..1b4fb93a3 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -14,7 +14,7 @@ import logging import bb import bb.msg import locale -import multiprocessing +from bb import multiprocessing import fcntl import importlib import importlib.machinery @@ -1174,8 +1174,6 @@ def process_profilelog(fn, pout = None): # def multiprocessingpool(*args, **kwargs): - import multiprocessing.pool - #import multiprocessing.util #multiprocessing.util.log_to_stderr(10) # Deal with a multiprocessing bug where signals to the processes would be delayed until the work # completes. Putting in a timeout means the signals (like SIGINT/SIGTERM) get processed. diff --git a/lib/hashserv/tests.py b/lib/hashserv/tests.py index 5349cd586..ed1ade749 100644 --- a/lib/hashserv/tests.py +++ b/lib/hashserv/tests.py @@ -11,7 +11,7 @@ from bb.asyncrpc import InvokeError from .client import ClientPool import hashlib import logging -import multiprocessing +from bb import multiprocessing import os import sys import tempfile From patchwork Wed Sep 10 16:56:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 69982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2FF3CAC587 for ; Wed, 10 Sep 2025 16:56:52 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web11.24165.1757523403800428763 for ; Wed, 10 Sep 2025 09:56:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=vrbkkoDe; spf=softfail (domain: sakoman.com, ip: 209.85.210.177, mailfrom: steve@sakoman.com) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-7725fb32e1bso7637842b3a.1 for ; Wed, 10 Sep 2025 09:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1757523403; x=1758128203; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7RWGFL9MjqdnlHRjjY5chdRZndhtV7JlVhcmVtM/+Uo=; b=vrbkkoDe4PQ1kRHg+uNzcDUjc+vOebgE6TOWEeA1TSHZZKj3I+uCXezmuVM95zKNwk osCHbxl8Rv0ziYAv3JDVzHRJUoPcxai4PZScMtfjdhnmhB2j3RV7Az+Hljl4Zq9F6JVv r8s98+/IaPmMkc/5VC+/R0ESEwbPBlz5StFHygt8eXdiqN4MXONUbur5LhpE5tJQ8NXP ePTIu+qH6sIXEUQCnD+b1iuk9r5Y/AZeZluZAtZ9UOy1OVZnCQW9h/cCBvXGY4g7gLWL pHfCLA/LjzjONhJ7XGwuXEYZ6n7PuV5dop8huHGBmRQrdtVLzADWIsi2x8BFraJPcguM oVyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757523403; x=1758128203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RWGFL9MjqdnlHRjjY5chdRZndhtV7JlVhcmVtM/+Uo=; b=GYjj/zDPcAYRPa4lHcMp0Go/sZU/30GuDoqbO8ywrAHy/a7trVgQLjrdybIBR7n4ON fZHMdx5u0uoAsgVwDYsBYejq5aKhRS4dcWUIYZkc4yMSwIOXN/A+/xJdpRKmQaMSWySd M90tXgipegA0w9TjwlDix+uoYgamWApg4HSkTFJtQqSUUBCQ9Goj2+8WAxIHlxNy7ZsS bId29KX/kwumFMtXkIatCkQWro9t2rfx6tDqBxeBOUIWWqHFx0b4VLOOFsjhWpv6XTdD bQb8/hiXXBydabJxUIed1OAuwDFWiWbO1l19DFXhV8/g+8DkzHwAUeZ4XPpTjhecSxZT Kaqg== X-Gm-Message-State: AOJu0YxD/Y/FKfmhQGQiQlUXf6VaH4IJjl6YUj+ktJSbPmyn6YnRbNHf b6f+XL94Nc1ZKUW8DR5sRoOiDg36z6uOMXmiFTZA+45/1r0lagTFDCgSDFKosyfbbf48bhOzkZY pl8kK X-Gm-Gg: ASbGncv4KkcnHC+lIJZ1LOz30hxfDbkIiHsPt4wv1nkU/RfggYykD7PMcVmPoJQRe9G +PooBDvMu2hY9S8W6EcYTt5VtkO8vawTUGaUItkdsm0TxOJp5EtilTA7yxK5DX7uc7VpPvz1zbI XqIvgWhNenpNLVtc7HOHfnCEbD2f09rMqiRC+dvdAz2KtbQxCEd1Rb9Z/8Nim3ez+qObJSfKFfd nZ/hmkX+8MF3pM1Kpy1N4TWVjvWToMo67MDwcSw4HF1zdbsugcS8CgiKfT8jI2vng3MxTJFdH54 1QZw5pr3CH+KsV58alecDFWICpVTclDcKdf/hbX7eLrzePHh2TrPdQD+Ic+O/k6OjwF4Ua82YH5 etUT90pdf5UZ5Z6RR1HjzMPMe X-Google-Smtp-Source: AGHT+IF/FexmA0EtXQ3RCLh/dseZgI0G5orcgG2psKGtJ6mCMuHjrWHVovUlbHAjXAC7LRfSuHuKuQ== X-Received: by 2002:a05:6a00:84e:b0:771:f69a:c426 with SMTP id d2e1a72fcca58-7742ddadc99mr23710225b3a.14.1757523403007; Wed, 10 Sep 2025 09:56:43 -0700 (PDT) Received: from hexa.. ([2602:feb4:3b:2100:5b33:a32c:9e59:27d3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-77466118071sm5673608b3a.24.2025.09.10.09.56.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 09:56:42 -0700 (PDT) From: Steve Sakoman To: bitbake-devel@lists.openembedded.org Subject: [bitbake][scarthgap][2.8][PATCH 2/3] bitbake: Bump version to 2.8.1 Date: Wed, 10 Sep 2025 09:56:34 -0700 Message-ID: <5d7f7fc9633d3c380f095e7b22ac0dab1492c846.1757523235.git.steve@sakoman.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Sep 2025 16:56:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18005 From: Martin Jansa To indicate compatibility with python 3.14 [YOCTO #15858] Signed-off-by: Martin Jansa Signed-off-by: Steve Sakoman --- bin/bitbake | 2 +- lib/bb/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/bitbake b/bin/bitbake index f494eaa13..a2a42a3f6 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -27,7 +27,7 @@ from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException bb.utils.check_system_locale() -__version__ = "2.8.0" +__version__ = "2.8.1" if __name__ == "__main__": if __version__ != bb.__version__: diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py index f59c2515b..3fb2ec5d1 100644 --- a/lib/bb/__init__.py +++ b/lib/bb/__init__.py @@ -9,7 +9,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -__version__ = "2.8.0" +__version__ = "2.8.1" import sys if sys.version_info < (3, 8, 0): From patchwork Wed Sep 10 16:56:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 69981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2FB7CA101F for ; Wed, 10 Sep 2025 16:56:52 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mx.groups.io with SMTP id smtpd.web10.24319.1757523405425596577 for ; Wed, 10 Sep 2025 09:56:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=nSgpAmNW; spf=softfail (domain: sakoman.com, ip: 209.85.210.182, mailfrom: steve@sakoman.com) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-7722c88fc5fso6479687b3a.2 for ; Wed, 10 Sep 2025 09:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1757523405; x=1758128205; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=b9yO81M5eJaSsNa4tXpscSOpU3GQgN58Bh9vwOf8Qhs=; b=nSgpAmNWa1G30co1TkejLDlNZCJ0dMcf2yePpffIXltpjwB3uk1F+vHiAspeqWAuYk IQAtf2Mi+k6+ng8eR3NuFEwAN4fV+3k6jA1kaZdST5z9Bo+WdwtpSLg69avn7CQqqIdk 8Ve7BliOQmhywV0hnIWgc3hB+VbHGBh5MeeqSEi4tLds+gkpxhF6eBlJazx5ysTJ5Amo mTYp8+LWGU4zU5Fg3KvL4NlKYEvGiW+hWzm/B/8uR3XVUs2pvtuCwAHPkQ2zC3tIdSe7 FDjV+Huf8wqjB4GVPkNRwqmURBrLwtc4Pj8I2ivpiAeCD8evJ0sY2FKA89V5rYm5NG1h JY6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757523405; x=1758128205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b9yO81M5eJaSsNa4tXpscSOpU3GQgN58Bh9vwOf8Qhs=; b=Xm5qs9sqUJxLK8+O7sH0n5cbsQvPsTUCAAjQ5KAxCP/UbkXPlUBiRTmQaIxxLN/X1X tiKgsdHXzfwr7YwipqueecQ9ExA3Cge/xjkd8jodLjW+ycLbUNKJ77ivuOp3v4ujis4s sQj+C5xlhOJ/sxDr6W22guJZe4cFgBKRyjyF+3FvJuqBxOZ6vk04lx5ueYIAg1bFfjIy qTRulFNwofa4qey6xR0rPoZ1tOLfEDizCRlFP+tv/2LVF6iIw4ZVgxOFGikPMqgCgQ5f cZTOivgJ2mL8VPjgACk7JLebDHYBffcCjlVFGQ3RCOVoRGuTux4SBeDuHmJnkCsvf5bS 7tOQ== X-Gm-Message-State: AOJu0Yzkic35H03Fr7rz3zOVMF1D4zB0tybsHcui15Lwc+UgZSparcfP 4OCxnCrW3H9+YxkXisSjP+drC4q8olw5BvTpCrhoUp1ILwTrdHVvJQcjXpyqHlFxFCe4jFyu4Ri n9bPL X-Gm-Gg: ASbGncsrZwewBmCtGuJJUEqn/CpbImIBtflowbNjKcCKt82yrDe2iJYB1ooO5hQPvs1 bHnWfOecBX6Q8GPzU95pR9KE88xXsg8whZ72keZxNbFnI3iwBxhKTyMy0uis/qriRYT1XaL4yrb ZMM3duhpNZdDVsKtDSXAkfBNkPt9fGB2goeSemgxOsQtfqrxU6vm55f3wGykvlho7KOrJj/vldc E/NNL+K39xVftUhagyyYK29IuVCW3KV3l7noBjwNLstdTjMpS3/+9Cw/VqMTw5sQvmnfQC1FeZP XHG5NjHe1fuE/7omcHQV1Pl9i2QqDt0Ll7iZIfo8jx6f5A275cnBx7cgjbN0IA9YiK2bnf11GSU auoIgDLDR5VFNmA== X-Google-Smtp-Source: AGHT+IHh4h6rY9u9KPU0Tb7HgnFRYgOYeOb6xHSVAmg+EGbK2OFtDD8DL8ewNDRbYWVK/oeS2aHWDw== X-Received: by 2002:a05:6a00:3e09:b0:772:59c6:433a with SMTP id d2e1a72fcca58-7742de8f0c3mr22879850b3a.24.1757523404657; Wed, 10 Sep 2025 09:56:44 -0700 (PDT) Received: from hexa.. ([2602:feb4:3b:2100:5b33:a32c:9e59:27d3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-77466118071sm5673608b3a.24.2025.09.10.09.56.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 09:56:44 -0700 (PDT) From: Steve Sakoman To: bitbake-devel@lists.openembedded.org Subject: [bitbake][scarthgap][2.8][PATCH 3/3] bb/fetch2/__init__.py: remove a DeprecationWarning in uri_replace() Date: Wed, 10 Sep 2025 09:56:35 -0700 Message-ID: <5bdc63d1647e21a530568c0635d95c17354a18db.1757523235.git.steve@sakoman.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 10 Sep 2025 16:56:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18006 From: Bin Lan There is the following warning when executing to bitbake linux-yocto: bitbake/lib/bb/fetch2/__init__.py:464: DeprecationWarning: 'count' is passed as positional argument This is because the 4th parameter of re.sub(pattern, repl, string, count=0, flags=0) is a keyword parameter. We use keyword arguments for parameters that are not positional. Signed-off-by: Bin Lan Signed-off-by: Richard Purdie Signed-off-by: Chris Laplante Signed-off-by: Steve Sakoman --- lib/bb/fetch2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 1a6ff25d4..7b75d5d83 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -460,7 +460,7 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None): for k in replacements: uri_replace_decoded[loc] = uri_replace_decoded[loc].replace(k, replacements[k]) #bb.note("%s %s %s" % (regexp, uri_replace_decoded[loc], uri_decoded[loc])) - result_decoded[loc] = re.sub(regexp, uri_replace_decoded[loc], uri_decoded[loc], 1) + result_decoded[loc] = re.sub(regexp, uri_replace_decoded[loc], uri_decoded[loc], count=1) if loc == 2: # Handle path manipulations basename = None