public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: <corentin.guillevic@smile.fr>, <bitbake-devel@lists.openembedded.org>
Subject: Re: [bitbake-devel] [PATCH v4 1/4] bitbake-setup: add inline URI
Date: Mon, 22 Dec 2025 11:41:32 +0100	[thread overview]
Message-ID: <DF4OKNSZFV84.3O7R9PLEQC12Y@bootlin.com> (raw)
In-Reply-To: <20251219161255.2293450-1-corentin.guillevic@smile.fr>

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



      parent reply	other threads:[~2025-12-22 10:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [PATCH v4 3/4] bitbake-setup: use URI shortcut for all configurations Corentin Guillevic
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DF4OKNSZFV84.3O7R9PLEQC12Y@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=corentin.guillevic@smile.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox