Skip to contentSkip to conversation

bitbake-setup: local sources add oe.path.expendvars

RFC PATCH In review Anibal Limon 2 participants 3 messages Dec 21, 2025 – Dec 22, 2025

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 bitbake-setup: local sources add oe.path.expendvars

Allow environment variables to be expanded on local sources, allow users specify layers location using custom environment variables.

---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/bitbake-setup +1 -1
index 73f734e73..d19aee971 100755
@@ -129,7 +129,7 @@ def checkout_layers(layers, layerdir, d):
         if r_remote:
             _checkout_git_remote(r_remote, repodir, layers_fixed_revisions)
         if r_local:
-            _symlink_local(os.path.expanduser(r_local["path"]), os.path.join(layerdir,repodir))
+            _symlink_local(os.path.expandvars(os.path.expanduser(r_local["path"])), os.path.join(layerdir,repodir))
 
         if os.path.exists(os.path.join(layerdir, repodir, 'scripts/oe-setup-build')):
             oesetupbuild = os.path.join(layerdir, repodir, 'scripts/oe-setup-build')
Signature · 1 line
2.47.3
#1 lore raw

bin/bitbake-setup def checkout_layers(layers, layerdir, d): · line 132

Quoted 2 lines · Anibal Limon via lists.openembedded.org
bin/bitbake-setup +1 -1
-            _symlink_local(os.path.expanduser(r_local["path"]), os.path.join(layerdir,repodir))
+            _symlink_local(os.path.expandvars(os.path.expanduser(r_local["path"])), os.path.join(layerdir,repodir))

What happens if the variable isn't set? This may introduce a usability problem when users forget to set the needed variable, or are oblivious to needing to set it, and get cryptic path-related fails.

I'd rather use a -L command line switch to override the default value, and, if needed, place the environment variable into that:

bitbake-setup init -L openembedded-core $SOME_CUSTOM_PATH/openembedded-core

Alex

#2 lore raw

Hi Alex,

Thanks for pointing out the -L option; it covers my use-case.

Anibal

Quoted 19 lines · Alexander Kanavin
Quoted 1 line · Anibal Limon via lists.openembedded.org

- _symlink_local(os.path.expanduser(r_local["path"]),

os.path.join(layerdir,repodir))

Quoted 1 line

+

_symlink_local(os.path.expandvars(os.path.expanduser(r_local["path"])), os.path.join(layerdir,repodir))

What happens if the variable isn't set? This may introduce a usability problem when users forget to set the needed variable, or are oblivious to needing to set it, and get cryptic path-related fails.

I'd rather use a -L command line switch to override the default value, and, if needed, place the environment variable into that:

bitbake-setup init -L openembedded-core $SOME_CUSTOM_PATH/openembedded-core

Alex