diff mbox series

[AUH,v3,1/4] steps.py: resolve symlinks in recipe_dir

Message ID 20260504063614.3831203-2-daniel.turull@ericsson.com
State New
Headers show
Series upgrade_helper: scarthgap compatibility and stable updates | expand

Commit Message

Daniel Turull May 4, 2026, 6:36 a.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Use os.path.realpath() on recipe_dir so that git operations work
when bblayers.conf references layers through symlinks (e.g.
meta -> openembedded-core/meta). Without this, git add fails
because the symlinked path is outside the git repo.

Assisted-by: kiro:claude-opus-4.6
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
---
 modules/steps.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexander Kanavin May 4, 2026, 8:13 a.m. UTC | #1
Thanks, this has been applied.

Alex

On Mon, 4 May 2026 at 08:36, <daniel.turull@ericsson.com> wrote:
>
> From: Daniel Turull <daniel.turull@ericsson.com>
>
> Use os.path.realpath() on recipe_dir so that git operations work
> when bblayers.conf references layers through symlinks (e.g.
> meta -> openembedded-core/meta). Without this, git add fails
> because the symlinked path is outside the git repo.
>
> Assisted-by: kiro:claude-opus-4.6
> Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
> ---
>  modules/steps.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/steps.py b/modules/steps.py
> index a6ec341..b3ec61c 100644
> --- a/modules/steps.py
> +++ b/modules/steps.py
> @@ -36,7 +36,7 @@ def load_env(devtool, bb, git, opts, group):
>      os.mkdir(group['workdir'])
>      for pkg_ctx in group['pkgs']:
>          pkg_ctx['env'] = bb.env(pkg_ctx['PN'])
> -        pkg_ctx['recipe_dir'] = os.path.dirname(pkg_ctx['env']['FILE'])
> +        pkg_ctx['recipe_dir'] = os.path.realpath(os.path.dirname(pkg_ctx['env']['FILE']))
>
>  def buildhistory_init(devtool, bb, git, opts, group):
>      if not opts['buildhistory']:
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/modules/steps.py b/modules/steps.py
index a6ec341..b3ec61c 100644
--- a/modules/steps.py
+++ b/modules/steps.py
@@ -36,7 +36,7 @@  def load_env(devtool, bb, git, opts, group):
     os.mkdir(group['workdir'])
     for pkg_ctx in group['pkgs']:
         pkg_ctx['env'] = bb.env(pkg_ctx['PN'])
-        pkg_ctx['recipe_dir'] = os.path.dirname(pkg_ctx['env']['FILE'])
+        pkg_ctx['recipe_dir'] = os.path.realpath(os.path.dirname(pkg_ctx['env']['FILE']))
 
 def buildhistory_init(devtool, bb, git, opts, group):
     if not opts['buildhistory']: