From patchwork Mon Apr 6 20:24:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85365 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 009BAFB516E for ; Mon, 6 Apr 2026 20:24:58 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.64392.1775507090673394121 for ; Mon, 06 Apr 2026 13:24:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=QQw6C7GB; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1329275-20260406202447545c94bad40002070a-xeavrq@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20260406202447545c94bad40002070a for ; Mon, 06 Apr 2026 22:24:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=7PSgRWOmR8JcsODRbLUsEIQe9zRpa7KzJLaBPRpZOsA=; b=QQw6C7GBlIuKfMREGVgs0sWpiy2Jg1fT/c6NkePSI8fsHT0rn6KvdoTVkkn9H7d4LbJRuI sgIlyECAYh0s4XllxfsORrxQySruqHZUQQbN6FAS6vGlf7I/EWFJqHpGraVUzBeUgmHLHsX5 EbHwj9ZFachX2HN7wOZpv3Zmd6t/995iyJ7OdpvvWCpMxtGD8MItHH4L+iaE1kNomGFxbVOJ zlJOwGMHEXULNwVleRNmBqwYNp2i0tJvALsSuaBNJ7YxXIAoatWh2ojS6IRMDQ+AUgecgc4T GsgbESqPXkL1cwA7EPxSBpdxr9Z7U+5hAPiqqusdorSOwRHJjCK4wH2g==; From: AdrianF To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/4] bitbake-setup: update vscode workspace always Date: Mon, 6 Apr 2026 22:24:02 +0200 Message-ID: <20260406202430.1856836-2-adrian.freihofer@siemens.com> In-Reply-To: <20260406202430.1856836-1-adrian.freihofer@siemens.com> References: <20260406202430.1856836-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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 ; Mon, 06 Apr 2026 20:24:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19332 From: Adrian Freihofer Update the vscode workspace file with the current build directory, even if the configuration in the registry has not changed. This allows to keep the workspace file up to date when the build directory is changed manually. Signed-off-by: Adrian Freihofer --- bin/bitbake-setup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index c006a059c..5a3394092 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -956,6 +956,11 @@ def build_status(top_dir, settings, args, d, update=False): return logger.plain("\nConfiguration in {} has not changed.".format(setupdir)) + if update: + workspace_file = os.path.join(setupdir, "bitbake.code-workspace") + if os.path.exists(workspace_file): + bitbake_builddir = os.path.join(setupdir, "build") + configure_vscode(setupdir, layerdir, bitbake_builddir, os.path.join(bitbake_builddir, "init-build-env")) def build_update(top_dir, settings, args, d): build_status(top_dir, settings, args, d, update=True) From patchwork Mon Apr 6 20:24:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85364 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 2DDD2FB5166 for ; Mon, 6 Apr 2026 20:24:57 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.64176.1775507090673320993 for ; Mon, 06 Apr 2026 13:24:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=PmzF4qXw; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-1329275-202604062024473c187b9bfa000207fd-4jgcn3@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202604062024473c187b9bfa000207fd for ; Mon, 06 Apr 2026 22:24:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=DDqoMWbdccu8DrjHsvhAhVMQKnV9eOlEoj7xM3rMKPM=; b=PmzF4qXwnEfuKv7PPFZZoAsU+Erh0N1tes8UTlwz5XWXg597WUubBbzQ43PtK3x+mbs+wd vLFx35x2l/lhZ8bTD//HgTYD3MKHvw6rm1V6wrx0AJ98drthsHjjZIyMifiVXXLEjl50WOWS XKCG3UTS8JEIWBNvujTYHEZa8zU0/GJOumtIvAUEzebo8NM9wZBN7QQEzVoRIY6oAGv4oKyp qeYC74T0Ii+Ne0YteRSuN9n7rXFxRWKFL6DfehJp1mrdmamdJ4+H0pKovC3CuN9iwEWLSRqh v53pPRI44E+dzquHmNT5+hmImup2nOjyHCkth/SCAsVBwdN4+5EGkNFw==; From: AdrianF To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/4] bitbake-setup: add support for extra-remotes in layer sources Date: Mon, 6 Apr 2026 22:24:03 +0200 Message-ID: <20260406202430.1856836-3-adrian.freihofer@siemens.com> In-Reply-To: <20260406202430.1856836-1-adrian.freihofer@siemens.com> References: <20260406202430.1856836-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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 ; Mon, 06 Apr 2026 20:24:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19336 From: Adrian Freihofer Support an easy way to configure the contrib git remotes in checked-out layer repositories. Add an 'extra-remotes' property to the git-remote source definition. Extra remotes are added to checked-out repositories via 'git remote add' after checkout, but are not used for fetching or change detection. This is useful for contrib push URIs (e.g. SSH push mirrors) that should not affect how bitbake-setup fetches or tracks upstream changes. Each extra remote entry supports: - 'uri': the remote URI (required) - 'optional': if true, the remote is excluded by the default 'non-optional' filter (useful for remotes that require special access like SSH keys); failures when adding any extra remote are always reported as warnings A new --extra-remotes-filter option is added to 'init' and 'update': - 'non-optional' (default): configure only non-optional extra remotes - 'all': configure all extra remotes including optional ones - 'none': skip all extra remotes - comma-separated names: configure only the named remotes Signed-off-by: Adrian Freihofer --- bin/bitbake-setup | 82 ++++++++++++++++++++++++++++++--- setup-schema/layers.schema.json | 22 +++++++++ 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 5a3394092..9962a25f1 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -152,6 +152,27 @@ def add_unique_timestamp_to_path(path): break return path_unique +def _filter_extra_remotes(extra_remotes, filter_value): + """ + Filter the extra-remotes dict according to --extra-remotes-filter. + 'non-optional' -> return only entries where optional is False (default) + 'all' -> return all entries including optional ones + 'none' -> return empty dict + otherwise -> treat filter_value as a comma-separated list of allowed remote names + """ + logger.debug("_filter_extra_remotes: filter='{}', candidates={}".format(filter_value, list(extra_remotes.keys()))) + if filter_value == 'non-optional': + result = {k: v for k, v in extra_remotes.items() if not v.get('optional', False)} + elif filter_value == 'all': + result = extra_remotes + elif filter_value == 'none': + result = {} + else: + allowed = {n.strip() for n in filter_value.split(',')} + result = {k: v for k, v in extra_remotes.items() if k in allowed} + logger.debug("_filter_extra_remotes: selected={}".format(list(result.keys()))) + return result + def _get_remotes(r_remote): remotes = [] @@ -167,7 +188,41 @@ def _get_remotes(r_remote): return remotes -def checkout_layers(layers, confdir, layerdir, d, rebase_conflicts_strategy='abort'): +def _add_extra_remotes(extra_remotes, repodir_path): + if not os.path.exists(os.path.join(repodir_path, '.git')): + logger.debug("_add_extra_remotes: skipping {}, no .git entry found".format(repodir_path)) + return + existing = bb.process.run('git -C {} remote'.format(repodir_path))[0].split() + logger.debug("_add_extra_remotes: existing remotes in {}: {}".format(repodir_path, existing)) + for remote_name, remote_data in extra_remotes.items(): + uri = remote_data['uri'] + try: + if remote_name in existing: + bb.process.run('git -C {} remote set-url {} {}'.format(repodir_path, remote_name, uri)) + logger.plain(" Updated extra remote '{}' -> {}".format(remote_name, uri)) + else: + bb.process.run('git -C {} remote add {} {}'.format(repodir_path, remote_name, uri)) + logger.plain(" Added extra remote '{}' -> {}".format(remote_name, uri)) + except bb.process.ExecutionError as e: + logger.warning(" Skipping extra remote '{}': {}".format(remote_name, e)) + +def _apply_extra_remotes(r_name, r_data, layerdir, extra_remotes_filter): + r_remote = r_data.get('git-remote') + if not r_remote: + logger.debug("_apply_extra_remotes: skipping {}, no git-remote".format(r_name)) + return + extra_remotes = r_remote.get('extra-remotes') + if not extra_remotes: + logger.debug("_apply_extra_remotes: skipping {}, no extra-remotes defined".format(r_name)) + return + extra_remotes = _filter_extra_remotes(extra_remotes, extra_remotes_filter) + if extra_remotes: + repodir = r_data.get('path', r_name) + _add_extra_remotes(extra_remotes, os.path.join(layerdir, repodir)) + else: + logger.debug("_apply_extra_remotes: all extra-remotes for {} were filtered out".format(r_name)) + +def checkout_layers(layers, confdir, layerdir, d, rebase_conflicts_strategy='abort', extra_remotes_filter='non-optional'): def _checkout_git_remote(r_remote, repodir, layers_fixed_revisions): rev = r_remote['rev'] branch = r_remote.get('branch', None) @@ -236,6 +291,7 @@ bitbake-setup init -L {} /path/to/repo/checkout""".format( if r_remote: _checkout_git_remote(r_remote, repodir, layers_fixed_revisions) + _apply_extra_remotes(r_name, r_data, layerdir, extra_remotes_filter) if r_local: _symlink_local(os.path.expanduser(r_local["path"]), repodir_path) @@ -458,9 +514,9 @@ def merge_overrides_into_sources(sources, overrides): layers[k] = v return layers -def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt", init_vscode=False, rebase_conflicts_strategy='abort'): +def update_build(config, confdir, setupdir, layerdir, d, update_bb_conf="prompt", init_vscode=False, rebase_conflicts_strategy='abort', extra_remotes_filter='non-optional'): layer_config = merge_overrides_into_sources(config["data"]["sources"], config["source-overrides"]["sources"]) - sources_fixed_revisions = checkout_layers(layer_config, confdir, layerdir, d, rebase_conflicts_strategy=rebase_conflicts_strategy) + sources_fixed_revisions = checkout_layers(layer_config, confdir, layerdir, d, rebase_conflicts_strategy=rebase_conflicts_strategy, extra_remotes_filter=extra_remotes_filter) 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, init_vscode) @@ -866,7 +922,7 @@ def init_config(top_dir, settings, args): bb.event.register("bb.build.TaskProgress", handle_task_progress, data=d) write_upstream_config(confdir, upstream_config) - update_build(upstream_config, confdir, setupdir, layerdir, d, update_bb_conf="yes", init_vscode=args.init_vscode) + update_build(upstream_config, confdir, setupdir, layerdir, d, update_bb_conf="yes", init_vscode=args.init_vscode, extra_remotes_filter=args.extra_remotes_filter) bb.event.remove("bb.build.TaskProgress", None) @@ -943,7 +999,8 @@ def build_status(top_dir, settings, args, d, update=False): logger.plain('\nConfiguration in {} has changed:\n{}'.format(setupdir, config_diff)) if update: update_build(new_upstream_config, confdir, setupdir, layerdir, d, - update_bb_conf=args.update_bb_conf, rebase_conflicts_strategy=args.rebase_conflicts_strategy) + update_bb_conf=args.update_bb_conf, rebase_conflicts_strategy=args.rebase_conflicts_strategy, + extra_remotes_filter=args.extra_remotes_filter) else: bb.process.run('git -C {} restore config-upstream.json'.format(confdir)) return @@ -952,11 +1009,14 @@ def build_status(top_dir, settings, args, d, update=False): 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, rebase_conflicts_strategy=args.rebase_conflicts_strategy) + d, update_bb_conf=args.update_bb_conf, rebase_conflicts_strategy=args.rebase_conflicts_strategy, + extra_remotes_filter=args.extra_remotes_filter) return logger.plain("\nConfiguration in {} has not changed.".format(setupdir)) if update: + for r_name, r_data in layer_config.items(): + _apply_extra_remotes(r_name, r_data, layerdir, args.extra_remotes_filter) workspace_file = os.path.join(setupdir, "bitbake.code-workspace") if os.path.exists(workspace_file): bitbake_builddir = os.path.join(setupdir, "build") @@ -1239,6 +1299,14 @@ def main(): else: parser.add_argument('--setup-dir', required=True, help="Path to the setup") + def add_extra_remotes_filter_arg(parser): + parser.add_argument('--extra-remotes-filter', default='non-optional', metavar='FILTER', dest='extra_remotes_filter', + help="Control which extra-remotes are configured in checked-out repositories: " + "'non-optional' (default) configures only extra-remotes that are not marked as optional; " + "'all' configures all extra-remotes including optional ones; " + "'none' skips all extra-remotes; " + "a comma-separated list of remote names configures only those named remotes (e.g. 'contrib,upstream').") + parser = argparse.ArgumentParser( description="BitBake setup utility. Run with 'init' argument to get started.", epilog="Use %(prog)s --help to get help on a specific command" @@ -1269,6 +1337,7 @@ def main(): help='Symlink local source into a build, instead of getting it as prescribed by a configuration (useful for local development).') parser_init.add_argument('--init-vscode', action=argparse.BooleanOptionalAction, default=bool(shutil.which('code')), help='Generate VSCode workspace configuration (default: %(default)s)') + add_extra_remotes_filter_arg(parser_init) parser_init.set_defaults(func=init_config) parser_status = subparsers.add_parser('status', help='Check if the setup needs to be synchronized with configuration') @@ -1282,6 +1351,7 @@ def main(): help="What to do when a layer repository has local modifications that prevent " "an in-place update: 'abort' (default) aborts with an error message; " "'backup' renames the directory to a timestamped backup and re-clones from upstream.") + add_extra_remotes_filter_arg(parser_update) parser_update.set_defaults(func=build_update) parser_install_buildtools = subparsers.add_parser('install-buildtools', help='Install buildtools which can help fulfil missing or incorrect dependencies on the host machine') diff --git a/setup-schema/layers.schema.json b/setup-schema/layers.schema.json index f42606941..65b5ae5c7 100644 --- a/setup-schema/layers.schema.json +++ b/setup-schema/layers.schema.json @@ -67,6 +67,28 @@ } } }} + }, + "extra-remotes": { + "description": "Additional named git remotes to configure in the checked-out repository. These are not used for fetching or change detection, only added via 'git remote add'.", + "type": "object", + "patternProperties": { ".*" : { + "description": "An extra git remote", + "type": "object", + "additionalProperties": false, + "required": [ + "uri" + ], + "properties": { + "uri": { + "description": "The URI for the remote", + "type": "string" + }, + "optional": { + "description": "If true, the remote is excluded by the default 'non-optional' filter. Useful for remotes that require special access (e.g. contrib push URIs with SSH keys).", + "type": "boolean" + } + } + }} } } }, From patchwork Mon Apr 6 20:24:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85366 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 DE330FB516A for ; Mon, 6 Apr 2026 20:24:58 +0000 (UTC) Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.64393.1775507090702900807 for ; Mon, 06 Apr 2026 13:24:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=NZ9Gv4fQ; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.226, mailfrom: fm-1329275-202604062024485dbdc6ef3200020716-n6pqsj@rts-flowmailer.siemens.com) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 202604062024485dbdc6ef3200020716 for ; Mon, 06 Apr 2026 22:24:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=rl8rcG6D68q5Fi35Q1eJX8FzZ9P+QwLQCGzlYrWUx54=; b=NZ9Gv4fQPzLnNR63IM/YY4vkmEzgsVu1zGDqZ/fzY6LpxLZVse5MZFVxyUDbbelGWdzMzK lVRJ0P43F7Gz3fNCfLnNpvJskEjD/d7+jGvjk8RgY+ty1EcCRpQq8zbg4fG5RSQ6GGzQh0Hw Ymmhh0LAd6fppir+PRlKRzwVhjTYeOtjl6gvBI31DF9uBq9ijBHIy+oHK71l0yQLRkWur2SU zuxxgdkXfcKjm1bVDtpRfuIt+4s4KXDbHtdsk14oVKxb59YNVUAH7DjEedhT8PLncYPYKtGy Z6X4m/Ur4Lnmi4qakD9njH1AutksQJnxjyqReOC45bNkCFn/G8MsIF3A==; From: AdrianF To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/4] bitbake-setup: add contrib extra-remotes to default-registry configs Date: Mon, 6 Apr 2026 22:24:04 +0200 Message-ID: <20260406202430.1856836-4-adrian.freihofer@siemens.com> In-Reply-To: <20260406202430.1856836-1-adrian.freihofer@siemens.com> References: <20260406202430.1856836-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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 ; Mon, 06 Apr 2026 20:24:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19333 From: Adrian Freihofer Extend the default-registry configurations with 'contrib' extra-remotes for the bitbake, openembedded-core, and meta-yocto layer sources. The contrib remotes point to the SSH push mirrors on push.openembedded.org and are marked optional=true, meaning they are excluded by the default 'non-optional' filter and must be explicitly requested via: bitbake-setup init --extra-remotes-filter all ... bitbake-setup init --extra-remotes-filter contrib ... Signed-off-by: Adrian Freihofer --- .../oe-nodistro-master.conf.json | 16 +++++++++++-- .../oe-nodistro-whinlatter.conf.json | 16 +++++++++++-- .../configurations/poky-master.conf.json | 24 ++++++++++++++++--- .../configurations/poky-whinlatter.conf.json | 24 ++++++++++++++++--- 4 files changed, 70 insertions(+), 10 deletions(-) diff --git a/default-registry/configurations/oe-nodistro-master.conf.json b/default-registry/configurations/oe-nodistro-master.conf.json index 5aa148d42..c06f5602a 100644 --- a/default-registry/configurations/oe-nodistro-master.conf.json +++ b/default-registry/configurations/oe-nodistro-master.conf.json @@ -5,14 +5,26 @@ "git-remote": { "uri": "https://git.openembedded.org/bitbake", "branch": "master", - "rev": "master" + "rev": "master", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/bitbake-contrib", + "optional": true + } + } } }, "openembedded-core": { "git-remote": { "uri": "https://git.openembedded.org/openembedded-core", "branch": "master", - "rev": "master" + "rev": "master", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/openembedded-core-contrib", + "optional": true + } + } } }, "yocto-docs": { diff --git a/default-registry/configurations/oe-nodistro-whinlatter.conf.json b/default-registry/configurations/oe-nodistro-whinlatter.conf.json index 7b183ae1c..b8d5b1eca 100644 --- a/default-registry/configurations/oe-nodistro-whinlatter.conf.json +++ b/default-registry/configurations/oe-nodistro-whinlatter.conf.json @@ -10,7 +10,13 @@ } }, "branch": "2.16", - "rev": "2.16" + "rev": "2.16", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/bitbake-contrib", + "optional": true + } + } } }, "openembedded-core": { @@ -21,7 +27,13 @@ } }, "branch": "whinlatter", - "rev": "whinlatter" + "rev": "whinlatter", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/openembedded-core-contrib", + "optional": true + } + } } }, "yocto-docs": { diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json index 58d379648..bb7c53e10 100644 --- a/default-registry/configurations/poky-master.conf.json +++ b/default-registry/configurations/poky-master.conf.json @@ -5,21 +5,39 @@ "git-remote": { "uri": "https://git.openembedded.org/bitbake", "branch": "master", - "rev": "master" + "rev": "master", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/bitbake-contrib", + "optional": true + } + } } }, "openembedded-core": { "git-remote": { "uri": "https://git.openembedded.org/openembedded-core", "branch": "master", - "rev": "master" + "rev": "master", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/openembedded-core-contrib", + "optional": true + } + } } }, "meta-yocto": { "git-remote": { "uri": "https://git.yoctoproject.org/meta-yocto", "branch": "master", - "rev": "master" + "rev": "master", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/meta-yocto-contrib", + "optional": true + } + } } }, "yocto-docs": { diff --git a/default-registry/configurations/poky-whinlatter.conf.json b/default-registry/configurations/poky-whinlatter.conf.json index 4827ebe11..ba82c5ed6 100644 --- a/default-registry/configurations/poky-whinlatter.conf.json +++ b/default-registry/configurations/poky-whinlatter.conf.json @@ -10,7 +10,13 @@ } }, "branch": "2.16", - "rev": "2.16" + "rev": "2.16", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/bitbake-contrib", + "optional": true + } + } } }, "openembedded-core": { @@ -21,7 +27,13 @@ } }, "branch": "whinlatter", - "rev": "whinlatter" + "rev": "whinlatter", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/openembedded-core-contrib", + "optional": true + } + } } }, "meta-yocto": { @@ -32,7 +44,13 @@ } }, "branch": "whinlatter", - "rev": "whinlatter" + "rev": "whinlatter", + "extra-remotes": { + "contrib": { + "uri": "ssh://git@push.openembedded.org/meta-yocto-contrib", + "optional": true + } + } } }, "yocto-docs": { From patchwork Mon Apr 6 20:24:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 85363 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 3CD13FB5168 for ; Mon, 6 Apr 2026 20:24:57 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.64178.1775507090714686345 for ; Mon, 06 Apr 2026 13:24:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=gTuaRyoZ; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-1329275-202604062024487d9059058c000207bb-gnr_91@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202604062024487d9059058c000207bb for ; Mon, 06 Apr 2026 22:24:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=XH4IOArApZVDEVG2LUg6sWwiGV8EVXDZ+HOpIVnxhiE=; b=gTuaRyoZSqNt+Dov3DG6Kpk4kLbnDorEgY9ktGbQD/u6A9O/quBUMpT1g8T89CwVrXcSx1 SK5EHyk5cDKC9Ih23S1IG52PG+2Sqp+vr+FM2z2N9Txi7iS+foydis56Cl4G3WEgWLVG7sfC fPV0iCaQ2/iCNvDBVx9aOy75SMf3/cO7N8Z/2X8FZaC/Mga4gRtxvvA8tznkxwdpdZpAUCWB u/E4dFQsx1UDykbCi+nBB9W2Mw8p4Ure4zxpGTRqT3F6fE3mA+Q3Xk0XAeoX5M2BsEXuKkKo dN8eFSUMdYdgys40pHVe4mOIdsg0mFgCMuuQD5cngnZk5XHLPbSuwJ+g==; From: AdrianF To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/4] bitbake-selftest: setup: add test_extra_remotes Date: Mon, 6 Apr 2026 22:24:05 +0200 Message-ID: <20260406202430.1856836-5-adrian.freihofer@siemens.com> In-Reply-To: <20260406202430.1856836-1-adrian.freihofer@siemens.com> References: <20260406202430.1856836-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer 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 ; Mon, 06 Apr 2026 20:24:57 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19335 From: Adrian Freihofer Test the extra-remotes feature added in the preceding commit: 1. Default 'non-optional' filter: the non-optional remote is added to the checked-out layer, the optional one is skipped. 2. --extra-remotes-filter=all: both optional and non-optional remotes are added. 3. --extra-remotes-filter=none: no extra remotes are added. 4. --extra-remotes-filter=: only the explicitly named remote is added. 5. update re-applies extra remotes and calls 'git remote set-url' when the URI of an existing remote changes. Signed-off-by: Adrian Freihofer --- lib/bb/tests/setup.py | 107 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 638d56d3b..7b259cc97 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -726,3 +726,110 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertEqual(f.read(), 'conflicting-upstream\n', "re-cloned layer must contain the upstream content after conflict backup") del os.environ['BBPATH'] + + def test_extra_remotes(self): + """ + Test that extra-remotes are added and filtered correctly during init and update. + + Covers: + 1. Default 'non-optional' filter: non-optional remote added, optional skipped. + 2. --extra-remotes-filter=all: both optional and non-optional remotes added. + 3. --extra-remotes-filter=none: no extra remotes added. + 4. --extra-remotes-filter=: only the explicitly named remote added. + 5. update re-applies extra remotes and updates the URI of an existing remote. + """ + if 'BBPATH' in os.environ: + del os.environ['BBPATH'] + os.chdir(self.tempdir) + + self.runbbsetup("settings set default registry 'git://{};protocol=file;branch=master;rev=master'".format(self.registrypath)) + self.add_file_to_testrepo('test-file', 'initial\n') + + # Two local repos used as extra remote targets (remote_a = initial URI, remote_b = updated URI) + remote_a = os.path.join(self.tempdir, 'extra-remote-a') + remote_b = os.path.join(self.tempdir, 'extra-remote-b') + for remote in (remote_a, remote_b): + os.makedirs(remote) + self.git_init(cwd=remote) + self.git('commit --allow-empty -m "Initial commit"', cwd=remote) + + # Config with one non-optional and one optional extra-remote + sources_both = ''' + "test-repo": { + "git-remote": { + "remotes": {"origin": {"uri": "file://%s"}}, + "branch": "master", + "rev": "master", + "extra-remotes": { + "required-remote": {"uri": "file://%s"}, + "optional-remote": {"uri": "file://%s", "optional": true} + } + } + } + ''' % (self.testrepopath, remote_a, remote_b) + self._add_json_config_to_registry_helper('er-test.conf.json', sources_both) + + def get_remotes(layer_path): + return self.git('remote', cwd=layer_path).split() + + # 1. Default filter 'non-optional': required-remote added, optional-remote skipped + out = self.runbbsetup("init --non-interactive er-test gadget") + setuppath = self.get_setup_path('er-test', 'gadget') + layer_path = os.path.join(setuppath, 'layers', 'test-repo') + remotes = get_remotes(layer_path) + self.assertIn('required-remote', remotes, + "non-optional extra remote must be added with the default 'non-optional' filter") + self.assertNotIn('optional-remote', remotes, + "optional extra remote must be skipped by the default 'non-optional' filter") + self.assertEqual( + self.git('remote get-url required-remote', cwd=layer_path).strip(), + 'file://' + remote_a) + self.assertIn("Added extra remote 'required-remote'", out[0]) + + # 2. --extra-remotes-filter=all: both optional and non-optional remotes added + self.runbbsetup("init --non-interactive --extra-remotes-filter=all --setup-dir-name er-filter-all er-test gadget") + all_layer = os.path.join(self.tempdir, 'bitbake-builds', 'er-filter-all', 'layers', 'test-repo') + remotes = get_remotes(all_layer) + self.assertIn('required-remote', remotes) + self.assertIn('optional-remote', remotes) + + # 3. --extra-remotes-filter=none: no extra remotes added + self.runbbsetup("init --non-interactive --extra-remotes-filter=none --setup-dir-name er-filter-none er-test gadget") + none_layer = os.path.join(self.tempdir, 'bitbake-builds', 'er-filter-none', 'layers', 'test-repo') + remotes = get_remotes(none_layer) + self.assertNotIn('required-remote', remotes) + self.assertNotIn('optional-remote', remotes) + + # 4. --extra-remotes-filter=: only the explicitly named remote added + self.runbbsetup("init --non-interactive --extra-remotes-filter=optional-remote --setup-dir-name er-filter-named er-test gadget") + named_layer = os.path.join(self.tempdir, 'bitbake-builds', 'er-filter-named', 'layers', 'test-repo') + remotes = get_remotes(named_layer) + self.assertNotIn('required-remote', remotes) + self.assertIn('optional-remote', remotes) + + # 5. update re-applies extra remotes and updates the URI of an existing remote + sources_updated = ''' + "test-repo": { + "git-remote": { + "remotes": {"origin": {"uri": "file://%s"}}, + "branch": "master", + "rev": "master", + "extra-remotes": { + "required-remote": {"uri": "file://%s"} + } + } + } + ''' % (self.testrepopath, remote_b) + config_path = os.path.join(self.registrypath, 'er-test.conf.json') + os.remove(config_path) + self._add_json_config_to_registry_helper('er-test.conf.json', sources_updated) + + os.environ['BBPATH'] = os.path.join(setuppath, 'build') + out = self.runbbsetup("update --update-bb-conf='no'") + del os.environ['BBPATH'] + + self.assertEqual( + self.git('remote get-url required-remote', cwd=layer_path).strip(), + 'file://' + remote_b, + "update must call 'git remote set-url' to update the existing remote to the new URI") + self.assertIn("Updated extra remote 'required-remote'", out[0])