From: Paul Barker <paul@pbarker.dev>
To: Alexander Kanavin <alex.kanavin@gmail.com>,
bitbake-devel@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: Re: [PATCH 4/4] bitbake-setup: implement symlinking local sources into builds
Date: Fri, 12 Dec 2025 11:27:52 +0000 [thread overview]
Message-ID: <9df2121472cb0296ca4c1ded0edeb1059e55a130.camel@pbarker.dev> (raw)
In-Reply-To: <20251211142532.983960-4-alex.kanavin@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2909 bytes --]
On Thu, 2025-12-11 at 15:25 +0100, Alexander Kanavin wrote:
> From: Alexander Kanavin <alex@linutronix.de>
>
> The feature and the use case were proposed here:
> https://lists.openembedded.org/g/bitbake-devel/message/18373
>
> The implementation extends the schema with a 'local' source type,
> and simply symlinks them into the setup directory during 'init'.
> 'status' or 'update' do not consider or modify the symlinks.
>
> The overrides support is extended to add a command line 'shortcut'
> for overriding sources with a local path, and massaging relative or
> ~-containing paths as appropriate.
>
> Documentation is extended to describe the local sources and show
> examples. The json properties for sources are also grouped correctly to show
> what is git-specific, what is local-specific and what is common.
>
> Tests are extended to cover a few things that weren't previously tested:
> source overrides, custom setup directory names, and tests for local
> sources are added as well.
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
> bin/bitbake-setup | 29 ++++++++++-
> .../bitbake-user-manual-environment-setup.rst | 50 +++++++++++++++++--
> lib/bb/tests/setup.py | 28 +++++++++++
> setup-schema/layers.schema.json | 14 ++++++
> 4 files changed, 115 insertions(+), 6 deletions(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 1f83b1b2a..30c5c44f7 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -109,6 +109,10 @@ def checkout_layers(layers, layerdir, d):
> revision = urldata.revision
> layers_fixed_revisions[r_name]['git-remote']['rev'] = revision
>
> + def _symlink_local(src, dst):
> + print("Making a symbolic link {} pointing to {}".format(dst, src))
> + os.symlink(src, dst)
> +
> layers_fixed_revisions = copy.deepcopy(layers)
> repodirs = []
> oesetupbuild = None
> @@ -121,6 +125,9 @@ def checkout_layers(layers, layerdir, d):
> r_remote = r_data.get('git-remote')
> if r_remote:
> _checkout_git_remote(r_remote, repodir, layers_fixed_revisions)
> + local = r_data.get('local')
> + if local:
> + _symlink_local(os.path.expanduser(local["path"]), os.path.join(layerdir,repodir))
Applying overrides shouldn't result in both 'git-remote' and 'local'
keys being present for the same source, but a badly written .conf.json
file could contain both. We should probably error out if both keys are
provided.
We call os.path.expanduser() in obtain_overrides, so I don't think we
need to call it again here.
And, I'd prefer the variable name r_local to match r_remote.
The rest of this looks great and works well in my local testing. Thanks
for implementing this!
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2025-12-12 11:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 14:25 [PATCH 1/4] setup-schema/layers.schema.json: correct indentation Alexander Kanavin
2025-12-11 14:25 ` [PATCH 2/4] bitbake-setup: override complete source entries, not just the git-remote properties Alexander Kanavin
2025-12-12 11:31 ` Paul Barker
2025-12-11 14:25 ` [PATCH 3/4] bitbake-setup: use separate functions for git-specific operations Alexander Kanavin
2025-12-12 11:35 ` Paul Barker
2025-12-11 14:25 ` [PATCH 4/4] bitbake-setup: implement symlinking local sources into builds Alexander Kanavin
2025-12-12 8:11 ` [bitbake-devel] " Antonin Godard
2025-12-12 15:27 ` Alexander Kanavin
2025-12-12 11:27 ` Paul Barker [this message]
2025-12-12 15:19 ` Alexander Kanavin
2025-12-12 11:30 ` [PATCH 1/4] setup-schema/layers.schema.json: correct indentation Paul Barker
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=9df2121472cb0296ca4c1ded0edeb1059e55a130.camel@pbarker.dev \
--to=paul@pbarker.dev \
--cc=alex.kanavin@gmail.com \
--cc=alex@linutronix.de \
--cc=bitbake-devel@lists.openembedded.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.