diff mbox series

[1/2] bitbake-setup: ensure that relative local path given on 'init' command line is recorded as an absolute path

Message ID 20260305200937.221484-1-alex.kanavin@gmail.com
State New
Headers show
Series [1/2] bitbake-setup: ensure that relative local path given on 'init' command line is recorded as an absolute path | expand

Commit Message

Alexander Kanavin March 5, 2026, 8:09 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Otherwise status/update operations will fail if executed from a different
directory that the template file was in, as they won't be able to find
the file.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 bin/bitbake-setup | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexander Kanavin March 8, 2026, 2:16 p.m. UTC | #1
Please hold this, I’ll develop a better fix.

Alex

On Thu 5. Mar 2026 at 22.09, Alexander Kanavin via lists.openembedded.org
<alex.kanavin=gmail.com@lists.openembedded.org> wrote:

> From: Alexander Kanavin <alex@linutronix.de>
>
> The code was relying on git fetcher's latest_revision() method,
> which works properly if the revision in the json config template
> is set to a branch or a tag, but does not work if it is set to
> a fixed revision (the method will return the latest revision on the
> respective branch, and bitbake-setup will incorrectly determine
> that the layer needs to be updated to that revision).
>
> Add a guard to check if revision is a commit id, and skip the
> check if so.
>
> [YOCTO #16190]
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  bin/bitbake-setup | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 1a42aaa51..69362b589 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -741,9 +741,13 @@ def get_diff(file1, file2):
>      return None
>
>  def are_layers_changed(layers, layerdir, d):
> +    from bb.fetch2.git import sha1_re
> +
>      def _is_git_remote_changed(r_remote, repodir):
>          changed = False
>          rev = r_remote['rev']
> +        if sha1_re.match(rev):
> +            return False
>          branch = r_remote.get('branch', None)
>
>          remotes = _get_remotes(r_remote)
> --
> 2.47.3
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#19118):
> https://lists.openembedded.org/g/bitbake-devel/message/19118
> Mute This Topic: https://lists.openembedded.org/mt/118158860/1686489
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index bdf134aea..1a42aaa51 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -600,6 +600,7 @@  def obtain_config(top_dir, registry, args, source_overrides, d):
         config_id = args.config[0]
         config_parameters = args.config[1:]
         if os.path.exists(config_id):
+            config_id = os.path.abspath(config_id)
             logger.info("Reading configuration from local file\n    {}".format(config_id))
             upstream_config = {'type':'local',
                                'path':os.path.abspath(config_id),