* [PATCH v4 3/4] bitbake-setup: use URI shortcut for all configurations
2025-12-19 16:12 [PATCH v4 1/4] bitbake-setup: add inline URI Corentin Guillevic
2025-12-19 16:12 ` [PATCH v4 2/4] layers.schema.json: support 'uri' Corentin Guillevic
@ 2025-12-19 16:12 ` Corentin Guillevic
2025-12-19 16:12 ` [PATCH v4 4/4] doc/bitbake-setup: document "uri" property Corentin Guillevic
2025-12-22 10:41 ` [bitbake-devel] [PATCH v4 1/4] bitbake-setup: add inline URI Mathieu Dubois-Briand
3 siblings, 0 replies; 5+ messages in thread
From: Corentin Guillevic @ 2025-12-19 16:12 UTC (permalink / raw)
To: bitbake-devel; +Cc: Corentin Guillevic
Currently, no source has several remotes. So we can replace their entire
structure 'remote' -> 'origin' -> 'uri' with a shorter one (property 'uri'
only).
Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
---
.../oe-nodistro-master.conf.json | 18 +++-----------
.../oe-nodistro-whinlatter.conf.json | 18 +++-----------
.../configurations/poky-master.conf.json | 24 ++++---------------
.../configurations/poky-whinlatter.conf.json | 24 ++++---------------
4 files changed, 14 insertions(+), 70 deletions(-)
diff --git a/default-registry/configurations/oe-nodistro-master.conf.json b/default-registry/configurations/oe-nodistro-master.conf.json
index 180d2008a..e4e842177 100644
--- a/default-registry/configurations/oe-nodistro-master.conf.json
+++ b/default-registry/configurations/oe-nodistro-master.conf.json
@@ -3,33 +3,21 @@
"sources": {
"bitbake": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/bitbake"
- }
- },
+ "uri": "https://git.openembedded.org/bitbake",
"branch": "master",
"rev": "master"
}
},
"openembedded-core": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/openembedded-core"
- }
- },
+ "uri": "https://git.openembedded.org/openembedded-core",
"branch": "master",
"rev": "master"
}
},
"yocto-docs": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/yocto-docs"
- }
- },
+ "uri": "https://git.yoctoproject.org/yocto-docs",
"branch": "master",
"rev": "master"
}
diff --git a/default-registry/configurations/oe-nodistro-whinlatter.conf.json b/default-registry/configurations/oe-nodistro-whinlatter.conf.json
index 7b183ae1c..8342f2cf5 100644
--- a/default-registry/configurations/oe-nodistro-whinlatter.conf.json
+++ b/default-registry/configurations/oe-nodistro-whinlatter.conf.json
@@ -4,33 +4,21 @@
"sources": {
"bitbake": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/bitbake"
- }
- },
+ "uri": "https://git.openembedded.org/bitbake",
"branch": "2.16",
"rev": "2.16"
}
},
"openembedded-core": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/openembedded-core"
- }
- },
+ "uri": "https://git.openembedded.org/openembedded-core",
"branch": "whinlatter",
"rev": "whinlatter"
}
},
"yocto-docs": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/yocto-docs"
- }
- },
+ "uri": "https://git.yoctoproject.org/yocto-docs",
"branch": "whinlatter",
"rev": "whinlatter"
}
diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json
index 1de038bab..82464e8ab 100644
--- a/default-registry/configurations/poky-master.conf.json
+++ b/default-registry/configurations/poky-master.conf.json
@@ -3,44 +3,28 @@
"sources": {
"bitbake": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/bitbake"
- }
- },
+ "uri": "https://git.openembedded.org/bitbake",
"branch": "master",
"rev": "master"
}
},
"openembedded-core": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/openembedded-core"
- }
- },
+ "uri": "https://git.openembedded.org/openembedded-core",
"branch": "master",
"rev": "master"
}
},
"meta-yocto": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/meta-yocto"
- }
- },
+ "uri": "https://git.yoctoproject.org/meta-yocto",
"branch": "master",
"rev": "master"
}
},
"yocto-docs": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/yocto-docs"
- }
- },
+ "uri": "https://git.yoctoproject.org/yocto-docs",
"branch": "master",
"rev": "master"
}
diff --git a/default-registry/configurations/poky-whinlatter.conf.json b/default-registry/configurations/poky-whinlatter.conf.json
index bfa67426d..80b3c7f8c 100644
--- a/default-registry/configurations/poky-whinlatter.conf.json
+++ b/default-registry/configurations/poky-whinlatter.conf.json
@@ -4,44 +4,28 @@
"sources": {
"bitbake": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/bitbake"
- }
- },
+ "uri": "https://git.openembedded.org/bitbake",
"branch": "2.16",
"rev": "2.16"
}
},
"openembedded-core": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.openembedded.org/openembedded-core"
- }
- },
+ "uri": "https://git.openembedded.org/openembedded-core",
"branch": "whinlatter",
"rev": "whinlatter"
}
},
"meta-yocto": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/meta-yocto"
- }
- },
+ "uri": "https://git.yoctoproject.org/meta-yocto",
"branch": "whinlatter",
"rev": "whinlatter"
}
},
"yocto-docs": {
"git-remote": {
- "remotes": {
- "origin": {
- "uri": "https://git.yoctoproject.org/yocto-docs"
- }
- },
+ "uri": "https://git.yoctoproject.org/yocto-docs",
"branch": "whinlatter",
"rev": "whinlatter"
}
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [bitbake-devel] [PATCH v4 1/4] bitbake-setup: add inline URI
2025-12-19 16:12 [PATCH v4 1/4] bitbake-setup: add inline URI Corentin Guillevic
` (2 preceding siblings ...)
2025-12-19 16:12 ` [PATCH v4 4/4] doc/bitbake-setup: document "uri" property Corentin Guillevic
@ 2025-12-22 10:41 ` Mathieu Dubois-Briand
3 siblings, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2025-12-22 10:41 UTC (permalink / raw)
To: corentin.guillevic, bitbake-devel
On Fri Dec 19, 2025 at 5:12 PM CET, Corentin Guillevic via lists.openembedded.org wrote:
> Most of the time, when we describe a remote, a bitbake-setup source looks like this:
>
> "bitbake": {
> "git-remote": {
> "remotes": {
> "origin": {
> "uri": "https://git.openembedded.org/bitbake"
> }
> },
> ...
> }
> }
>
> i.e. an URI with the common name 'origin'. Alternatively, we could simplify this, by
> using a shorter structure with the property 'uri' only:
>
> "bitbake": {
> "git-remote": {
> "uri": "https://git.openembedded.org/bitbake",
> ...
> }
> }
>
> These properties can be used together.
>
> Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
> ---
>
> Changes in v4:
> - Fix a wrong indentation in the file bitbake-user-manual-environment-setup.rst
>
> bin/bitbake-setup | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 73f734e73..809077518 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -89,14 +89,30 @@ def _write_layer_list(dest, repodirs):
> with open(layers_f, 'w') as f:
> json.dump({"version":"1.0","layers":layers}, f, sort_keys=True, indent=4)
>
> +def _get_remotes(r_remote):
> + remotes = []
> +
> + if not 'remotes' in r_remote and not 'uri' in r_remote:
> + raise Exception("Expected key(s): 'remotes', 'uri'")
> +
> + if 'remotes' in r_remote:
> + for remote in r_remote['remotes']:
> + remotes.append(r_remote['remotes'][remote]['uri'])
> +
> + if 'uri' in r_remote:
> + remotes.append(r_remote['uri'])
> +
> + return remotes
> +
> def checkout_layers(layers, layerdir, d):
> def _checkout_git_remote(r_remote, repodir, layers_fixed_revisions):
> rev = r_remote['rev']
> branch = r_remote.get('branch', None)
> - remotes = r_remote['remotes']
> +
> + remotes = _get_remotes(r_remote)
>
> for remote in remotes:
> - prot,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"])
> + prot,host,path,user,pswd,params = bb.fetch.decodeurl(remote)
> fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params))
> logger.plain(" {}".format(r_name))
> if branch:
> @@ -600,7 +616,8 @@ def are_layers_changed(layers, layerdir, d):
> changed = False
> rev = r_remote['rev']
> branch = r_remote.get('branch', None)
> - remotes = r_remote['remotes']
> +
> + remotes = _get_remotes(r_remote)
>
> for remote in remotes:
> type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"])
Hi Corentin,
Thanks for your patch.
It looks like this is breaking a bitbake-selftest:
ERROR: test_setup (bb.tests.setup.BitbakeSetupTest.test_setup)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/lib/bb/tests/setup.py", line 318, in test_setup
out = self.runbbsetup("status")
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/lib/bb/tests/setup.py", line 90, in runbbsetup
return bb.process.run("{} --global-settings {} {}".format(bbsetup, os.path.join(self.tempdir, 'global-config'), cmd))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/lib/bb/process.py", line 189, in run
raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of '/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup --global-settings /tmp/bitbake-fetch-fb2c75qw/global-config status' failed with exit code 1:
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup", line 1059, in <module>
main()
~~~~^^
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup", line 1052, in main
args.func(top_dir, all_settings, args, d)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup", line 675, in build_status
if are_layers_changed(current_upstream_config["data"]["sources"], layerdir, d):
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup", line 644, in are_layers_changed
changed = changed | _is_git_remote_changed(git_remote, repodir)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/bitbake/bin/bitbake-setup", line 623, in _is_git_remote_changed
type,host,path,user,pswd,params = bb.fetch.decodeurl(remotes[remote]["uri"])
~~~~~~~^^^^^^^^
TypeError: list indices must be integers or slices, not str
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3016
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2879
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/2774
Can you have a look at this failure?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread