From patchwork Fri Jan 2 19:34: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: 77942 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 A7706FA3758 for ; Fri, 2 Jan 2026 19:34:50 +0000 (UTC) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11799.1767382487859401759 for ; Fri, 02 Jan 2026 11:34:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MDEtNFjA; spf=pass (domain: gmail.com, ip: 209.85.218.43, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b83122f9d78so967498266b.0 for ; Fri, 02 Jan 2026 11:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382486; x=1767987286; 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=MDEtNFjAz4JchuSVMx+IcQHQKSn8+LUNF2Zh3VTGdyYnk4KoupW9tTtPtU0I/9kQK+ ljIbBJqMoPAf/rFMrhw1pWP8HhskFVjNqKuj0GEuolDZRF3Bu1/UIPxhEWEvpgSWj9ns Q/p4J479eqzveLoLVbW/EtoTRO9KOavqo4m1ajc/Qgot2sEfEiCJbKDbqb6Jzy3J3Yjf iL90xcCABFV0qGei+7QqfUtm+T7WBlhOqjVcH9pKbFHsA086alJknr5O/X3evsIt2YlM Wn/ZVhqT1pjD3HzfPj2G0oupE2TuRwUDBEqqjxAjqqzHT5RkUEkdplbSnext2mS/HHg1 rsMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382486; x=1767987286; 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=c/jJVEOLfKzYaqTgdvFlt9jsXaVtU875D2ZAbjDitQa97lWEyhmUZ/by+odU+6WueK xCm8rYW4ePzoXHmtP5xdkagE2v4x/mNVp7C0niaCyrLt9TDZZlmoxqvU7zNwQAuI7+ac Gm4dBxJWqCA9M5saUmFyTkj3oqYTBfVphHFuPbo5xHyKeOCLZInx1OEAE13FBAN4QuR0 3ZgAoOFslBMNHuXbpAMCTH3YyFuc2sQA970K+c+P9N5FNOpqK4XK1/adcz2qIjZUIz7K zW3Rtuh+3xPnjO+tOcaaWiK08F1rwArMYI9VFChnwXXbfcE/9y3hfw4kCTAhSmily1X4 fPlA== X-Gm-Message-State: AOJu0Yy/QcqOCP/baotq7PstQQXqSjpR7OXV8B+XUy4+2fVsvsFsRIzu dg4AaI5Gnx23YHsIJH7MLtKSH/ci6mPkpqC+u4YGWP5bhLutcXAmBAg1Vu0QsQ== X-Gm-Gg: AY/fxX5GU/8KkPnLtVjfF3o27lNoCkY0STtKPwxSl3czZUy0pGwaLJG6n6uV9jZUJb3 lokT9s1d8iy4g3XMytxdIw0A4jvQKv1LjOcZ1fAeHLljFFtdMEYJfqp+iLIEh9EioQsrOPQVcpm dBz6WNQwjgadFqOoQnqPpjUTiliNk1kgpgOl5Bdm6b910HyyDTopRQueL/eIXIJDlAX750xzu8a 5pmWC1VbbDKnw1k//luSHv27bpoS3t9YxMLsBGI+ommOFKKov/1BcQ6Qhnzgiy+NU+5vta6hB3o brkTRlILx+PeR9qwYoaQmfo0Nan8PUCFfzjDUm4YgQX27y3GBW4FM3NzKftRz/F0dAOFxzBZRnM 8foBlccyYiEBmGCkbcs5CIA77CKRkNyML28EpydPpqhI57tGjnlSTCeMpG79HR7SDPmKBPeYInh 9mC5hTXyPWfZpCT8M4JuyOUmQQ6QMi9jEteRhjHadDZDwiYLU= X-Google-Smtp-Source: AGHT+IGSH2PIt2HTl0JHpnAE4yeRAm6wzvKuztInMHqOMzE4YdBJm0iJW7L3/DGNRPlFzelFppWAyA== X-Received: by 2002:a17:906:c145:b0:b79:f984:1557 with SMTP id a640c23a62f3a-b8037180307mr4441955666b.46.1767382485988; Fri, 02 Jan 2026 11:34:45 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:45 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 01/10] bitbake-setup: move the local source tests to the end Date: Fri, 2 Jan 2026 20:34:28 +0100 Message-ID: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:34:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18671 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 Fri Jan 2 19:34: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: 77944 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 AB6F2FA375A for ; Fri, 2 Jan 2026 19:34:50 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11904.1767382488530939037 for ; Fri, 02 Jan 2026 11:34:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=foDmoSqK; spf=pass (domain: gmail.com, ip: 209.85.218.42, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b7ffa5d1b80so1571945266b.0 for ; Fri, 02 Jan 2026 11:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382487; x=1767987287; 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=foDmoSqKilxAOZHGkChiwwoUxAhkI6ukH3g/W4gJcLvFhWFr3Mcjg1OFO+oX414LVk zx9PDujVGdBu5PFN81CG1j8ApgGvwcr1WTCsAxRML+cWNTVekqW5zc1nXpZVIjZ7ExDy cpUPaDnvQ1L/xTiBpEJYev1feiDN4nutwCbnkAIqWgg8dwlZfouice7p+PuyWyZFT7Ky Nid+9z/aajJNmq5mAHU9d+lpMGCfIQ4UN2nXfAg/Yr6kzq9EF4d8HeSCaycSgnbFvREG COQm6Q91toQmnTtvyKQsVHFYr330VEAP8N4I3nDA3CIfj7TgBuDB7BTmKw9/ElKkFhj4 14yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382487; x=1767987287; 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=SxEJ20EdMbRjO6ECHmYb3t3fPL2kddg04Hn2ZVnwMfT5emRBJ8ohNYXRaUPa61OXUV gNIKpbKRAiEpkKq959/jFj42qttC7rNaa9oxTf47Y6t9C94Eb0eAi13266TIuVSoTB3/ s9ODdXPuNkQwVGtltPpaLA6E8+gq/98/gLpdUtArwsthG7lMqTdqG+pVTurryINnWgnD tR8pM2YMLzvcM8TzYJpwdnK4qLAFb8PnpnVnwIiDf1ChZ28V9BNVkMlM2/Tf1h9Rhg1a NWtid5symb9l3+UKTWSvBAde5QQ5piNZ1v2KjkPJO0pvZ32Fjapn7jhxxRr9I+tZMA7n 6yiQ== X-Gm-Message-State: AOJu0Yx5uLJHh2BNN+Szt29cNvJSUMEG/+qbIs4GOIyMcjo86f7G+CBF Vfw1jsBz7aCMd3hbMwYnemQaqbXOiw8VNacdcyktyGR72R33K1x0JrIqnyldGw== X-Gm-Gg: AY/fxX46wAKrAlBME9oOKPpkqu7CjsDcEE8mTpELDcVaTeEakVCKBSwT4OAChseYiPR mQg0+Kp80AOVvo8cH2r8OhDoBgJ5hs/h9xk/rBycXRiIPo1a/+Ee79eN3YTkXoFJWphl4nNjZW3 3L+dasMw+XLO/ewLKEa/hEtHVTZlPxDK6R+pcpiIBig+iGd7kc3P5etNS+jhkl2oqKFuakLPrZm IyL0y9zsn0MSFRVMXcD/Pnmlbw/Pln/eaEpc7fvVlndpnMrHsR5zF2qe5NSZo/Mr3kOuoP5wzIR n4cmA+ZvoeB65SHfiFOqlYLOn8Iy8NDxzlwSr+/TFVZDFdaF3bf7UapqyLtmsVV08rsZQM/gerB 6zkte6A4eTlgwctHUlKLMH8i+R2D8soBxcokvWt1uVeop9sQqeRdVNJJwIpAb3o7PQdNXRSmkIJ gnz5CUfFu76lBMbHV9gIcJND8W5yAwu4f1E1W+jm8VDaI4z6M= X-Google-Smtp-Source: AGHT+IESK+vbX4JLTmXcZ24czRS/nmEDEvF7CIZDWm8sM8kzDWu7uijfNwk+nvjXqrunokiKS8DuiA== X-Received: by 2002:a17:907:97c7:b0:b79:d24b:474d with SMTP id a640c23a62f3a-b8036f56569mr4694162066b.16.1767382486640; Fri, 02 Jan 2026 11:34:46 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:46 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 02/10] bitbake-setup: consistently add configuration commits at the end of updates Date: Fri, 2 Jan 2026 20:34:29 +0100 Message-ID: <20260102193438.2960561-2-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:34:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18672 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 Fri Jan 2 19:34: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: 77943 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 A8355FA3753 for ; Fri, 2 Jan 2026 19:34:50 +0000 (UTC) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11801.1767382489209437185 for ; Fri, 02 Jan 2026 11:34:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Z9sQT3PD; spf=pass (domain: gmail.com, ip: 209.85.208.53, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-64b9b0b4d5dso20998674a12.1 for ; Fri, 02 Jan 2026 11:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382487; x=1767987287; 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=Z9sQT3PDwju9I8/KA7aRzPzW3a6d/zTRFVlNuDJEh0wRHiYKwXhDoJwjJ4T6ljD1ro uca1Qp+sqiyExDxRF9TmuLuBmdp9w8cz3xwLBvz2BVQDhlY0q/lcgSscUnRraDq5Ntkn Kgvkr4GEfM1w3U3hA890kqj/rXPoorXyZPGpwIi8XB4Yc6Fn3gXTrgAGMCkKEso6D8vX q3l06McxLagm8J2qnrMUDDV6Orf4+0qOD3DvORQbP0ABg8xoKT3yCR3S8/V6xFVta2Rj u5gEAMHimCdDGKkphwPaRavo2G6+909dI+hn+i4lt3TKJ/DCjY7zmimJvpPVCfv6huGD /ozA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382487; x=1767987287; 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=mVIjzc53Y9k/jdORzyq/0R5XdxBjemeqbmvFmpIGRDDv62q2jsQQr/c+yjRSjUIcwj OBw3FgIgFcDa6KA6iNIGoyFBBKN8jvxyFqorccblyB1k+kcvqD68VNqKj87aPh2r7CCp ehv7DDsekO8Y8HtLPbmnueaWtLkLtOjtPBKUALdLDOCUZrhY+C4pObt+q9ZYYkCfYp6o 7MYMzG/lqigXT0k/b0hrbul6P/lqMDr+euP4Etmlg3hfaywX4dwcFBQzHFW7Q3HD9l9r mj9mk1mDH23tE7agO/ow0QyWWLFwpuQmOauRu4oOhLXeVOELANzeAflIaIqPRtLHFP2+ MjaQ== X-Gm-Message-State: AOJu0YzzJ6Y/GS/3FEgy7wWzVjfA3XduyWxWDY7PxTOeUKAVPPuaP/ob mrr5u9LnFyKrjt1ueUvxtV03om4c7I64tzXG3blXU9sbSIW3PpghJzHFioSu/Q== X-Gm-Gg: AY/fxX65oSpHN7bUcXFwnC2uI02IRtBRjNZGUtWPwqYcObOYrO0rv49s8kSqbNajZBk i15rDP7nC5KBFxLTC2OM6pzkVW3xzZr5ZWrJiS00w5DbM0ZIrLi5KfNwzIRUWhOT0uTmHogXjPZ qLf6IAYarp1GuTydry0wBaQuDYFYs0VOxhOmU0k8EOplS5Wjk4cTtEEitqN6W1vuvtqC2C0w9Zi NzVMDm0uDjHBTFKsGAwYwW2yQbKRutrPvUvCGEKPEeRxABoab5zSzC7MiMNYaNM/8R/GOR5kQus 2upA+yZt9DW8645Dl6Nxor19ffqv6prgCcZ7IXZwe5PKqpj7Rj2Y5hL7aIiqE373UzhY4OIO9Zu IifKfdVKUtXKvhfdqyCDXFUWYlX2NMACH8rTCCjrmaWcZHjkow55hVp+B2E11+B4ngksyJ6ZiFv U/S1tLlRJRrJwbTBgw32nK+kLdkcRsConXZFRJ88bHnH7F/a8= X-Google-Smtp-Source: AGHT+IGGlZctVEygRsV6hj8xDJ1dbfj60suJXudEMr3Pj8T+tbNgKg9C85+ucmhi9n5ytYqL425PfA== X-Received: by 2002:a17:906:6a17:b0:b77:1d75:8b78 with SMTP id a640c23a62f3a-b8037180282mr4815537866b.53.1767382487307; Fri, 02 Jan 2026 11:34:47 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:46 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 03/10] bitbake-setup: test after every update that config hasn't changed Date: Fri, 2 Jan 2026 20:34:30 +0100 Message-ID: <20260102193438.2960561-3-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:34:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18673 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 Fri Jan 2 19:34: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: 77945 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 B5E26FA375C for ; Fri, 2 Jan 2026 19:34:50 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11905.1767382489871464207 for ; Fri, 02 Jan 2026 11:34:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=en6gzKGP; spf=pass (domain: gmail.com, ip: 209.85.218.42, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b8018eba13cso1932440166b.1 for ; Fri, 02 Jan 2026 11:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382488; x=1767987288; 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=en6gzKGPshF3o2PML4Pozz+Cidugi3Nn2l39MYFABcqU9kzuWAtQ0ZrjMGM2H+UvW9 11096Qc6vXimxgbwNfW3MlYIsz3Yy3sLZvqbhafp+Yu8Ii3dIaq/PdVtK++KihwZTwSd lqmE0hI89zFdPNCdPgJOsSbHsdt3qIxuI5m6WRJ72VNrU2ymls9mIIek/aK+U8IOAWYy EJu9ztO9I3aAWlT/vC+GD1hkMN4GueDS+mGvr40lIOo6O87EcwqH71nkSRhF0/JuR5hC L9z+fmy741g1V97Uuxt4q25P0RZDf4eUyAAzronuAUST6MBst+DnbGGF4knn+7KuLpX7 wIFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382488; x=1767987288; 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=E0/2IIN1FE2eP3g5KRwKwEjt/n1Kx61AOlr1zZahkcEijCJJ9kF8XJeJwZ7/wnWpd2 La77NK/90YLZFQU4CPcOXiHal2ER/HD5b/Va4KFQLFf2rhkcfeGlfyYr+hQEFTHsIOIO X5zBy6ZBJ9f9R7W/yyTDx7EBJYcVzeRFtBN9HMTAp/chx6tWt8K4ATYI3nJ9STfCgweo 9QF4eJF0t2VNuAHvUKCo4qkRiAEf1+MM7JKnVpmbzRBh97Ua73XaZGqx/ixdB6tmLUqt 53/rOoBhmLKjMbIxGtlVcxMe13PZC2DG/r6aE2r5y5z8WC3DjWzD6yKSv2czQewsYSDB 3x3Q== X-Gm-Message-State: AOJu0YwD4hJjUGfT3dUEY+Pg8CxnBKzYK2kMbVHw/PikXdZb7GJdmyMR GQqJqSQZUohv/bQUwtb1B/cW3/NMI2tXVZcN6fQ4zV/tvLOyO/VXnjPRYGBI6Q== X-Gm-Gg: AY/fxX5Ea7Nbs9gXC57mm24Gvfs+wFq9ymSKUM80taTtukccBONCrFSocNPoBMY9NAO 8nTAYDuEiXsAy40yWiyVyHiIx0oQucojQ9e+RGwboDyAmblHjO125+bXSSdsOblLloocf+z15UV 2a8iQeuwdWDyZl5nyzDLfr5AR9oPRkOvoD9cHJqeS25oG+KXSH/wUCgWOVo5yWlvtZiCH5SkT2C H/a3Bcu7VDnjJL1Gfsjv3V8bxjcTiWYhl+HKIRyjHnRHR+o0F+hS91bKfglxGwj5wTe2VYp+VXS 8h/fIH1oDncxWzz36yFNRvH64qy1uKvbq5ZCFaj/4CweAUpXDHZb3tITx3nXEj/ExQ6ym0vdhm0 fj4HbXHOpPGCBn9xK8eN0/1YEYXJfuh7IFmyrE9TS56CG8tZM3TMFtcjul3aY6mlLJy9shgXSUb vt3y7x2KUK/luNdMP3oM4hMZ3guvXV/Z8bF/2vjgfnhFBlUpI= X-Google-Smtp-Source: AGHT+IF3bxZ0gMo0EPyHg7kgGh1LyuJdKWXyvwd0peRXdmGbkqanHBBGfke25nkh580QVsz+P1ZdwQ== X-Received: by 2002:a17:907:3cd5:b0:b83:95d7:9d50 with SMTP id a640c23a62f3a-b8395d79ffbmr1273917666b.38.1767382488074; Fri, 02 Jan 2026 11:34:48 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:47 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 04/10] bitbake-setup: consider overrides when checking whether layers have changed in 'status'/'update' Date: Fri, 2 Jan 2026 20:34:31 +0100 Message-ID: <20260102193438.2960561-4-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:34:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18674 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 Fri Jan 2 19:34: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: 77949 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 A5028FA375C for ; Fri, 2 Jan 2026 19:35:00 +0000 (UTC) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11802.1767382490643626598 for ; Fri, 02 Jan 2026 11:34:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HmDMhU+Z; spf=pass (domain: gmail.com, ip: 209.85.218.49, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-b79ea617f55so2368843366b.3 for ; Fri, 02 Jan 2026 11:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382489; x=1767987289; 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=HmDMhU+Zu5oruUZupQLIlo6dgRY6JRUJUQ/krEJP0rBQM8iuOIEqKHPV55Nylj+1Ff y28iULJDlFOUXnYiOmy5JeTM4ykVxfTRydcg1FSiDofTH09f7e1gIwxEIA3Ua3xgm/24 5XJYzVpjVW4+LT93HCfP7XtVQTYh5WXHDHYamuUads8L0hSIdmtKKBhb5PVw7Bxb5N92 dH2dV/X2ckwBv6AVbWhL73MXeeZLegMx17FJvRIr2pLY91BzNC0wtV1eKajIV5hCOdbH 611Eq5/2h4YndZzdoYchwnANAwsbrrtct75Hc16JAUMCqu+EoWGR1IZ2+wO9GhMB/iQl 0kNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382489; x=1767987289; 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=QjYaBvUkCdjp1CL6JBR+ieY8rdMfsbuZWECDoTyw2FO9Gkq6Qi409/meOaU6jLqkGY FATwZiOURFGfJ5ou2DvudMhP2zfS+xTMNW6E6iW4iGLxA5ckVnRgtO5WoTZ6HGDaTTh+ 4SRCwbjP3yWGYGhYYC0vv47OonWtD84Sg5HuFs+rsszjtRcEIeQkyHXKLlMdO/djq/1A EfTU6llP6f2PuMVzn3s3HYMgSJ+HMCnRJmpH56GghOHGHzy/qUWAcG0oJdS11a5UkAqS Kd1Hwk0urMmOR+6iEb9yqnHD90fTNvTHojQKPWcPUYE5HU74HkgGKjctoUo6a/xsnBZU UzQQ== X-Gm-Message-State: AOJu0YwlWlYcz+eNZob6JI0PBOPK2/6SWW7nLtexpNUiGdTRNbd7s36b roLYhQaAlfdszdOd0Mec8y6wtcsXxgFN/piuN/rqe9jP/cPbVfds8gDIoLiX2A== X-Gm-Gg: AY/fxX5NQDi7CH23VN8bm+EOB0MKbZIhlhaUoy89JbIP32ItZXWADFw2MXPzL7hgM1W lGTyT9/LbDDtLq6fcZmgtbQnl7BKHkV8z37T0XbmlAKnAHqKCkmX7LizzoKFywMPOa187So8/Rp GJQT/ONBa4S4HSpnOedGBoe3FMoLZ60VbuQFENe+Y3lmLz+i4qZB5kr3NsRCqtAnowXBeniWjc7 d6aBRZcfvyxnSTYVZBg/4C+5lPGxaQ1DvGyp2QtQfTcv5FQG6bfT1nq5OLphP6K2tfyyvn8QaV2 fOnsjNdY2BtQQa96gNNTydw6od87YLpWOF+xtsVXO4hH8sXyl6EOqhbuF0+myemoBmQNmLqcD4y v5GJUBsZklAOvWIJMRZU6un6tkm8m2wCU9zFjJ/K8Xkk8IbSUrIEggWAvWual7TzQepml6REdss wS1Nddgj2l05v/K/wGWXzmFAlxa/0gQle7ALfCeb51/eEZCL4= X-Google-Smtp-Source: AGHT+IHPzYgnJFR2BQQGcqk9fHOJEgeunBEF6KYYJ0BPFM8R0c57LnhXC3D8w43vtL1NNO6y5m9lfg== X-Received: by 2002:a17:907:2da6:b0:b83:95c7:f87b with SMTP id a640c23a62f3a-b8395c7ff41mr1264577966b.37.1767382488874; Fri, 02 Jan 2026 11:34:48 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:48 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Anibal Limon , Alexander Kanavin Subject: [PATCH 05/10] bitbake-setup: fix are_layers_changed when use local source Date: Fri, 2 Jan 2026 20:34:32 +0100 Message-ID: <20260102193438.2960561-5-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18675 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 Fri Jan 2 19:34:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 77947 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 B24FCFC6160 for ; Fri, 2 Jan 2026 19:35:00 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11906.1767382491318692373 for ; Fri, 02 Jan 2026 11:34:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pu/Z35So; spf=pass (domain: gmail.com, ip: 209.85.218.42, mailfrom: alex.kanavin@gmail.com) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b83b72508f3so278967166b.2 for ; Fri, 02 Jan 2026 11:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382490; x=1767987290; 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=Pu/Z35SoUejoFWINmPkWCg9AYMZYg/W94WFgyoHXky7DapVtnL9OBlL0rfeSLU+Cgp 3vCT/vNqhClWzQhyuYkEqLDL3XG+UUkHSjg9+A9wMbPq44TMJu2UUCJkSKkW7aGff4G4 2isT4oOM0Ik0fajiKSIpfjHQsf6+AsRfPPXA3QdZhrj+yCWHUdn0E9DYcBVKUFANGYeN 7L5kPNDuiO9c3PnG/sEp3F8cRSZHtEcE+dE/2xll0s+lQe0wkNpxAC0MI3py5dd2kMtO wFV4SXNnK2dHiPYZngdeVytPonmzmcb5MqvShwFleTUYdO3A9uMordKl7OGB7Lf9c4sR STPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382490; x=1767987290; 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=dhqPAThqaENwWw9XjSn40mjsZiUopJNoVZNNl5S0CNsJdgAdk/O4G5jcMtkniWMw+8 C45wSRUnCaYyTOA4a741mcsr/2/mzZY2mQ9TAEt6I/F5XZ6zP6ZrEvDUR1Uwe0VfQcs7 l0p30Ym2ZksD5xPnI3GunArdfkSMt4risilpofSQkfYK7qUiS6bueeDdqu6vE7Ixp786 EwcGHWWGmb8mJZKlDHZhbzfzsHccxxzC6Rm9KvTb6IXmOIdlIcbaLYRSf1usjky20OOH O8W1fDkN+wC7+c9X41sp1Ys/xuDceLd87x8oJkvCxN05xN2y5zygEejhevp8AXPmGevB Xupg== X-Gm-Message-State: AOJu0YzJ8TrresRxBzcO44aD8wzyb1XD0spWHAQnRl893SdOZiDSLhAo gkz/2RWvlfCz5ZDZbDrX8eFKilbgbUy2bibjERqeh/PJ5+T5v1UizcVr0wufxA== X-Gm-Gg: AY/fxX7drQYsoWy3g2ji5y7y38804KaLS9mPutmLth2Ywv1qbPFauLmMFgENLtbUnmM cDwh4H3BZkexH10n3gQ93PBsjcfHJffuQFbL7W7Zgzsr8Bzm6csn2K6J0DW5ydcpRssqaI5VzH5 Rb2NUPLnhGB44kARWPalJvn2Zr4ZguYGeMpuWAgJnvA+O3+g43RlmR5UeJHWuO6qulYcvpQGiVb x3U4ECU5acYoB0hjsUiiHQ2Vgylaeai35W7C9cg43r4aaBBUEnCOVOKC5PHiuS1OzbLcB2emwHg i7fFLH0IUGRAlO1bs3XxtVPCEn9QIRvmr9RTVfLladvQpHnAS9HH3ugi5G/6anU3kYDV7E7Qd1v ZFq1MieGQ6HvIjQ84gJ7OUxx4GfboDxu0bwGcAo+20IdpMrRpTqrqMdm8+Jm6E10Lk/cZXvPlw2 Jtuu2UNXSGom7M8OWemSpB0RN4vpasXFdI3c11RfMLBsm+97k= X-Google-Smtp-Source: AGHT+IE1ejcZE5wWWE05CAnMyfpzReTON4S5H7JBqfjH2Kn6xRjj3rxyMsdgUSLafgyEvM/kmImsAQ== X-Received: by 2002:a17:906:23e9:b0:b80:6ddc:83f8 with SMTP id a640c23a62f3a-b806ddc8a5emr2945325166b.32.1767382489504; Fri, 02 Jan 2026 11:34:49 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:49 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 06/10] bitbake-setup: extend the tests for local sources with status/update sequence Date: Fri, 2 Jan 2026 20:34:33 +0100 Message-ID: <20260102193438.2960561-6-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18676 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 Fri Jan 2 19:34:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 77951 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 BE946FC6162 for ; Fri, 2 Jan 2026 19:35:00 +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.11803.1767382492075954463 for ; Fri, 02 Jan 2026 11:34:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GX3a5KWM; 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-b79af62d36bso2065308966b.3 for ; Fri, 02 Jan 2026 11:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382490; x=1767987290; 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=GX3a5KWMFJ8H1/TjwtwRsibDogQuXe4N2kV7lAllEDphuKgTG8sBTg0w2BmXZQ9Aim IjNLcVUJhBvhXqs978MuV5E1l8W03cs7SQkJUUcxqE76NZ7QY9A/5VPP6l03JAJBVPaN /3x54fX3zI42IfQ6LWegw6vDqF6kpXOeGLVgOOMGVZ5U1joNEioA75vGs37PU8ePOu9q WOLJUQaPEtiaC5BAK/sf9pExU2+L05b/L/Z9Pi5b1UZaXn8TfnCCKTUdl9tFGZzKzNXx mtWnrbs+8PFSGvd5DjWXr8H/OVTyRV36Xx7WGmm9N4MBU4ee5j6LlpeTFurv5g/+DLuD dH/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382490; x=1767987290; 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=LxdrvSlSALDPw5r9Do/20fP3iCO0Ko6HB8hRXaLkdmM/vD+ZNMAt2g9O7cnN0NzQ0d oOxLcjF8omdJBlaxOhBYNPRHlilGDbCf+J2s19bZ81+IyMdlRwrg7asv+J1FGNYueUJG /kAU3CZtfqwaeuXnpB0AHbAb/WXuRJrBchzQR0blGnpPaQGfIoZeWv1Zyq0/55iH5Ows cawwYhzvjO2kLCyhRwZ/4+4QeH2810D/WCCQxw66N/b8yO/ox0JWESSkv9TJcqT0TSNh agyZPPBJX2MWkoarKpfPlrCLCLX/akCsWm/IEjnUIUvVyqH9PgpCodMmapsqNs63sy1U mJCA== X-Gm-Message-State: AOJu0YwPWsD+WfZvdkfb4sUgTaUBQ7Uor3pGdwA3OKExbGFGstEDlxo3 PmRRnemvjMntIMXEBzunol3StgZP4CJXaeCfmFERwbWJXo4xi+RUKo7xYPLabA== X-Gm-Gg: AY/fxX5bBni2ef9cANNlyqQdkqyljVPDK+DnogP0aU7ozl4UqsFpWqnjUBL4gcaF6/U +yXsp+K5ASJ5nrSaDHCpasNIu1ZujtdXZZ+O0thJC/qXM2lhsqgNoItKrOTds/ope19p29xk6wn v32mb8DZv/lY/Cou2sVqcRb+eDRWJgexlE/CU023X3UjtEPITKsknfMCQFiqB4r0ibPbxKGxD19 FFygfsLcA9HmydXlk8+4MblKQXaKzaOrHTkJyU2SViR2YYBAK6lm1QnOICdBubl/UcYYj6J+AhV Z3P7DRNUZw/JltzgFJY29gKkOeD/dNOTy6MnZ6H8ReaPBgOM5Oif8GfmyCMT+0kd00tCWLI1eUM J8zqRwIsW0Isk1P1LWtKxQpBjKMo8ncV0XSHpdXno5SNZQTzk58proIlVOa/c4EtUxtHb+N8K9x 3xUJ3aE5+eNqLaJThCec/8MqSHIjERknWMtqWl9wJvsCskS9c= X-Google-Smtp-Source: AGHT+IGHYNacIfOgt68J9ORSjzn9eGKla1BcEVjHzp6NdJkHGDl95DvqQYut9VQsggMOcuIhdisuaA== X-Received: by 2002:a17:907:9408:b0:b73:6998:7bce with SMTP id a640c23a62f3a-b8037152a19mr4356013666b.33.1767382490150; Fri, 02 Jan 2026 11:34:50 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:49 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 07/10] bitbake-setup: in tests, refactor the config writer to allow variable sources Date: Fri, 2 Jan 2026 20:34:34 +0100 Message-ID: <20260102193438.2960561-7-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18677 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 Fri Jan 2 19:34:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 77950 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 C9610FC6166 for ; Fri, 2 Jan 2026 19:35:00 +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.msgproc01-g2.11908.1767382492732362525 for ; Fri, 02 Jan 2026 11:34:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eCVLCfdX; 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-b728a43e410so2367317066b.1 for ; Fri, 02 Jan 2026 11:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382491; x=1767987291; 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=eCVLCfdXeBuFK2tW02A787y2a4K2A0WifRXOyKtfYYwUmjCrOXSx/+8TtG1Jpg0T9Y 2e8o1kUsUcVqwx7luEubTsgq4JT/hXoEIKZ9qYmRa9ZGNEwuz8mf/C5BAMLz7ZBTO2JI YzTU23dZnyIl4qErEbRwMyL/vEstvNqyqDIgyavZbGJ79rj70wOm0ItMX+caC1lhwgua +JJvXB5A0c6MjPNPIFUr/XB3GfOviwMQedy2zy+B5jKwmkq12qKWHb0V9yX8HR2UjRjP qvmCt9cBtInaVOHNxdgkFLNtlNyaPFG6T4dz6v3DUb17754hOhjxAQNt1kn+MRBXfb7W gPHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382491; x=1767987291; 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=WghxHP/z7+cqIBItePbRw91hA++5CkNqJaQc5SMcAmw8gAItTf41EEYXPwlED1zH4Q rT+S0kVpm7JT1RmEORQO8X3VeqbuoI0a6PHMkz86SvUNVN7Z5iHTwYF2BkWO6AR7qwhV Dy3aqj+5bpuiuNUQS3CYbJ5rRr8yphijo1YRR0LnWuObsZoHrgPTgWqTISSPja/nSm0u W1SGx6WuFaZux3k9/zK1NTdAlIA/WalOpV9l+mSXwwrcziA8yGF6ib9wiscPmZBe/QfF TBEIxM1N9u0EH3bt233zp1X91G1bE8saI7th9OlmB2AxwEdrLwjc1Qd2syMPxBcoLMak 4fcg== X-Gm-Message-State: AOJu0Yw4k7cdZE6QXn541KnQ8I8MLbnjstcmLtaG8jRGF3aqA57Iqq2P S/vEUOzrZ1FU9omIeR3b3VmC5p2eadmuXa+0Cdhpa9soVeYVxscKvs6Wdn4Mmg== X-Gm-Gg: AY/fxX4KGpM7aaaE/6LAYwhw8H6DaiDfuxUL5EKax/ZDLnODPsI1odWOP0uMp4xZJqA 4wSip7QcgqbZwzuqVq6OIYGLQo2Qo5JtSwJkPGbZFV0pb0qEbObUbXLZXh/2fbONB/aRYkw1loh ILMtsdYXjEN4Bz/DfSk9yGlrDW3MjmwHKpxTGpfJtZVzjNXtd6Jo+4zGRv2YeFoCFu4XuKwa9wk Oom/P18V1usaUcM0nPh74STrwk7PMCIA8goC/MB/TVqjnGuxQdhMhYYxo2WPiwrM3YN2p4qnQtc HRUNewOBQU4x0J+qwv1s2qjQfACt5kbE+z3+DhgBV0omfHEIjPkFSQuyDuRsyc4lXMtu1nak7TU ynpTurxB2NuJWxGn3pzqULOi246wC6xEEFIcJBxSQS4dmR9O9kV10Wi8vcrGh1BfW5uctsMvDol aiQICL8QD7OWeje1j3A2YSSWP3f5jn3fZiuZJWRUt3gR+Kg20= X-Google-Smtp-Source: AGHT+IGQguScuA+Cwrn4nxEq7/xag/cWdLpJFdWrSaWfoV1pvzUI/jdqg45J3Dkf20sgIzwj9XfnMQ== X-Received: by 2002:a17:907:2d94:b0:b73:7a44:b4d5 with SMTP id a640c23a62f3a-b8037051a07mr4503718166b.41.1767382490925; Fri, 02 Jan 2026 11:34:50 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:50 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 08/10] bitbake-setup: symlink json with fixed revisions into layers/ Date: Fri, 2 Jan 2026 20:34:35 +0100 Message-ID: <20260102193438.2960561-8-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18678 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 Fri Jan 2 19:34:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 77948 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 B24A0FA375B for ; Fri, 2 Jan 2026 19:35:00 +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.11909.1767382493331681227 for ; Fri, 02 Jan 2026 11:34:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c8Msjthn; 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-b79f8f7ea43so2927953966b.2 for ; Fri, 02 Jan 2026 11:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382492; x=1767987292; 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=al1eK+6nxmcg9F51WnioPT5hkud6ZCJmeW2+a6c7LgQ=; b=c8MsjthnNzwCSC/UiBjs/wbGs9U/VWQrKBP2a1ZVujOdf5EyQBFMXflCcHTa3z5u/l +/hdeA+NB92DLJV3rXMgLsH9YdFK/S/X63+RW30I7I9osy4HmsGbr6nFwJcMED9zYSir lpwJz2e6XTiKfX/1FjVgqQ7UZiXyle6nzkiMH11DsWBcXtzOpxa/S5SBZg+i66ymcZ4d HYmpkFdUbY4RlLjDGDdq8JOzh0BIKa1uI7eJlG2mPiDzGMbUvp3IlPCHzrBlPSMcksQD vDxCviOe8faUBy44qjwf+ZgSghgLjCz/+SlrYAQwTqlPDDq+7K+kBwOwH46Osa8yZ1xH R5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382492; x=1767987292; 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=al1eK+6nxmcg9F51WnioPT5hkud6ZCJmeW2+a6c7LgQ=; b=TQOfCXdnMy7kDxKWNnvVMTnfA94fQH8icF5HLVY5upDycGIzoLNRQ7nO0puHRkYRuf aCP2XuqHMPc1W8jX5qdTeWokLlOLHkw1lqFoIOc7zQi/YOqCDWJpUAAxf0GMJm+oa9Mr gRZ4jqkACLJx/sNpNAE62dH80jwejdo8fMAnDLZs4Vyp+vzvqNZ0aEtgc5dNGai5Tj/B wcnGkqJ387baLuGp3pCXUldU4XQoU5FUcXXImM1yCLv0CeT0FQqIBV0gcKiW8lRHwZGz TMGXP0tY0nM4la9YjO0o1BqpktAUz7LX6FFMlpJ24r1JmivUYAuVnMSkxaS5AWVwXNOU 3ihg== X-Gm-Message-State: AOJu0YyWOb0zMetWieij3iVeHYhFjBkpP1EVR/tRM+MegKVrvFu3ja01 t3rDCKXVdtguYqICpITFl+AMgGjRGr/n3ezSJ4PPoxFP4GmfZBQrvf2cCPv1mlbB X-Gm-Gg: AY/fxX6ELe1hm2pqT2ZmDsVig1BugObRJCX8hoBWUG+nl7GY3yuKDzuwBKfm9wBWB4n RsmPCrnj9xFLeJQLLfuFEXc5QXqbdCL5EqbK75J7xTuiNpxDV0MQ8mZ664ln02WfXzYJlywZMKC lCfJmvO+1SHUGQYt384ny3mRbfrtjGgFMK93VSnq+aYqHODPq2uALPgGSwjmtsYR4sDOCv/JCZn 8zEhgQvnYAmuetkKs0s2APn80e5wABLX7iGJmndOKGCpUwHvJInyuhVebu9uwMkdf9IFrj+MsE1 x0fuu+UMfgDRHCCS4yc6C8GWBlzfBj1bnohM5dTIjoHt28l3rHBNVKX9AsfHyAOY/UvHYBKkxAZ MaOAanr8YxaTMV0UiyiMcWZlZSx/qd35qfcMni8IQFUrXNoO4bMb/Ab1YqMYqaGIa9XCpfylbeB RDOLa70fBzDd+B1a+sQblwM/q8pOsuDc1b9Wtm5WIO4dP5TN8= X-Google-Smtp-Source: AGHT+IHp7k53KUA6emMgsUhoNsOwvndPXt6K+ByKPR6Az3+ddvQFKNwWmimVh1T9dOKZSVjvPApUSQ== X-Received: by 2002:a17:907:26cb:b0:b73:4aa5:35e5 with SMTP id a640c23a62f3a-b8036ecbabbmr4229677266b.7.1767382491549; Fri, 02 Jan 2026 11:34:51 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:51 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 09/10] doc: document fixed revisions override in bitbake-setup manual Date: Fri, 2 Jan 2026 20:34:36 +0100 Message-ID: <20260102193438.2960561-9-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18679 From: Alexander Kanavin Signed-off-by: Alexander Kanavin --- .../bitbake-user-manual-environment-setup.rst | 46 +++++++++++++++++++ 1 file changed, 46 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..68b2ad31d 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,49 @@ 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. + +The file is named ``sources-fixed-revisions.json`` and is available in ``layers/`` +or ``config/`` under :term:`Setup` directory. 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. + +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 Fri Jan 2 19:34:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 77946 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 A4FEAFA3758 for ; Fri, 2 Jan 2026 19:35:00 +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.11804.1767382494116412615 for ; Fri, 02 Jan 2026 11:34:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KubLnmcB; 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-b79d6a70fc8so2169659266b.0 for ; Fri, 02 Jan 2026 11:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767382492; x=1767987292; 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=+zaPOJKSjunT5vNtkItcoKkfSyI6Xkz5e9Ne+wrTQgM=; b=KubLnmcBC25IsX/CcK66ZLW3xwpfm4zXylUsxdzhD5BlzmY/0U7iCKO2OlWNjLYsQ8 UaeSZLJqt7/eOoF57jn2PqCRS8SE5Wzrz8BrXEL3f7o16NG6OfBGuPpkLJM/daVwDSKV bf7l57DHutbnPssIoSxY6OcQV3Wxl02YkAElKji6O0ahVqB05OWD48WUXMF7Q3bJEEiY STIeQQ7couCSjpaKdy1/1SFvpwklFwpxKF9sCPn8QQsEnBnhJcmHPGrvLXEFwkuk83P6 S266LT1VZuYUx3vODKmyQqed22ePDr9NTW6j5vtBP5gksm87725vmg5txZERwwltxX+I E1kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767382492; x=1767987292; 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=+zaPOJKSjunT5vNtkItcoKkfSyI6Xkz5e9Ne+wrTQgM=; b=BQxUxvjMwaTgmdWjawrxb/y19vtxD3VLlkUQrMWo6Ac85cI2AQS97U0noh9iSFDi1W ijBeGdjNhRsl1vLs/xa68DkeTONFE8f6oKWt181pCAtyOM5ZzpgIsXG87MERm07288YY p36DRZlz91fy702rTeXpvXRl33ZQBSk2MiFDJ+ks0zGytkfnUqZRaootI+T0MoQrLWZk kesVzZ732zU6CtLnHIjOh/n4nbF0+G+hnzIj6++3/24yAAMg0oDkcpVopxPxc5HwHO/6 8xiPqAADvFtlr5mvUalAP+4OkWtUatL8g2nNt9wk0VjVyKT9v54oeO284pvgySYwi/2D nIyQ== X-Gm-Message-State: AOJu0YxtR0VCrYkHTFhdw5H/kTSuHOR4l1Pf6vSFFYLBiPYJyHO/Y534 b9uTRK+2WyYIO8wQjRsvqwEKjonY9eWSS75+10Tfrw1R46DfXCHxJ9Wg6JfiWw== X-Gm-Gg: AY/fxX6Yebs29WSK3IS50Ik8tZcninSMxnO3ktEQVl/ErMuXVhyypas3TdtDhnuoNqZ bhIiBu6RJ/1oD2k0dYGEFe1VAdkX06cDsnudJWXl3YxM1Qcegog+cE42FbE9X3nh7t2WxzABdeJ omK2Fvof5EkOipDnVLZqSqGizF6pOm3PCqqyAOsxZEQZakfkCklSzTBxOlhTUGp4REJhOHeCjbr y+JEX3UIvYCI9LZSwY4itACxQipxk54aDiBtEPGqNyLUcl/LkwSLGZ5Ah+n5yZsspG/Cv5hP83l Knp/WQQPFoP3MdwEVgGQ8mSIRxdNdEyKjnaN7wqVFTsjCw/g9ag0D9k3GR8qSz3/A8687ammlQn ui925pSapnyoPzk9qwxlm6lL19wWwfeiQu5KifYmloIulBTEItmCoDhAWMB/UboGf+gbyIcbPxv EgzPs/BOMdM1r61qJ6lso34WnzG318wYZpuSvaW0UjJpOh6r4gvmxoJ2awDg== X-Google-Smtp-Source: AGHT+IEjVIze0sr7iOLE1kW6iqNub2nzQOoz6/zAqSGAMv81AO/rMHgU/1uobm6DrDbA5Rm27NtICg== X-Received: by 2002:a17:906:6a26:b0:b76:3478:7d52 with SMTP id a640c23a62f3a-b803705d9e2mr4185507566b.38.1767382492194; Fri, 02 Jan 2026 11:34:52 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037de11e5sm4645615866b.39.2026.01.02.11.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 11:34:51 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 10/10] bitbake-setup: correct (and test) several scenarios in layer checkout Date: Fri, 2 Jan 2026 20:34:37 +0100 Message-ID: <20260102193438.2960561-10-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260102193438.2960561-1-alex.kanavin@gmail.com> References: <20260102193438.2960561-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 ; Fri, 02 Jan 2026 19:35:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18680 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 --- bin/bitbake-setup | 30 ++++++++++++++++++-- lib/bb/tests/setup.py | 65 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 06255b112..58273e4dd 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 = [] @@ -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(layerdir, "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') 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": {