From patchwork Tue Jan 6 12:10:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78063 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 CC604CDC178 for ; Tue, 6 Jan 2026 12:10:39 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88564.1767701438893195569 for ; Tue, 06 Jan 2026 04:10:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HWyWr9zE; spf=pass (domain: gmail.com, ip: 209.85.218.53, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b7277324054so164384466b.0 for ; Tue, 06 Jan 2026 04:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701437; x=1768306237; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+AvEvZMWxk89/Km99mkiP7CsVVAby6Ms07AOXtOi0WM=; b=HWyWr9zEGxjTWmFoRQOMMai6+52px3Uxknp9FrtuARfhpYUOJ0RMUWBdjmGoKB0Ura 9TMU4tcIL59+resihy5ZuNRO4xK4j3k50nG/FnVdF9pMXgdj6a6m56eTMs6IcGc8Dt3V SFVeLnPqva3Kfsd6py25ftlijU/xVxyL1/4zC9bZbCRiMEiC5299eD81ytejZWR4hG1+ dkLHApBp5SMjArUu8DWuH4v9QX/0aJLMOkvM8GMiyWq9YrRviRCIXPeEEMP5XeQwdW4I maDCURt+sF3fQRsmBmqK5WVT2Oj7bL7X42HjQs2JMsb6HxA/IOVt7xSghjIeDCItTL+c UmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701437; x=1768306237; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+AvEvZMWxk89/Km99mkiP7CsVVAby6Ms07AOXtOi0WM=; b=wJGXpzb8eAC3zlf2z9+DCHC0jP3oiHAsv2vG2kQgeHVku9lW2Z4B2AWEcsoO2qSStu wedHZuym0GQpk97Y+JZ+V79ujFWJGz6vuvcaXRYQZr7F0XWY40XgMvAKflX7jagI0QF9 wsvVrLROuU2J5pQ09kYpXhfeV1GhQxG2sz1zgelIeJoAExfuirk5djPkrHn6RGrMJCAh RrultrD5ktJSLOuVsRnqxe5gfKJrEIEFTfxz/Kfb2ph2lnAbm2G1AriyttH+JzR/tXYZ BtR9r0WEVFuYNS+lwAPMhNO5OBPTuGdODBtcUfkXV6ecyvqdFQD2P7Da9HPACL9Q4iOR g5Wg== X-Gm-Message-State: AOJu0Yzqfgxc73/mgFOZUCjjLI7ZJUyMMHR8d+nIvbzna2Gm0yDjNaXl OQT+FEK8pNMx+FnfHbN+bAiveH2DRcrpGKfwDLgj7zDL6ywEzIs3RGZ7jpl68A== X-Gm-Gg: AY/fxX5tznilPoEMm9YWynkxNR+UpiLT6JQPxkulec5xjQrwlOAD5JcFDLd0FIETFYP k0nZ3qG4HoHP6AH0OJHI3wswFxQjP+SzLcFUqFyDVRt1BPsHQuFRapPfZcs8Q2tZj34UKWGHK3o 7gteb+B+mHAgRp+rctLiqX/mrK8HBB0AICdDy8Y3eaArDEjfZ9ILHEERscBLorPSLj81GiahDVR 8yWANZaDDkIVfFTxx8WP+mgOeDWIDnzCPK/D4nGI+SySIztSZMUN0MVjB8JNdfHKZIYsRhhb3Nm +VEsdcCiZpfoQB95hI4CW/GsAGjXVe8j9kXa1oee/YlOlN5hqu43Y/kn7ayraXVWRHvYunLx6Cd Z43iLkXXZxOI1wZ9/mrxUU89l+oGtA8n8oMc/RjqIqQHOjax9ypEcWyRINbSee7V7TLrQpu5dTg q5i9MJLHNCdQ+iatiDEC6vDHmvoO6GDc8DdeUNsFye6i9Q7uA= X-Google-Smtp-Source: AGHT+IGYT+q2jvbNiUNJUm8HRkFvat9gBlWrGKuabql3lFFBLZqQ9/JtmZlrrBXTyftUOKblhkIOdA== X-Received: by 2002:a17:907:6d22:b0:b73:667e:bb29 with SMTP id a640c23a62f3a-b8426a4a80cmr285678566b.8.1767701436972; Tue, 06 Jan 2026 04:10:36 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:36 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 01/10] bitbake-setup: move the local source tests to the end Date: Tue, 6 Jan 2026 13:10:23 +0100 Message-ID: <20260106121033.3892596-1-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18691 From: Alexander Kanavin They are not a part of the main testing sequence, and logically should not be in the middle of it. Signed-off-by: Alexander Kanavin --- lib/bb/tests/setup.py | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 933178c84..ad09913f4 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -320,34 +320,6 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) out = self.runbbsetup("update --update-bb-conf='yes'") self.assertIn("Configuration in {} has not changed".format(setuppath), out[0]) - # check source overrides, local sources provided with symlinks, and custom setup dir name - source_override_content = """ -{ - "sources": { - "test-repo": { - "local": { - "path": "." - } - } - } -}""" - override_filename = 'source-overrides.json' - custom_setup_dir = 'special-setup-dir' - self.add_file_to_testrepo(override_filename, source_override_content) - out = self.runbbsetup("init --non-interactive --source-overrides {} --setup-dir-name {} test-config-1 gadget".format(os.path.join(self.testrepopath, override_filename), custom_setup_dir)) - custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) - custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') - self.assertTrue(os.path.islink(custom_layer_path)) - self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) - - # same but use command line options to specify local overrides - custom_setup_dir = 'special-setup-dir-with-cmdline-overrides' - out = self.runbbsetup("init --non-interactive -L test-repo {} --setup-dir-name {} test-config-1 gadget".format(self.testrepopath, custom_setup_dir)) - custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) - custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') - self.assertTrue(os.path.islink(custom_layer_path)) - self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) - # install buildtools out = self.runbbsetup("install-buildtools") self.assertIn("Buildtools installed into", out[0]) @@ -428,3 +400,31 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) out = self.runbbsetup("update --update-bb-conf='no'") sums_after = _conf_chksum(f"{setuppath}/build/conf") self.assertEqual(sums_before, sums_after) + + # check source overrides, local sources provided with symlinks, and custom setup dir name + source_override_content = """ +{ + "sources": { + "test-repo": { + "local": { + "path": "." + } + } + } +}""" + override_filename = 'source-overrides.json' + custom_setup_dir = 'special-setup-dir' + self.add_file_to_testrepo(override_filename, source_override_content) + out = self.runbbsetup("init --non-interactive --source-overrides {} --setup-dir-name {} test-config-1 gadget".format(os.path.join(self.testrepopath, override_filename), custom_setup_dir)) + custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) + custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') + self.assertTrue(os.path.islink(custom_layer_path)) + self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) + + # same but use command line options to specify local overrides + custom_setup_dir = 'special-setup-dir-with-cmdline-overrides' + out = self.runbbsetup("init --non-interactive -L test-repo {} --setup-dir-name {} test-config-1 gadget".format(self.testrepopath, custom_setup_dir)) + custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) + custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') + self.assertTrue(os.path.islink(custom_layer_path)) + self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) From patchwork Tue Jan 6 12:10:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78064 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 AEFB5CDC17D for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88565.1767701439557138628 for ; Tue, 06 Jan 2026 04:10:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RXPxm7BT; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b8010b8f078so147161366b.0 for ; Tue, 06 Jan 2026 04:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701438; x=1768306238; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VGnHNMj4wrW4+b/3IfY5d1qVTc9C6XP6HyxlqMq5pI8=; b=RXPxm7BTfTvZ415ordC0Nyym/Yg3rWbBlSlsRu6+BmTZxQOaXfPmW2PtKAx6K2WldB 9lYAp9U15Gscb+upAzb6/PR4uitDCOMHi7e0rHmonf+0Pj+w0UliMGOZeSepu7hR3Ch6 S4oOVtOojo6Zy8tHkFSUFuPygYmrzMAKoeemVIfTeFdYDEzz0Nl5GZiyHddw1hI1S1iH /d6DigHbVkT1fPYkz00E6eZLPL3MH+P3EpWnYNADtjwWUKFAHi+3lY4RULUf1/1SsrD5 RYpmshlVwy8HVpyE5X+7N+pq7UxWtHjfnQv4z0l+m7M0hDdWUBnrVLDUK+Tr407lRpxq GFew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701438; x=1768306238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VGnHNMj4wrW4+b/3IfY5d1qVTc9C6XP6HyxlqMq5pI8=; b=Km2VtybX7GpUNv6oAzkPgEVdck2Hag8oJh/UuZRqu1kJ6AXvQ4E9rpHp7QICKp+16O 7Uy3jEah4aQuXidAUxYah7HocinSAb164QbMLeHkMbZ9xcf6TadYUjyTZPe7FL1y4leK RomC2G97Qehuu4wSUgZKDv1F+saz5UXq8y2ut9Mlb8lws0ecow7/iePS9VKnzU5NRODE CQrXhz8G/QDI0sLyTv6NoSisk6eaB0ynIqOV3sWIf0p+gOwyQLjHmm11CQVaoYoSAcFL QH3K/60Kil0r/BJipslDCv7qq0hHbknaJKjbHc26AYS7WsD3GvZLXLDgoEvVrc5u52C0 ursg== X-Gm-Message-State: AOJu0Ywi6xaIIhO6mfPinvhiJFBe9f9RizDgHLi7OP0L89dCig+4uRQ7 lqrz0Smx4tH8aPzwy2tGOSPbLpwIVqwhIEpxR6UEHAFQQszlPrGyZS4KNmHygg== X-Gm-Gg: AY/fxX6YsgtEyTt15oGpV1zxs6hKyWmEqD5sn0LTlY97m48cEBPIVDlPVEqOdJteSUx 2vtqLhJac2Xkvx5stdPD7UKKZ00AK6OlwoFRtufdZs6J9Sw5obLI1UYbyBeDoXR5Ye/N3t0LSuk mZE9ETL11ykzN0DGkRaMVPtHK506/gGKZx03IX2d7yomLu6JuGg1KokIbsbn2f/JL/wL9/aEaLf 0QCNNQdYN2s5v/28bS0+ARN0BUw9HV5bxPrOAH+dAO45GGU2LprXwY/eDPS689dKjCKa6gbzt8D lrEZOCGjCPU7zi/woYqMSXk8WugDazD0cdpTlZRI4z7F5tj3y5tmQiJuh/30lLDyOe8e/SCXFxo n0IQ05o4m1sTXj1y4qRIQuVo3Pz8L3U5rLlPzGFXciWNFrrmjfXaBuOI6tgFW06Og7zY3yoc3nn W7ruNqB2RUDJYW1v6oxGA3WgAgySRQDIxft2sHMpe04ivyuxjeJo+ANxUAOQ== X-Google-Smtp-Source: AGHT+IE1SoyfEYAdZ8j3HlXW88eO/EtoQw3UOwr6aMhKjhv4u0cbdGPPNfZIfbrALUONuKYMAtiZzw== X-Received: by 2002:a17:906:4788:b0:b73:845f:4432 with SMTP id a640c23a62f3a-b8426bb964fmr342031366b.32.1767701437742; Tue, 06 Jan 2026 04:10:37 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:37 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 02/10] bitbake-setup: consistently add configuration commits at the end of updates Date: Tue, 6 Jan 2026 13:10:24 +0100 Message-ID: <20260106121033.3892596-2-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18692 From: Alexander Kanavin bitbake-setup tracks configuration history under setup directory in config/. Making commits in there wasn't consistently done in all init/update scenarios sometimes leaving uncommitted files. Move the commit creation to the end of update_build() function, ensuring it always happens. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 73f734e73..a0d1aaeda 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -342,6 +342,7 @@ def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt" thisdir = os.path.dirname(config["path"]) if config["type"] == 'local' else None setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_conf) write_sources_fixed_revisions(confdir, sources_fixed_revisions) + commit_config(confdir) def int_input(allowed_values, prompt=''): n = None @@ -581,7 +582,6 @@ def init_config(top_dir, settings, args): write_upstream_config(confdir, upstream_config) update_build(upstream_config, confdir, setupdir, layerdir, d, update_bb_conf="yes") - commit_config(confdir) bb.event.remove("bb.build.TaskProgress", None) @@ -648,7 +648,6 @@ def build_status(top_dir, settings, args, d, update=False): if config_diff: logger.plain('\nConfiguration in {} has changed:\n{}'.format(setupdir, config_diff)) if update: - commit_config(confdir) update_build(new_upstream_config, confdir, setupdir, layerdir, d, update_bb_conf=args.update_bb_conf) else: From patchwork Tue Jan 6 12:10:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78071 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 E2E5ECDC193 for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88566.1767701440533429038 for ; Tue, 06 Jan 2026 04:10:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KnSoI7mX; spf=pass (domain: gmail.com, ip: 209.85.218.46, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b79af62d36bso167515866b.3 for ; Tue, 06 Jan 2026 04:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701439; x=1768306239; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3fyBMAVpfir80Ys8d/2wX4ZB348IoLKcdz93a8jKvew=; b=KnSoI7mX15hIEaH5YkADknm2igFyRhHCgioKpy7CemuYP6MJLI0n+bX9naHO464deu hzsTm+KcWzpYcLBsZyjtVH9mINS0ApHyFDAMVcS/ra7oedJh0hnUPb4c0EYsK/wgzxJl rnGe1I6E4FiqpjfWXhg+l/M0US+VZhsjjMo0Mol1vBMnpvAY9jNsYEJn1OhqJQuWGOEK gkhLok2m31ePLHtAxvBjvJAEw6VZ6dIcjYO6+33JtPenZTHIePdfCFm43JIYO2NZMHNc xcWED2QAyzL4eulXXEt3RA3nD4K2vWk6/YYfg1WZld4YitBBYg1tmWWnuEHv/WfGPZtB pDqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701439; x=1768306239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3fyBMAVpfir80Ys8d/2wX4ZB348IoLKcdz93a8jKvew=; b=T9EYPWHOThbX8NoPDlHHQ8LbgXqf85mhSzMd2XXLSqlCKrer8QC06r9p7wIWBHaeha N1oS1CGeqEqo8kHimsS5VNCsVOaKVrVyVSmQPo29xiTiUSBlgpx5g/mBPUBSxvs4DUTF mJ3QYcT0VUaN/qDOwzetHltZ7EbE0TJy4BSdiONgWX3TZo1393QSAMl1VvkaEACvwZcP UPH2LwyJF9CUzizAQYekC8gBbzYIFxIBd/dJxEUPmo0SXlX9qeBoOEFloru5lB3XqB9I 6Rjk8tXuzLUPUxr6/KYWg3rKUyoqoHpAhNwCyj/r5dJsblMtXhtTg0rWwHTu2xhmHvQx zQlQ== X-Gm-Message-State: AOJu0Yz8IgLrT8eqXt8rWb59xXrecbx5/YiskTtn5c4dhnSVEvN1+EVo ltH12TTrafLldBzg0u3WczICnGJWi+aTrmhMCE68ldYUAR7MED30QxSI0nN+CA== X-Gm-Gg: AY/fxX7xmwiQc9U7/yEHk2llf6DtfsclHuhxNKwr0vNEXNztuoRa1F0JHLGJzDQQ+rm qqB2k1Qx+wVxFzUs8yTdSeXGO7rQs9bLh1z5mlQZysDSTetUCR1cCPUpunbomp+KDsGblOzdtsM kbalnPNfQfFhZHm6JZdKa3LxJus9wlXbDyqwA0uqvMncYTG9aHfDXr9e/yZdA5Sg0UrZXllEcps cg+bbBUkpKf6ueVXWW51kb9SSsMI/lzscXgaCYBy7YEBereV3BaNJJd7+aoXffDevbM4k1PVd/B aNqzvUBHSYiPgX3kc9WSJy/RldasvNnHm2xwcbhxIaRW8aLFYLtHOPkn40G4ncle+UznnPnpHA/ Hsoxncq3kqK7aa0vKby4ssmyxJ8/R0/aE2tq1d5nPqYCRr+BrssWuzGBOP+mGJ7YaVuqsJQVTz4 7OgZfOjZzLIOMxRYvwXjQdN2a+OeQJcLo3AWfroQmE+apaxyg= X-Google-Smtp-Source: AGHT+IHP9K8w6Z26WbNdh+FCgMJ2RGXzjDgBVWgBnyCepFNsQnxV3F/Dfalrie/aTCn3VHBj3IYsYQ== X-Received: by 2002:a17:906:f59c:b0:b77:1a33:1669 with SMTP id a640c23a62f3a-b8426c1d5b2mr366593066b.57.1767701438524; Tue, 06 Jan 2026 04:10:38 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:38 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 03/10] bitbake-setup: test after every update that config hasn't changed Date: Tue, 6 Jan 2026 13:10:25 +0100 Message-ID: <20260106121033.3892596-3-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18693 From: Alexander Kanavin This would catch situations where update hasn't run through to completion even though bitbake-setup finished without error, such as the one fixed in the previous commit. Also unset BBPATH from environment so that it doesn't leak out of the function where it's used. Adjust buildtools test to pass setup dir explicitly, as it was previously relying on BBPATH being set. Signed-off-by: Alexander Kanavin --- lib/bb/tests/setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index ad09913f4..55e9e50ec 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -180,6 +180,14 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.git('add {}'.format(name), cwd=self.testrepopath) self.git('commit -m "Adding {}"'.format(name), cwd=self.testrepopath) + def config_is_unchanged(self, setuppath): + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("status") + self.assertIn("Configuration in {} has not changed".format(setuppath), out[0]) + out = self.runbbsetup("update --update-bb-conf='yes'") + self.assertIn("Configuration in {} has not changed".format(setuppath), out[0]) + del os.environ['BBPATH'] + def check_setupdir_files(self, setuppath, test_file_content): with open(os.path.join(setuppath, 'config', "config-upstream.json")) as f: config_upstream = json.load(f) @@ -228,6 +236,8 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertTrue('BUILD_SERVER' in init_build_env) # a more throrough test could be to initialize a bitbake build-env, export FOO to the shell environment, set the env-passthrough on it and finally check against 'bitbake-getvar FOO' + self.config_is_unchanged(setuppath) + def get_setup_path(self, cf, c): if c == 'gizmo': return os.path.join(self.tempdir, 'bitbake-builds', 'this-is-a-custom-gizmo-build') @@ -314,14 +324,9 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) setuppath = self.get_setup_path(cf, c) self.check_setupdir_files(setuppath, test_file_content) - os.environ['BBPATH'] = os.path.join(setuppath, 'build') - out = self.runbbsetup("status") - self.assertIn("Configuration in {} has not changed".format(setuppath), out[0]) - out = self.runbbsetup("update --update-bb-conf='yes'") - self.assertIn("Configuration in {} has not changed".format(setuppath), out[0]) # install buildtools - out = self.runbbsetup("install-buildtools") + out = self.runbbsetup("install-buildtools --setup-dir {}".format(setuppath)) self.assertIn("Buildtools installed into", out[0]) self.assertTrue(os.path.exists(os.path.join(setuppath, 'buildtools'))) From patchwork Tue Jan 6 12:10:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78072 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 E792BCDC192 for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.88587.1767701440987032787 for ; Tue, 06 Jan 2026 04:10:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d9k5bx7+; spf=pass (domain: gmail.com, ip: 209.85.208.43, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-6505cac9879so1380104a12.1 for ; Tue, 06 Jan 2026 04:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701439; x=1768306239; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BVvPZUTrqnZCZBZwVYqJUkuEtLQjD9tVRkQn0CEDe1k=; b=d9k5bx7+U1iQOra7U4iwosud4a9UTYHUFO3TiH4cs2XS7ywOglC/+LrOsC8jp6qYJ3 fnnISJ8zjf4+rqkEQW5Cbk9odPdueDMAoTmtSvKGmrblLBZJt+T9M+qDuBoEv7V/I1Sx Imymeo0z9TEP0bcoquGU5xkhPPfrUob5xTRDS8p2gtEORI5f8Qj6ujTCvZ2UhHAILC6f EtZRtJ6x03KDfBbUJYR2Fmjm8I59jcL7kPxDiAcuvRhsZhGSTftbtNoMxQz/4PZLlZP0 G8Yd3SWrVusD4cifLoFqD0xgU4HankDqTqkyyBRdjfohRfjElCuFO6WkFqeuocqqg/MA Mzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701439; x=1768306239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BVvPZUTrqnZCZBZwVYqJUkuEtLQjD9tVRkQn0CEDe1k=; b=h42CWfAeAlB9zqvqat0M6qjFL8Tpqi0ZlCwecpeYEVu/9bpz/bAIKmGqi30g06Wo+/ SA9H+VlpvI1cWndPrFg4PrLYkXrHchawnVMqTSZqp94N5sFIwndaEXvluT/3thU8prOt +24xaMezcpZW4Ro92MsqFwDsaRRpnRKOyPA0qzjm1BbT6l4+qkPdgwWu16LRFI9JgSZ9 iSWWdzataL+bJEKSZCtmLC6pqLKPSTi7+MX3YsG1b31xdEtIY1SZK6DHrWjt22VaArQo oUZxVWwDImes/TOhNjjdK/baRTquyiDKBSf45UdvPDrhXU34nK0yAVg5g8z6mzDhkUWf KT1w== X-Gm-Message-State: AOJu0Yy7sc1VygCHw86dqv2Vz8Apgd9C/g5uxt/nzdKn+oEUwTaijZti xtHRhNW2OcS3A8sRsy+Gbniytp9YqH5gMHTqdxOUxSFsWi9zMplkUmA1BLCE4Q== X-Gm-Gg: AY/fxX4SIeVL1raCykEe2dAAYjbTbaHv7bHaH9/8q3dW5TQEzLph6LWhDtJWyrXHLa5 76s5Od9hR8Sa/Vk6wjPfnxMXFyGNrvHUHhF7VQ0i8oAsvFVuozBlM6KsZnf2MMFEZUQyfAOAtHk YNj7kaG5xJg0FY3SzKcI4+KjCpali7ROVnx1Tamub7lFnN5jMjyHyzwlWMfMTw8Ih8JVcdQD4yC AAFLxpjxuTT0eJyWzRJ9luvMF3BSyWOMFj12mPbHWin+gqmsyZdjqwHfnhOH1/MuyI3TVbap8Tg 2XSkEfzTk4VOrv85py5CEKiOD2erZt3+ioqPLe/0qk93DSSdYq0jGG5oqzrgpDyn2jwlui3INOQ NemOhUq7Nd4xIz3V/c0RuQbyQYwVMZZZNYxohkjgtzM3fp5lpZBPW1fiQBfCdmwQ9dW8ngbmZ4j uSHql0swpsPZaqFoXvvogy4JT8BV1/nG91o7YSRQ8Ehfv/ue8= X-Google-Smtp-Source: AGHT+IGK9s6y/lvcwLafk6Vfgs5xXvTvFnn8OvQnYimiPZtmAwdmF+Geh5Yjfw63xDL4Vb/3HYPtIQ== X-Received: by 2002:a17:906:d554:b0:b76:d880:398c with SMTP id a640c23a62f3a-b8426c99fe3mr309361766b.61.1767701439187; Tue, 06 Jan 2026 04:10:39 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:38 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 04/10] bitbake-setup: consider overrides when checking whether layers have changed in 'status'/'update' Date: Tue, 6 Jan 2026 13:10:26 +0100 Message-ID: <20260106121033.3892596-4-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18694 From: Alexander Kanavin This was erroneusly not done, and the original layer spec was used. Make a function out of the code that overlayes overrides onto the base layer spec, so the code doesn't have to be repeated. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index a0d1aaeda..7c4fa1934 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -331,12 +331,15 @@ def get_registry_config(registry_path, id): return os.path.join(root, f) raise Exception("Unable to find {} in available configurations; use 'list' sub-command to see what is available".format(id)) +def merge_overrides_into_sources(sources, overrides): + layers = copy.deepcopy(sources) + for k,v in overrides.items(): + if k in layers: + layers[k] = v + return layers + def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt"): - layer_config = copy.deepcopy(config["data"]["sources"]) - layer_overrides = config["source-overrides"]["sources"] - for k,v in layer_overrides.items(): - if k in layer_config: - layer_config[k] = v + layer_config = merge_overrides_into_sources(config["data"]["sources"], config["source-overrides"]["sources"]) sources_fixed_revisions = checkout_layers(layer_config, layerdir, d) bitbake_config = config["bitbake-config"] thisdir = os.path.dirname(config["path"]) if config["type"] == 'local' else None @@ -654,7 +657,8 @@ def build_status(top_dir, settings, args, d, update=False): bb.process.run('git -C {} restore config-upstream.json'.format(confdir)) return - if are_layers_changed(current_upstream_config["data"]["sources"], layerdir, d): + layer_config = merge_overrides_into_sources(current_upstream_config["data"]["sources"], current_upstream_config["source-overrides"]["sources"]) + if are_layers_changed(layer_config, layerdir, d): if update: update_build(current_upstream_config, confdir, setupdir, layerdir, d, update_bb_conf=args.update_bb_conf) From patchwork Tue Jan 6 12:10:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78067 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 B705ECDC185 for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88567.1767701441755637357 for ; Tue, 06 Jan 2026 04:10:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b6cOVXrg; spf=pass (domain: gmail.com, ip: 209.85.208.44, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-6505d3b84bcso1358035a12.3 for ; Tue, 06 Jan 2026 04:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701440; x=1768306240; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CpdJzUw9SMxn5LmzNOuQmPvXU0YGfPMFhYPS+4Ho5Pk=; b=b6cOVXrgpMfGyZJJatCNs4P5LRcDGyO7MP4/WILhUcEk3wK0uVi4lK97xnHpIAGPme JaOtH3dOFul0dqO49sK3YxIxMC2WsYSjsGodwjD4qsT0WbRciQDeQ7C3fLU2fFkA9oTL 7soTKoXWNMaepxdwLVsUidUthVTMSdQMeVQQUIUmk3JcAW8ZKxCypvp0VzLdaQyQ7QhW xQGXzdcBIogm2y8h5cRQfzyVCNRQVpmQT5w/+u9WkmLqFukSiZ/215HPUuA8LA5G8LTg OIE/xrZkfCgvTZnYBbp+qMGgHlWaSJCFrRjCxz3+1ktevtmiI1yOiR9RfVoFEWbORtob FYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701440; x=1768306240; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CpdJzUw9SMxn5LmzNOuQmPvXU0YGfPMFhYPS+4Ho5Pk=; b=wqAJQpFX2KRiypvCmlJll8eQTLCfYQcPBQkiphDTOkKbp/lEKllb6tKjpERU1FWDFY VNyHFlybr7BtVSAFoL3xgClVUr/p0Fr3l6OQFo5gb76XHfGjoI+O9/ZBjt5KZScKI4+k tXtRL2rHMaWykkocyt5TE2DCpaHa7eew42HZxTvxlq17XEzN0okC7EpJbLxwoh017AwY ENZypFOKL7LnzHjoIqBks+64m8ETOQ96fvIl6orFxDB4uWgyoPP0WFqDZoJMEFrsTkqz cH6NsHVT2b3kDSKHXeDINSLqERs2HmAXmwEkqzchvpQiku2wOIlOF1OkW3B1kLGrsTsO XJ7w== X-Gm-Message-State: AOJu0YxIVUd+kUR8p0+3SGTiqF4XYVr6iZLLrM08myN3dlIOGPxmwQx6 LhXRmr0AphNdeY+nx/Kz77sv5cbRcAkMwToCzXwLsSR/vmWb83ueNGvppknz9Q== X-Gm-Gg: AY/fxX7Wj4lTcbDkOaJce22c+XPExM0GPAW2OkmXPkhHtKLffuZeex8i97/547B0pd1 kJnqaMrXaU0v9KqQyYNvAsxjBiQSRasz9YhclCNYLoGEqZ/1FokTZXBZdVS3NULgWsDgjXb6TUa j1Iu8plDRRD7F30oyO9HaRRMWf/L0CH/5IXbS6Q97WqvYvPa/U4TCyumX2oBe3DrMZPwYJgseXZ UcMuY4nGGhl30zjFp/BGKsN95pJB1e6ArjyGXSec8BzQW+E5HOB0kuXcTla52gODdk/BSSPpRUX Xv6KQwKvwQkjgpfeSbvatql9zY0aa57Oazcx8b6+DDYFRGClEQnPZKMlzg3Nzq/Er6htzMOGZ9n JvV0LEsUbYC3JtFTxXkT3bU/8t2Sz0kulKvaL+joMAxMD4EQJTAD6zM9sDu3ew1cMagG61y/39B RD/VlGZAJIgdNQIhg05UkvhCqSkFPEioTaR+/YRsSwUfTsGnE= X-Google-Smtp-Source: AGHT+IHHtcsT+0B3fzcCik/OH/mtYZuHN+O8Cue94hooBqfdh9wEZ6HS87DUHBwBSaiyCHkgT4Rq9A== X-Received: by 2002:a17:907:86a8:b0:b84:2223:56a9 with SMTP id a640c23a62f3a-b8426bff4eamr311297666b.40.1767701439896; Tue, 06 Jan 2026 04:10:39 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:39 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Anibal Limon , Alexander Kanavin Subject: [PATCH v2 05/10] bitbake-setup: fix are_layers_changed when use local source Date: Tue, 6 Jan 2026 13:10:27 +0100 Message-ID: <20260106121033.3892596-5-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18695 From: Anibal Limon When use local source the git-remote isn't set causing exception because takes repodir as default value. Fixes: ``` NOTE: Looking up config ls-master in configuration registry Traceback (most recent call last): File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 1042, in main() ~~~~^^ File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 1035, in main args.func(top_dir, all_settings, args, d) ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 667, in build_update build_status(top_dir, settings, args, d, update=True) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 658, in build_status if are_layers_changed(current_upstream_config["data"]["sources"], layerdir, d): ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 627, in are_layers_changed changed = changed | _is_git_remote_changed(git_remote, repodir) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/home/workspaces/ls/bitbake/bin/bitbake-setup", line 601, in _is_git_remote_changed rev = r_remote['rev'] ~~~~~~~~^^^^^^^ TypeError: string indices must be integers, not 'str' ``` Signed-off-by: Anibal Limon Alex: remove the default '' value from get() as None is used otherwise, which is also suitable. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 7c4fa1934..0d33f0896 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -625,7 +625,7 @@ def are_layers_changed(layers, layerdir, d): r_data = layers[r_name] repodir = r_data.get("path", r_name) - git_remote = r_data.get('git-remote', repodir) + git_remote = r_data.get('git-remote') if git_remote: changed = changed | _is_git_remote_changed(git_remote, repodir) From patchwork Tue Jan 6 12:10:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78069 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 C6E7DCDC18F for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88568.1767701442488230727 for ; Tue, 06 Jan 2026 04:10:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ghxgWlhW; spf=pass (domain: gmail.com, ip: 209.85.218.48, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b79e7112398so150851666b.3 for ; Tue, 06 Jan 2026 04:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701441; x=1768306241; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ai79dbCrAiLWsJnWE+bUJA1wiuZNABO3QUVYVWFTmo=; b=ghxgWlhWY3cUS66PuNbvTgRUnBWWhlpoy7wzXFapRvIyPImSqZFUr4J5bTAX8p5Lgw LKvduU/jKc/KYh3UcMcLByp2rOPPmdPQrtHq8Zyh3Vd1FmIFYDwYaV54OSL/X1tmQCBW 92vpfqGjSd4vSf294ClGiC5vV/y1wVPfVNkdOQOi2BNv0BHSKYIYD0svy1zSEc385N/s JefR4tkvy9qfCGoZdvUDnFjytHsTCopZkY9pWCmAJ/kelXuwyhZ5suCrbR/Fp/6rqRD3 7fFEwqHmmwH6ILNnZagUgYRMcueHrXHwio9vMWLDEgsFDuvttWtCF2JE+Ww3LEXXgDum eV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701441; x=1768306241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/ai79dbCrAiLWsJnWE+bUJA1wiuZNABO3QUVYVWFTmo=; b=nHrmpmJCTVZeAFcu85GrITWcgFYKFnkTfGodCZc7RWT/dBd7ATn5Mzxe/X1rc8Oepf GFjgLHF3dv8yFibNk3q/bMZFhwHSeOeuI9EClmSLLIlDLGreak0SyA4UhTbZCp0vwPgN F7REMCEvK3+hyvewPxKQ6juelJYajNFuWeoDui58J//SiT8lJKLs1NjGOQUM6uer/dKp FrZl5N1jsvRpA3b2oxQMDaUt99OB0qL3HpjZrYBLnTKPeEnIrLUzLjZN1gIkisn005FY aHxaBiT5DLdBdSHv5rU6cOv4lPf7qbJYnGrE8QCJF2HxWc36N/bEjdn/MDO5aKgfjxLL mw1w== X-Gm-Message-State: AOJu0YxCyvTxy6fPofCzJ/Ge7Tz2n4tP7w8KkqdKr1a+DrrTcdYuVPn8 sm+m47gx7T2lvXeXsd5/Bv2ZiAb7Sssw+NDZg+6QiHW/SarxjQDRagWv+mFXeA== X-Gm-Gg: AY/fxX7XeXoS0b/QekvajPTMRmohJR/jFYa5JnqKBoHRzRBsdNh2eVFKT6Fg+UZo1jq 98isoI92JtOABUE8wkap0ic2Z/63M4qLVR3ANPmT1P22u2+XuYCv+ThhBZN5q8yT3ef7MuMybH9 ZHKJMRv80/lbQKnwKoLzhg2uPxg2EpaewrFx4dLPvcAb/gJAyUfVLwHN5XA5Xx1HrBikB8mg1P7 oe0c6LvBu0UbF2tclcaSS/YwsA5jDjLzb3KAG9sC4ZKckqjRtTz5S2JPO7sqk7x1rYEUkmogY4v R4c5vYedevNet6yILisF2O6fDyAfwlA0HqU4oekbnhhTK9UCQiVMvpyd0CxNZADmLVIhncLO977 41KV4SnKE7yAZwRXp5aRiSYJ186OFuWDmSzxMA5RnIzoT8goePX3AMAIYSzHsA2/Pz961aRbzxZ +AlDNdH8M+0Z85ELESEIDCCFFoTEQawMNkH4DdLxtmRXUuXN4= X-Google-Smtp-Source: AGHT+IEWPfz+qWSGCwU863FroPCxNAIJRmmeqcgqvGNpSeHwczvNqJBYlXunJTphgeqbYWv1gfUeAQ== X-Received: by 2002:a17:906:d54d:b0:b73:3028:93a1 with SMTP id a640c23a62f3a-b8426a4ed9emr281409566b.9.1767701440576; Tue, 06 Jan 2026 04:10:40 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:40 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 06/10] bitbake-setup: extend the tests for local sources with status/update sequence Date: Tue, 6 Jan 2026 13:10:28 +0100 Message-ID: <20260106121033.3892596-6-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18696 From: Alexander Kanavin This checks for both issues fixed in two previous commits. Split common local source checks into a function and extend it with a call to status/update checker. Signed-off-by: Alexander Kanavin --- lib/bb/tests/setup.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 55e9e50ec..30c8b31e3 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -407,6 +407,13 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertEqual(sums_before, sums_after) # check source overrides, local sources provided with symlinks, and custom setup dir name + def _check_local_sources(custom_setup_dir): + custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) + custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') + self.assertTrue(os.path.islink(custom_layer_path)) + self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) + self.config_is_unchanged(custom_setup_path) + source_override_content = """ { "sources": { @@ -421,15 +428,9 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) custom_setup_dir = 'special-setup-dir' self.add_file_to_testrepo(override_filename, source_override_content) out = self.runbbsetup("init --non-interactive --source-overrides {} --setup-dir-name {} test-config-1 gadget".format(os.path.join(self.testrepopath, override_filename), custom_setup_dir)) - custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) - custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') - self.assertTrue(os.path.islink(custom_layer_path)) - self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) + _check_local_sources(custom_setup_dir) # same but use command line options to specify local overrides custom_setup_dir = 'special-setup-dir-with-cmdline-overrides' out = self.runbbsetup("init --non-interactive -L test-repo {} --setup-dir-name {} test-config-1 gadget".format(self.testrepopath, custom_setup_dir)) - custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) - custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') - self.assertTrue(os.path.islink(custom_layer_path)) - self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) + _check_local_sources(custom_setup_dir) From patchwork Tue Jan 6 12:10:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78070 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 CC416CDC188 for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88570.1767701443093170791 for ; Tue, 06 Jan 2026 04:10:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LLo8VlhI; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b8018eba13cso156533666b.1 for ; Tue, 06 Jan 2026 04:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701441; x=1768306241; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4i9sicM6Z7W0DQ/FMvbubjpLq+gTNnswRlKEWWAobpY=; b=LLo8VlhIB2/pZxzpHr8bmPUWTyAT6+H00UUVywUo12w8D47/7SI9Q7YQxHUL3XsXcs OWJMhbUGxXuzl+M2RbIGOMcMiBrQBCRuyUFmYr+YBt9bpod4bsPx2ZXnPWbLMmV7E8Yp Dcm1T0Nm18613TvOJTw4gmGzLO7ILL/mju2fOINESRVOGmC4rJ3ReHtflwBKemvRgAdN 5U5HCUsKF08wRbBvPkS0z9wnhoTlw9cODokO03531cbrbLVWrkysNkT+Q6Mr/Tbutptr +mt01LfLKImdVtashm0w4Z6Q9iajCY/YkJq2jeLWlKBvZTYebXptFH0qcBfeYUIiKFtO Vdqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701441; x=1768306241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4i9sicM6Z7W0DQ/FMvbubjpLq+gTNnswRlKEWWAobpY=; b=CG1bUhHUmXTybFP2iyfmIRUNPKdvJBpEgmYH7bVrsY3smO89mSP851LV/8rJHCP5UU JYx9A4ZC6+uzjMl/cTWXTHmKLPC2rtR39CIGQbzMv79bTwzg1I9H6zHmYBf9jr5+e+iV PYw93dB3xsXfMtTbhK95ym8BRlBIXaYAkda9XjlDiGU0OIvDQJ/mOKJSG0sVAIvYX/7P TNuZsCT8TyDl+ptKXpfpoXNB9mDX550GOmizQ3fIaCyM4AaVJx3ZAbj/JBQ1Ns0R8uMQ YqFpU/zjCEAvvvN13p4Epi54NmB3spa2eV/VVlZk1OGfPuCHdptSGPVpMjbCLEA0xOH2 wBhA== X-Gm-Message-State: AOJu0YxgJ6aqkRwhhSpYFFhxnLZ+7aZfwLUL5arAmpffzYPmpCTlbMN7 byLqeG9IhhAqX6t1uHSvJL/Tq/TAB248wNNfy77Irjn+8SEh282zcXgI1VCo7A== X-Gm-Gg: AY/fxX5z1JroWlVeOiQAzuRaWfP0aJ1xrMR4LJkiFS9CGkHIAsAVqjgB8qrog+imlo1 6CGbR7O1sdiHofsCamf5BZBXjuzyNhtOcv5F2YF4+Ctip+WftFNDONcOcbNQb0uk5hY1rIcAhLp /d7KTOhRWHolYyh8yqoWqMqriQMY9u43tXx5Z+KH/KIYKqzQpUsetFn+NtzfDF+/04jH8wsJhYw u6EwRgQWfy5S3h9LAaWsR4Yr/8ExOfkzABlOfpkf6L2yb8jBTPRaKuCjCEvdPpx7yEQSmzftKYb 71gcMKZld4efH80mRU8Dnk/YZlmBsJmKhbpnoFZFO7DsFOG4wqmeoUL0qaxx+Ws4rwkYYfQbaw3 a0wQyeVNiZUQE4IBSTWKqY0EPyhcuMEukduiOBWh4WzQwQhY3/Ou8J60CsdShCmv3+6BYc4aKUX 8bQZv9IMzBc44PYdkkv5pgGffgxUDCrAM0N3wOM+NrAD7+5GQ= X-Google-Smtp-Source: AGHT+IGP0RlcbH6B51E4gUQr9lms/bASy/ev9myKb2Pge5/0qaudZx6Y5nDprfAtitoyBMJRghw5LA== X-Received: by 2002:a17:906:fd8d:b0:b73:9aa5:8782 with SMTP id a640c23a62f3a-b8426a43d3amr274144466b.9.1767701441213; Tue, 06 Jan 2026 04:10:41 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:40 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 07/10] bitbake-setup: in tests, refactor the config writer to allow variable sources Date: Tue, 6 Jan 2026 13:10:29 +0100 Message-ID: <20260106121033.3892596-7-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18697 From: Alexander Kanavin This will be used to make configs that use local sources instead of git-remotes. Signed-off-by: Alexander Kanavin --- lib/bb/tests/setup.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 30c8b31e3..438dc0cd8 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -89,21 +89,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) bbsetup = os.path.abspath(os.path.dirname(__file__) + "/../../../bin/bitbake-setup") return bb.process.run("{} --global-settings {} {}".format(bbsetup, os.path.join(self.tempdir, 'global-config'), cmd)) - def add_json_config_to_registry(self, name, rev, branch): + + def _add_json_config_to_registry_helper(self, name, sources): config = """ { "sources": { - "test-repo": { - "git-remote": { - "remotes": { - "origin": { - "uri": "file://%s" - } - }, - "branch": "%s", - "rev": "%s" - } - } +%s }, "description": "Test configuration", "bitbake-setup": { @@ -160,7 +151,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) }, "version": "1.0" } -""" % (self.testrepopath, branch, rev) +""" % (sources) os.makedirs(os.path.join(self.registrypath, os.path.dirname(name)), exist_ok=True) with open(os.path.join(self.registrypath, name), 'w') as f: f.write(config) @@ -168,6 +159,22 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.git('commit -m "Adding {}"'.format(name), cwd=self.registrypath) return json.loads(config) + def add_json_config_to_registry(self, name, rev, branch): + sources = """ + "test-repo": { + "git-remote": { + "remotes": { + "origin": { + "uri": "file://%s" + } + }, + "branch": "%s", + "rev": "%s" + } + } +""" % (self.testrepopath, branch, rev) + return self._add_json_config_to_registry_helper(name, sources) + def add_file_to_testrepo(self, name, content, script=False): fullname = os.path.join(self.testrepopath, name) os.makedirs(os.path.join(self.testrepopath, os.path.dirname(name)), exist_ok=True) From patchwork Tue Jan 6 12:10:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78066 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 C4145CDC18E for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.88589.1767701443846989429 for ; Tue, 06 Jan 2026 04:10:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=grXnKxrl; spf=pass (domain: gmail.com, ip: 209.85.218.44, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b72b495aa81so167841166b.2 for ; Tue, 06 Jan 2026 04:10:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701442; x=1768306242; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rJIQXmnQborxnXi2eTFT8le2aN/8gtl9AvwqxeK31H4=; b=grXnKxrleR2c7E+fXLZs9vBx9sryYDBQBq0i323rfOxeMD9sbvLPbJvt6NT8UYFl5W 8Y3b2nYJHgV4NwvE1Fj2w3unICrMuiix53LpolyqjmWB6ktOAx/DstAlPUt47QPBFULa hRnzNjhEIhgw07a/Dh2U7m+kROcmOLWmMb15UGHeIy7O7ynuaSNNWyv71PUjdXEILB5j +6tpNa6raPCQeLaVH76nYfChAnVvbm4Hh7jJfeRDy1QjLiFE0LT407fUqCQaj8A3a8YX w0nByjW/vXcxoUwRwXL1lEr/7PwRNVaa+pbvh50YpJ23j6XqF/wUYVIdQHVijc+l1nvP thjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701442; x=1768306242; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rJIQXmnQborxnXi2eTFT8le2aN/8gtl9AvwqxeK31H4=; b=Tse4rllR1NLLRWI0CuvfgFqiWw+VUCCbbW92OUIozdGq9rh5BKIVFD1VGIHTJEXvu5 p44sfOHDvmxNoFcXrxIJmfnqSvXjypeza8/SP/YjjxotAl0dafTOep89cAZKAQ8TjAuE tkZFj+d+D/CALIqI+xmdxYqeBgXDkBpT/NkTLtAFlxeeZbEKDSkz7/P5AjEFcVHQ5Ckf WnWIIBRdtba6UTqSLPS0G8jP90FdpRfyDNXebpLpRiPM4hg+7pKIqNN+TIdXgSb651Gz TwPzBhtOrpooy2JZOkeQTR+gH1+VTpjKqgIARRl3BUalZa/jonPoBcRzQeinSDLruMIA GndA== X-Gm-Message-State: AOJu0YzWluy78kwRTNJEg92epwYcePgyrsQ+B13cC/iEirtD5HxRcthf EZlC706YRz9xRQOb8umJlWS8zD1jjjeaIn/DgaMPebpyi/MF8DmOo+tKctkgww== X-Gm-Gg: AY/fxX7cn6Sxz5v+GzDpSLJL4gH3pxpXhhBGTlWVhZabN5H0o1+To9Pl2tQ/O9FlLKi yIVjZu9DEU7kH2NfOFDpPNdTc+qR/aPUjeDqbzGwzUHbmB0uKc1uXlNYZVfanqEEQNmYHUm/EyV +PgNkFsn/tWvctI/ABGHcrfz+JlUBc6L5SQnz0qkaZ5l4wzy92Y7kZBf+Od6PiJ0sfayfYjpXKV 3E+gRaIlhNatSF2v1iLy9z1NUTn6zCv/0v17+O5H3FG5OSAJt2V5HkDqF3TwiwCdkiOFoFlWD7Z hYK6NpnwuMA/IXT0geZDlWLm5UXO5mDDttlZ7bT9mNsvduG5XaZypkHqo51sPX+AZwl30ACV7Lp FGafoNVlve+VBUEYNnf9EqIJDqVBe1Z5cNelHCTc4L9mwMvirV5+rRN0ZvaZDdj2K97HTiu7HnR V+B7mwBcyJW2gQZwKvBcgKp8BWfRp5Bx6lnXIYGWcxN8f47bA= X-Google-Smtp-Source: AGHT+IF9K3qOLp/p0DPonw0DYPrhieDXFqmUZ9yKPEv+rRaPsedjB07NDTBhFm5adlIXlkVeBdGacQ== X-Received: by 2002:a17:907:9301:b0:b6d:7f84:633 with SMTP id a640c23a62f3a-b8426a8398amr256730666b.20.1767701441971; Tue, 06 Jan 2026 04:10:41 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:41 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 08/10] bitbake-setup: symlink json with fixed revisions into layers/ Date: Tue, 6 Jan 2026 13:10:30 +0100 Message-ID: <20260106121033.3892596-8-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18698 From: Alexander Kanavin This makes the file more visible for users, and allows easier checks of layers current content against what was checked out by bitbake-setup (to ensure local modifications aren't wiped out). Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 0d33f0896..06255b112 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -69,11 +69,15 @@ def write_upstream_config(config_dir, config_data): with open(os.path.join(config_dir, "config-upstream.json"),'w') as s: json.dump(config_data, s, sort_keys=True, indent=4) -def write_sources_fixed_revisions(config_dir, config_data): +def write_sources_fixed_revisions(config_dir, layer_dir, config_data): + json_path = os.path.join(config_dir, "sources-fixed-revisions.json") + json_link = os.path.join(layer_dir, "sources-fixed-revisions.json") sources = {} sources['sources'] = config_data with open(os.path.join(config_dir, "sources-fixed-revisions.json"),'w') as s: json.dump(sources, s, sort_keys=True, indent=4) + if not os.path.lexists(json_link): + os.symlink(os.path.relpath(json_path ,layer_dir), json_link) def commit_config(config_dir): bb.process.run("git -C {} add .".format(config_dir)) @@ -344,7 +348,7 @@ def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt" bitbake_config = config["bitbake-config"] thisdir = os.path.dirname(config["path"]) if config["type"] == 'local' else None setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_conf) - write_sources_fixed_revisions(confdir, sources_fixed_revisions) + write_sources_fixed_revisions(confdir, layerdir, sources_fixed_revisions) commit_config(confdir) def int_input(allowed_values, prompt=''): From patchwork Tue Jan 6 12:10:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78068 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 B98DECDC183 for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.88590.1767701444446940170 for ; Tue, 06 Jan 2026 04:10:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E+lNxBlG; spf=pass (domain: gmail.com, ip: 209.85.218.67, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f67.google.com with SMTP id a640c23a62f3a-b79ea617f55so185309366b.3 for ; Tue, 06 Jan 2026 04:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701443; x=1768306243; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nq2HYK3ovBdUnncix2/oKx2HCz3tbzN+EdAxiupZnf4=; b=E+lNxBlGtLOjJ+hTGlTQkhfeOGnGqHm6Qv5w/4r2Kp/q3gP0eNPlThqMWQWMc1O+F9 HyeWuYjxR1MsAHwQR/WuiKmn+HZyvmLqaV1LLokCxoQkcTwI71IIRJNmUlXxyUlb5AV0 XeRBxVUMpTtD9ushx599ODdTwPh/jwMX9ERd8puRZgytFNIR6YSHXXr93kgyyj6DmxW3 1kKU+pcJiNyyp3838j1aScmlNVMtBYESXyhiHfApEPC4OwIGjRwdvTRCkK5qBT7Dvbrt 9gpjCjI1NSipi0PNLI3+y0uit4FyFDe8adKOhWqdlPnWQmcLhWZ33Tk38YM8WGu9M/A+ sqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701443; x=1768306243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nq2HYK3ovBdUnncix2/oKx2HCz3tbzN+EdAxiupZnf4=; b=rR4Vd8ZSIQbHnq18y05SK68U93dXcxkyWKal0sLXujTnUhHz1cyWdj7Hmvj/y7n7D+ WkjJRCeOpN+8gWyPPGrofNOz1gFveDOa6B7mFONETAwawTIjFglKAkKykuqhqy5GC4B9 a+qygP9+20dnQbGs9FPRM2Kz5LObMt/2UZK3F2K59ZKz8BMWdxy4r84o+j5RFns+ar4e iMLWClRthSI/4bYnH0Ez32krck9R7PuVslWfzrrDXDhTW4yTI1bBD3kyiIN8reoIvdum 1RccMNXTHUhZW2qQGVL60Ki2eJNrAkCNyegITZ5X2MrEOTfy2mCEVN2iXEyBLtHraz5c F14g== X-Gm-Message-State: AOJu0YybeUR9nRn+EKYBfwt8h+rxlcy3MgxS2JSsyyqyG+nKw8cdc0GL dRn317fEpGsqpgN2P5UZoQhpiuLYi1YD1JzDpi+dm/Due+ycKhY4G34zJKc3IZXK X-Gm-Gg: AY/fxX6kbH5ukBR7yGhSInR+dMxX+Av91/6Kk3iICSaU3Dw4d8puOsfgPY7Uyv3knMP SSD2hbx70YEGYGHKK/1mZIOCVdrUbn0d0q5bNaRFEybX5sa2HKhTqyAHVQUUkW6knWMrg0oo0vp 1oCjurMebujLSfm+eUmfJRAvrFL71VY3B5PohWmodPNr+jxNmMI49Wjmc5FyxAh2qOb6AAhK+qS 9DbkoQePmwBjXA7ncVttkqzcLWBuoF2XDB7GdxdnLLbZAuMgogmWIcPSBZ6hrnQYp21yFgHHcMb UWIcnFutQYDNrMWEkXo08n/3RvsRBvRpNtvQJion5q7BHTI5l0Vs9pxstO5bf1m5p9iUoaa+1kb FroaShVd1FtsqPmoqTyDpHzsCIXiP291m08Qc6GON0kVaxYAlVMZ9vYWHBZOU+fL052QdZ7b6QB RQJevmA1ATzwDe94CH1FMXb3Sk00Kdm87eOIL9+099pNHz6F+hzH8yA+lkCQ== X-Google-Smtp-Source: AGHT+IHwl7arRnDGmS+jv/9FYqdm/9diIV7IAnT4dzc60Jlwy03imhB9Dka/7avZgPD+rx1LyobrFQ== X-Received: by 2002:a17:906:c101:b0:b77:1b03:66a1 with SMTP id a640c23a62f3a-b8426bc2947mr286645966b.41.1767701442619; Tue, 06 Jan 2026 04:10:42 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:42 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 09/10] doc: document fixed revisions override in bitbake-setup manual Date: Tue, 6 Jan 2026 13:10:31 +0100 Message-ID: <20260106121033.3892596-9-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18699 From: Alexander Kanavin Signed-off-by: Alexander Kanavin Reviewed-by: Antonin Godard --- v2: address feedback by Antonin --- .../bitbake-user-manual-environment-setup.rst | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst index ec1bdeecd..fcffab812 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst @@ -938,3 +938,51 @@ Here is an example file that overrides the branch of the BitBake repository to - The ``sources`` section contains the same options as the ``sources`` option of a :term:`Generic Configuration` file. See the :ref:`ref-bbsetup-section-config-reference` section for more information. + +.. _ref-bbsetup-fixed-revisions: + +Fixed source revisions +====================== + +:term:`Generic Configuration` can set source revisions in ``rev`` to a tag or a branch. +Bitbake-setup will make sure the actual revision will match the tag or branch when performing +initializations or updates, and will capture the revisions in a :ref:`_ref-bbsetup-source-overrides` +file. + +This file is named ``sources-fixed-revisions.json`` and is available in ``layers/`` +under the :term:`Setup` directory (as well as under ``config/`` for backwards compatibility). +It can be used to keep record of what was checked out when using configurations that do not +specify exact revisions. + +Also, as it is an override file, it can be combined with the original configurations +to initialize a setup in a reproducible way that guarantees an exact, never-changing +set of revisions, by using the ``--source-overrides`` option of the +:ref:`ref-bbsetup-command-init` command. + +For example if the original configuration had specified only a master branch +for a source:: + + "bitbake": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.openembedded.org/bitbake" + } + }, + "branch": "master", + "rev": "master" + } + + +the override will contain the exact revisions:: + + "bitbake": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.openembedded.org/bitbake" + } + }, + "branch": "master", + "rev": "720df1a53452983c1c832f624490e255cf389204" + } From patchwork Tue Jan 6 12:10:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 78065 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 B033BCDC17E for ; Tue, 6 Jan 2026 12:10:49 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.88573.1767701445162486617 for ; Tue, 06 Jan 2026 04:10:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dPIRajwV; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-b8018eba13cso156538366b.1 for ; Tue, 06 Jan 2026 04:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767701443; x=1768306243; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wh4vsNd2YWbF65A76nR6MsWBgJh6ychYbzThMUvzcGI=; b=dPIRajwVDqkEiCzEVjXdUodA66eLGgQW84LpYjk7tA7RxLoBq6o8nW0LKuGEAfBa1x EcT2svOkhCmARHT3WrnQ9REvEH0US8xSrmZYY1WZi9O9yq5jshLnukmrmIp3y2DqynEn 5ttFHfAH/Xz0pKMusXgn8URDuaUZxJr6bXoO4ONKc8D1BleiOPvLHfEtPG2sjcFQTqgc 6szqXR9Fh1wXFEqcp7foAbOO7M22keXYaWo8w0/erGI2SXxNuJhaPq8TuSpMWv2xJhe2 +An/pzprEI/RTFG1tTR0iTKECoqw5S12V7KrmY4JOFGKvsz3R0VcUVldBvBu2pa8mt2E z6PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767701443; x=1768306243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wh4vsNd2YWbF65A76nR6MsWBgJh6ychYbzThMUvzcGI=; b=xGylZ29XFBp3mxLlm/Evetun3uAbiiNobaEKWIuLJK2GipXVKST20ZoROTtwiIndSY w2V2XIAdl3NduVQ8vutNM8on84OnjxNczn3z5wb2EBauwQDeir0dFnkMW8qN/x/PN4cW 0UVlyCBrg2yondbND6TYT17oTNjXeMiA5yLZqS1PNUFHDZ6sYil0Zy76iHAmc8v45B9O N4GwEowchLiJGWfyLOW/04Lc7i7WiFbA8PBS6Mv24RL00049DYUYYOoeIledlsl+LsTM 6H8f1ygNuK1xd2jww/RSIt+wlkep62/Mp9SfT+uHEeyYJdoYeW1Bs8DxSQzAaa8W2eHY oa7g== X-Gm-Message-State: AOJu0Yzi2C3xFUJGumRh8La3l2M8Da4ES/a9ngvGMh34F9dqM+7Yp4Vt 84OKavD00ZEM5YKbIuOn+m8ky3nvTT2K0Y9jCpU4L0NZO2XU+k10bPyhX0Cp/Q== X-Gm-Gg: AY/fxX4Dz9QaYrgsdvUiVDd2Ja7YAsOgqCM7N6Oz4mzbT8XlJoYLo+KA5ddTCByGasA QgyO3ZN9HlSSEwK9Smroba4kJsWqxLkeTZpSDFRfgo0a6IJ0cHXXG0/O1qOfEDaLQfDhfMIs3SK 9rfJBMTlVkNrGZ2RoU/RWG/x/mcELrC4GbEpjEvIkCMJfPVq0aRFOWg+BlaMSNIQ2KoGP/fyB4S g0P4FYK7GLUfqUpXfApkzCjhbG4IiDRj620I0tQ+IEEPPugBkNrc21SQDnhiyIwPyj+JlNAYI0A RtIcN+Hn5hUc+xtPQcFbyRPmwtQ/SdX51ZTeuI3w1/5WZL96e9rEElzzuV2YGv3K9qcq+dCCjM8 wHTz8NaPq6V/Pmpngp01+QHImH+VByVibV9aTIyct3zunVlHfzIT/sPe6Jvhw86Esxd7op1pc88 r7wLJAEAbM8wX3HFOuvTqfgb0ctUGOFKrOCiRVc+yMVo8Vbu6vg5XYlWWNPA== X-Google-Smtp-Source: AGHT+IFo0uflpDT5Oz9curKQLoWjDxHc0m3rBa+uLT9Bqz6JXsstND4EDGHuOr2diW29Zrsy8xtMNQ== X-Received: by 2002:a17:906:d551:b0:b84:200d:15b5 with SMTP id a640c23a62f3a-b8426bb8790mr319155966b.31.1767701443328; Tue, 06 Jan 2026 04:10:43 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8429fdf4e7sm223329466b.0.2026.01.06.04.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 04:10:42 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 10/10] bitbake-setup: correct (and test) several scenarios in layer checkout Date: Tue, 6 Jan 2026 13:10:32 +0100 Message-ID: <20260106121033.3892596-10-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260106121033.3892596-1-alex.kanavin@gmail.com> References: <20260106121033.3892596-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 06 Jan 2026 12:10:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18700 From: Alexander Kanavin There were untested scenarios in layer updates which did not work properly. The most serious of them is updating a remote layer which had user-made local modifications (e.g. newly made local commits or simply edited files without a commit). Bitbake-setup relies on git fetcher's unpack operation which simply wipes it all out. Yes, the user should've used -L option to symlink a local clone from elsewhere; this doesn't help when their work is gone. The commit adds a function that checks if such modifications have been made, and a code that moves the layer into a backup location if the function returns true. I considered asking the user what to do (similar to bitbake config handling), but this would've resulted in a half-updated, possibly broken layer set which ultimately just would be more confusing. The above check is a part of a broader logic block that handles already existing sources, and in particular addresses another issue: when a local source replaces a git remote or another local source, this scenario failed with 'file exists' errors (thanks to Anibal Limon for spotting that). In this case the original symlink or source tree is removed before the new one is unpacked from git or symlinked as a local source. Adjust commit_config() to allow updates with no changes to configs: this can happen when local modifications to a layer are undone and the original layer commit is unpacked. Add tests for all of this: both transitions between remote and local sources, and ensuring that layer backups do happen when that is expected. Signed-off-by: Alexander Kanavin --- v2: squash in an additional fix that was previously sent separately: bitbake-setup: read fixed revisions json from config dir, not from layer dir The file (or symlink to it) is present in layer dir only if the build was set up by a newer version of bitbake-setup, and otherwise there will be a 'file not found' error. Reading it from config dir maintains compatibility with setups made by previous iterations of bitbake-setup. --- bin/bitbake-setup | 34 +++++++++++++++++++--- lib/bb/tests/setup.py | 65 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 06255b112..38c1d4d36 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -81,7 +81,7 @@ def write_sources_fixed_revisions(config_dir, layer_dir, config_data): def commit_config(config_dir): bb.process.run("git -C {} add .".format(config_dir)) - bb.process.run("git -C {} commit --no-verify -a -m 'Configuration at {}'".format(config_dir, time.asctime())) + bb.process.run("git -C {} commit --allow-empty --no-verify -a -m 'Configuration at {}'".format(config_dir, time.asctime())) def _write_layer_list(dest, repodirs): layers = [] @@ -93,7 +93,7 @@ def _write_layer_list(dest, repodirs): with open(layers_f, 'w') as f: json.dump({"version":"1.0","layers":layers}, f, sort_keys=True, indent=4) -def checkout_layers(layers, layerdir, d): +def checkout_layers(layers, confdir, layerdir, d): def _checkout_git_remote(r_remote, repodir, layers_fixed_revisions): rev = r_remote['rev'] branch = r_remote.get('branch', None) @@ -117,6 +117,17 @@ def checkout_layers(layers, layerdir, d): logger.plain("Making a symbolic link {} pointing to {}".format(dst, src)) os.symlink(src, dst) + def _has_local_modifications(r_name, r_path): + fixed_revisions = json.load(open(os.path.join(confdir, "sources-fixed-revisions.json"))) + rev = fixed_revisions['sources'][r_name]['git-remote']['rev'] + status = bb.process.run('git -C {} status --porcelain'.format(r_path))[0] + if status: + return True + diff = bb.process.run('git -C {} diff {}'.format(r_path, rev))[0] + if diff: + return True + return False + layers_fixed_revisions = copy.deepcopy(layers) repodirs = [] oesetupbuild = None @@ -130,10 +141,25 @@ def checkout_layers(layers, layerdir, d): r_local = r_data.get('local') if r_remote and r_local: raise Exception("Source {} contains both git-remote and local properties.".format(r_name)) + + repodir_path = os.path.join(layerdir, repodir) + if os.path.lexists(repodir_path): + if os.path.islink(repodir_path): + os.remove(repodir_path) + elif _has_local_modifications(r_name, repodir_path): + timestamp = time.strftime("%Y%m%d%H%M%S") + backup_path = repodir_path + '-backup.{}'.format(timestamp) + logger.warning("""Source {} in {} contains local modifications. Renaming to {} to preserve them. +For local development work it is recommended to clone the needed layers separately and use 'bitbake-setup init' with -L option to use them.""".format( + r_name, repodir_path, backup_path)) + os.rename(repodir_path, backup_path) + else: + shutil.rmtree(repodir_path) + if r_remote: _checkout_git_remote(r_remote, repodir, layers_fixed_revisions) if r_local: - _symlink_local(os.path.expanduser(r_local["path"]), os.path.join(layerdir,repodir)) + _symlink_local(os.path.expanduser(r_local["path"]), repodir_path) if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')): oesetupbuild = os.path.join(layerdir, repodir, 'scripts/oe-setup-build') @@ -344,7 +370,7 @@ def merge_overrides_into_sources(sources, overrides): def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt"): layer_config = merge_overrides_into_sources(config["data"]["sources"], config["source-overrides"]["sources"]) - sources_fixed_revisions = checkout_layers(layer_config, layerdir, d) + sources_fixed_revisions = checkout_layers(layer_config, confdir, layerdir, d) bitbake_config = config["bitbake-config"] thisdir = os.path.dirname(config["path"]) if config["type"] == 'local' else None setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_conf) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 438dc0cd8..5ff489cbe 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -175,6 +175,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) """ % (self.testrepopath, branch, rev) return self._add_json_config_to_registry_helper(name, sources) + def add_local_json_config_to_registry(self, name, path): + sources = """ + "test-repo": { + "local": { + "path": "%s" + } + } +""" % (path) + return self._add_json_config_to_registry_helper(name, sources) + def add_file_to_testrepo(self, name, content, script=False): fullname = os.path.join(self.testrepopath, name) os.makedirs(os.path.join(self.testrepopath, os.path.dirname(name)), exist_ok=True) @@ -413,7 +423,6 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) sums_after = _conf_chksum(f"{setuppath}/build/conf") self.assertEqual(sums_before, sums_after) - # check source overrides, local sources provided with symlinks, and custom setup dir name def _check_local_sources(custom_setup_dir): custom_setup_path = os.path.join(self.tempdir, 'bitbake-builds', custom_setup_dir) custom_layer_path = os.path.join(custom_setup_path, 'layers', 'test-repo') @@ -421,6 +430,60 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertEqual(self.testrepopath, os.path.realpath(custom_layer_path)) self.config_is_unchanged(custom_setup_path) + # Change the configuration to refer to a local source, then to another local source, then back to a git remote + # Run status/update after each change and verify that nothing breaks + c = 'gadget' + setuppath = self.get_setup_path('test-config-1', c) + self.config_is_unchanged(setuppath) + + json_1 = self.add_local_json_config_to_registry('test-config-1.conf.json', self.testrepopath) + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("update --update-bb-conf='yes'") + _check_local_sources(setuppath) + + prev_path = self.testrepopath + self.testrepopath = prev_path + "-2" + self.git("clone {} {}".format(prev_path, self.testrepopath), cwd=self.tempdir) + json_1 = self.add_local_json_config_to_registry('test-config-1.conf.json', self.testrepopath) + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("update --update-bb-conf='yes'") + _check_local_sources(setuppath) + + self.testrepopath = prev_path + json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("update --update-bb-conf='yes'") + self.check_setupdir_files(setuppath, test_file_content) + + # Also check that there are no layer backups up to this point, then make a change that should + # result in a layer backup, and check that it does happen. + def _check_layer_backups(layer_path, expected_backups): + files = os.listdir(layer_path) + backups = len([f for f in files if 'backup' in f]) + self.assertEqual(backups, expected_backups, msg = "Expected {} layer backups, got {}, directory listing: {}".format(expected_backups, backups, files)) + + layers_path = os.path.join(setuppath, 'layers') + layer_path = os.path.join(layers_path, 'test-repo') + _check_layer_backups(layers_path, 0) + + ## edit a file without making a commit + with open(os.path.join(layer_path, 'local-modification'), 'w') as f: + f.write('locally-modified\n') + test_file_content = "modified-again\n" + self.add_file_to_testrepo('test-file', test_file_content) + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("update --update-bb-conf='yes'") + _check_layer_backups(layers_path, 1) + + ## edit a file and make a commit + with open(os.path.join(layer_path, 'local-modification'), 'w') as f: + f.write('locally-modified-again\n') + self.git('add .', cwd=layer_path) + self.git('commit -m "Adding a local modification"', cwd=layer_path) + out = self.runbbsetup("update --update-bb-conf='yes'") + _check_layer_backups(layers_path, 2) + + # check source overrides, local sources provided with symlinks, and custom setup dir name source_override_content = """ { "sources": {