From: Jose Quaresma <
jose.q...@oss.qualcomm.com>
We need to take into account whether the layers are disabled when we search
for the oe-init-build-env script.
If for some reason the layers are disabled it is because the user did it
explicitly and it is not possible to use the repository since without this
layers the present script doesn't make sense to use.
An example where this is necessary is when we use the nodistro as the base
configuration and want to override it with another configuration to use the poky.
Or vice versa.
nodistro.yml
bitbake:
layers:
.: disabled
oe-core:
layers:
meta:
poky.yml
oe-core:
layers:
meta: disabled
poky:
layers:
meta:
meta-poky:
- To build the nodistro the user uses the nodistro.yml which also contains the
remaining defined configuration.
- To use the poky distro the user will use the nodistro.yml:poky.yml which explicitly
disables the layer meta from the oe-core repo in the poky.yml and adds the poky layers.
In this case, with the configuration nodistro.yml:poky.yml, we have two repositories
providing the init script but in one of them all the layers were explicitly turned off.
We must use the script from the other repo, that does not have the all the layers turned off,
which in this case is poky repo.
Signed-off-by: Jose Quaresma <
jose.q...@oss.qualcomm.com>
---
V3:
- check for any layer active to use the script of the repo
- log all founded scripts at debug level
kas/libkas.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kas/libkas.py b/kas/libkas.py
index 5327efb..753af72 100644
--- a/kas/libkas.py
+++ b/kas/libkas.py
@@ -285,8 +285,13 @@ def get_build_environ(build_system):
f'({
repo.name} vs. {
init_repo.name}). '
'Resolve ambiguity by removing one of the repos')
- init_repo = repo
- init_script = script
+ if repo._layers:
+ init_repo = repo
+ init_script = script
+ skip = ''
+ else:
+ skip = ', skipping it given that there are no active layers'
+ logging.debug(f'The init scripts "{script}" found on repo "{
repo.name}"{skip}')
if not init_repo:
raise InitBuildEnvError('Did not find any init-build-env script')
--
2.51.0