Currently, the build system is handled inconsistently across kas and
kas-container. While the default in kas-container is openembedded, kas
probes all permutations if no build system is provided (without
setting the build_system internally after finding a script).
We clean this up by directly loading the default value from the schema
and provide that to all callers across kas. This allows us to simplify
the init script probing. The effect of the schema change is limited to
isar users building directly with kas (no kas-container). As most (if
not all) isar users are container-based, this has no practical impact.
By that, we don't increase the schema version.
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
Changes since v1:
- improved commit message to better reflect the behavior changes
docs/userguide/project-configuration.rst | 13 ++++++-------
kas/config.py | 3 ++-
kas/libkas.py | 11 +++--------
kas/schema-kas.json | 1 +
4 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/docs/userguide/project-configuration.rst b/docs/userguide/project-configuration.rst
index 04c887b54..71d17ec4f 100644
--- a/docs/userguide/project-configuration.rst
+++ b/docs/userguide/project-configuration.rst
@@ -259,13 +259,12 @@ Configuration reference
``build_system``: string [optional]
:kasschemadesc:`build_system`
- Known build systems are
- ``openembedded`` (or ``oe``) and ``isar``. If set, this restricts the
- search of kas for the init script in the configured repositories to
- ``oe-init-build-env`` or ``isar-init-build-env``, respectively. If
- ``kas-container`` finds this property in the top-level kas configuration
- file (includes are not evaluated), it will automatically select the
- required container image and invocation mode.
+ Supported build systems are ``openembedded`` (or ``oe``) and ``isar``.
+ This value determines which init script is searched for in the configured
+ repositories (``oe-init-build-env`` or ``isar-init-build-env``,
+ respectively). ``kas-container`` evaluates this property in the top-level kas
+ configuration file only (includes are not evaluated) to select the required
+ container image and invocation mode.
``defaults``: dict [optional]
:kasschemadesc:`defaults`
diff --git a/kas/config.py b/kas/config.py
index cebc7494a..3ebdda822 100644
--- a/kas/config.py
+++ b/kas/config.py
@@ -69,7 +69,8 @@ class Config:
"""
Returns the pre-selected build system
"""
- return self._config.get('build_system', '')
+ default_bs = CONFIGSCHEMA['properties']['build_system']['default']
+ return self._config.get('build_system', default_bs)
def find_missing_repos(self, repo_paths={}):
"""
diff --git a/kas/libkas.py b/kas/libkas.py
index f5f5c45ed..bdfcf1712 100644
--- a/kas/libkas.py
+++ b/kas/libkas.py
@@ -404,15 +404,10 @@ def get_build_environ(build_system):
init_repo = None
if build_system in ['openembedded', 'oe']:
- scripts = ['oe-init-build-env']
+ script = 'oe-init-build-env'
elif build_system == 'isar':
- scripts = ['isar-init-build-env']
- else:
- scripts = ['oe-init-build-env', 'isar-init-build-env']
- permutations = \
- [(repo, script) for repo in get_context().config.get_repos()
- for script in scripts]
- for (repo, script) in permutations:
+ script = 'isar-init-build-env'
+ for repo in get_context().config.get_repos():
if os.path.exists(repo.path + '/' + script):
if init_repo:
raise InitBuildEnvError(
diff --git a/kas/schema-kas.json b/kas/schema-kas.json
index f3594a247..b8dc86c6c 100644
--- a/kas/schema-kas.json
+++ b/kas/schema-kas.json
@@ -80,6 +80,7 @@
},
"build_system": {
"description": "Defines the bitbake-based build system.",
+ "default": "openembedded",
"enum": [
"openembedded",
"oe",
--
2.53.0