Skip to contentSkip to conversation

meta/conf/templates/default/conf-description.txt: add a template description

PATCH In review Alexander Kanavin 4 participants 11 messages Jan 31, 2024 – Feb 16, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 meta/conf/templates/default/conf-description.txt: add a template description

Existing conf-notes.txt is not adequate in situations where the user needs to select a config template from several, or get an overview of them and is interested only in a brief explanation of what the template is for, but not extended multi-paragraph instructions for how to use it.

Such descriptions can be provided via conf-description.txt and this patch adds such a description for the oe-core default template.

Updates to the tools and a tool for selecting templates which will make specific use of the description will follow.

---
 meta/conf/templates/default/conf-description.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 meta/conf/templates/default/conf-description.txt
meta/conf/templates/default/conf-description.txt new file +1 -0
new file mode 100644
index 00000000000..e49172fa0ce
@@ -0,0 +1 @@
+This is the default build configuration for the openembedded-core layer.
Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/5 meta/lib/bblayers/buildconf.py: add support for configuration descriptions

---
 meta/lib/bblayers/buildconf.py           | 10 ++++++++--
 meta/lib/oeqa/selftest/cases/bblayers.py |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
meta/lib/bblayers/buildconf.py +8 -2
index 87a5e5a55bc..a7d06471df5 100644
@@ -20,7 +20,10 @@ def plugin_init(plugins):
     return BuildConfPlugin()
 
 class BuildConfPlugin(LayerPlugin):
-    notes_fixme = """FIXME: Please place here the description of this build configuration.
+    notes_fixme = """FIXME: Please place here the detailed instructions for using this build configuration.
+They will be shown to the users when they set up their builds via TEMPLATECONF.
+"""
+    description_fixme = """FIXME: Please place here the short description of what this build configuration is for.
 It will be shown to the users when they set up their builds via TEMPLATECONF.
 """
 
@@ -41,14 +44,17 @@ It will be shown to the users when they set up their builds via TEMPLATECONF.
                     bblayers_data = bblayers_data.replace(abspath, "##OEROOT##/" + relpath)
                 dest.write(bblayers_data)
 
+        with open(os.path.join(destdir, "conf-description.txt"), 'w') as dest:
+            dest.write(self.description_fixme)
         with open(os.path.join(destdir, "conf-notes.txt"), 'w') as dest:
             dest.write(self.notes_fixme)
 
         logger.info("""Configuration template placed into {}
 Please review the files in there, and particularly provide a configuration description in {}
+and notes in {}
 You can try out the configuration with
 TEMPLATECONF={} . {}/oe-init-build-env build-try-{}"""
-.format(destdir, os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename))
+.format(destdir, os.path.join(destdir, "conf-description.txt"), os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename))
 
     def do_save_build_conf(self, args):
         """ Save the currently active build configuration (conf/local.conf, conf/bblayers.conf) as a template into a layer.\n This template can later be used for setting up builds via TEMPLATECONF. """
meta/lib/oeqa/selftest/cases/bblayers.py +1 -1
index 8faa0602348..819ddf51bcd 100644
@@ -121,7 +121,7 @@ class BitbakeLayers(OESelftestTestCase):
         self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority))
 
         result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1"))
-        for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-notes.txt'):
+        for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-description.txt', 'conf-notes.txt'):
             fullpath = os.path.join(layerpath, "conf", "templates", "buildconf-1", f)
             self.assertTrue(os.path.exists(fullpath), "Template configuration file {} not found".format(fullpath))
 
Signature · 1 line
2.39.2
#2 lore raw

Patchtest results for [PATCH 2/5] meta/lib/bblayers/buildconf.py: add support for configuration descriptions

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/2-5-meta-lib-bblayers-buildconf.py-add-support-for-configuration-descriptions.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)

SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#3 lore raw

PATCH 3/5 scripts/oe-setup-builddir: add support for configuration descriptions

In reply to Alexander Kanavin

They are handled exactly same as conf-notes.txt.

---
 scripts/oe-setup-builddir | 10 ++++++++++
 1 file changed, 10 insertions(+)
scripts/oe-setup-builddir +10 -0
index 678aeac4be5..1b5dc55743e 100755
@@ -57,6 +57,7 @@ if [ -n "$TEMPLATECONF" ]; then
     fi
     OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
     OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
+    OECOREDESCRCONF="$TEMPLATECONF/conf-description.txt"
     OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt"
 fi
 
@@ -98,6 +99,13 @@ EOM
     SHOWYPDOC=yes
 fi
 
+if [ -z "$OECOREDESCRCONF" ]; then
+    OECOREDESCRCONF="$OEROOT/meta/conf/templates/default/conf-description.txt"
+fi
+if [ ! -r "$BUILDDIR/conf/conf-description.txt" ]; then
+    [ ! -r "$OECOREDESCRCONF" ] || cp "$OECOREDESCRCONF" "$BUILDDIR/conf/conf-description.txt"
+fi
+
 if [ -z "$OECORENOTESCONF" ]; then
     OECORENOTESCONF="$OEROOT/meta/conf/templates/default/conf-notes.txt"
 fi
@@ -108,6 +116,7 @@ fi
 # Prevent disturbing a new GIT clone in same console
 unset OECORELOCALCONF
 unset OECORELAYERCONF
+unset OECOREDESCRCONF
 unset OECORENOTESCONF
 
 # Ending the first-time run message. Show the YP Documentation banner.
@@ -124,6 +133,7 @@ EOM
 #    unset SHOWYPDOC
 fi
 
+[ ! -r "$BUILDDIR/conf/conf-description.txt" ] || cat "$BUILDDIR/conf/conf-description.txt"
 [ ! -r "$BUILDDIR/conf/conf-notes.txt" ] || cat "$BUILDDIR/conf/conf-notes.txt"
 
 if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
Signature · 1 line
2.39.2
#4 lore raw

PATCH 4/5 scripts/oe-setup-layers: write a list of layer paths into the checkout's top dir

In reply to Alexander Kanavin

This is beneficial for setting up builds, as this list can be used to determine reliably where the actual layers are, and discover available configurations from them.

Also adjust the selftest to check the presence of that file rather than any specific layer in a hardcoded location.

Sample output (paths are written relative to the file for relocatability and ease of reading):

{
    "layers": [
        "meta-openembedded/meta-filesystems",
        "meta-openembedded/meta-gnome",
        "meta-openembedded/meta-initramfs",
        "meta-openembedded/meta-multimedia",
        "meta-openembedded/meta-networking",
        "meta-openembedded/meta-oe",
        "meta-openembedded/meta-perl",
        "meta-openembedded/meta-python",
        "meta-openembedded/meta-webserver",
        "meta-openembedded/meta-xfce",
        "poky/bitbake/lib/layerindexlib/tests/testdata/layer1",
        "poky/bitbake/lib/layerindexlib/tests/testdata/layer2",
        "poky/bitbake/lib/layerindexlib/tests/testdata/layer3",
        "poky/bitbake/lib/layerindexlib/tests/testdata/layer4",
        "poky/meta-poky",
        "poky/meta-selftest",
        "poky/meta-skeleton",
        "poky/meta-yocto-bsp",
        "poky/meta"
    ],
    "version": "1.0"
}
---
 meta/lib/oeqa/selftest/cases/bblayers.py |  6 ++----
 scripts/oe-setup-layers                  | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)
meta/lib/oeqa/selftest/cases/bblayers.py +2 -4
index 819ddf51bcd..01fe17842e4 100644
@@ -163,7 +163,5 @@ class BitbakeLayers(OESelftestTestCase):
 
         testcheckoutdir = os.path.join(self.builddir, 'test-layer-checkout')
         result = runCmd('{}/setup-layers --destdir {}'.format(self.testlayer_path, testcheckoutdir))
-        # May not necessarily be named 'poky' or 'openembedded-core'
-        oecoredir = os.listdir(testcheckoutdir)[0]
-        testcheckoutfile = os.path.join(testcheckoutdir, oecoredir, "oe-init-build-env")
-        self.assertTrue(os.path.exists(testcheckoutfile), "File {} not found in test layer checkout".format(testcheckoutfile))
+        layers_json = os.path.join(testcheckoutdir, ".oe-layers.json")
+        self.assertTrue(os.path.exists(layers_json), "File {} not found in test layer checkout".format(layers_json))
scripts/oe-setup-layers +15 -0
index 6d49688a32c..bee4ef0fec8 100755
@@ -49,11 +49,24 @@ def _is_repo_at_remote_uri(repodir, remote, uri):
 def _contains_submodules(repodir):
     return os.path.exists(os.path.join(repodir,".gitmodules"))
 
+def _write_layer_list(dest, repodirs):
+    layers = []
+    for r in repodirs:
+        for root, dirs, files in os.walk(r):
+            if os.path.basename(root) == 'conf' and 'layer.conf' in files:
+                layers.append(os.path.relpath(os.path.dirname(root), dest))
+    layers_f = os.path.join(dest, ".oe-layers.json")
+    print("Writing list of layers into {}".format(layers_f))
+    with open(layers_f, 'w') as f:
+        json.dump({"version":"1.0","layers":layers}, f, sort_keys=True, indent=4)
+
 def _do_checkout(args, json):
     repos = json['sources']
+    repodirs = []
     for r_name in repos:
         r_data = repos[r_name]
         repodir = os.path.abspath(os.path.join(args['destdir'], r_data['path']))
+        repodirs.append(repodir)
 
         if 'contains_this_file' in r_data.keys():
             force_arg = 'force_bootstraplayer_checkout'
@@ -96,6 +109,8 @@ def _do_checkout(args, json):
             if _contains_submodules(repodir):
                 print("Repo {} contains submodules, use 'git submodule update' to ensure they are up to date".format(repodir))
 
+    _write_layer_list(args['destdir'], repodirs)
+
 parser = argparse.ArgumentParser(description="A self contained python script that fetches all the needed layers and sets them to correct revisions using data in a json format from a separate file. The json data can be created from an active build directory with 'bitbake-layers create-layers-setup destdir' and there's a sample file and a schema in meta/files/")
 
 parser.add_argument('--force-bootstraplayer-checkout', action='store_true',
Signature · 1 line
2.39.2
#5 lore raw

PATCH 5/5 oe-setup-build: add a tool for discovering config templates and setting up builds

In reply to Alexander Kanavin

This is another piece of the puzzle in setting up builds from nothing without having to write custom scripts or use external tools.

After layers have been fetched and placed into their respective locations by oe-setup-layers, one would surely want to proceed to the actual build, and here's how:

1. Without arguments the tool reads available layers
from .oe-layers.json file (written out by oe-setup-layers or a fallback under scripts/), prints what templates it has found, and asks the user to select one, as seen below. This will land the user in a shell ready to run bitbake:

=============================================

alex@Zen2:/srv/work/alex$ ./setup-build
Available build configurations:

1. alex-configuration-gadget
This configuration will set up a build for the purposes of supporting gadget.

2. alex-configuration-gizmo
This configuration allows building a gizmo.

3. poky-default
This is the default build configuration for the Poky reference distribution.

Re-run with 'list -v' to see additional information.
Please choose a configuration by its number: 1
Running: TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/configuration-gadget . /srv/work/alex/poky/oe-init-build-env /srv/work/alex/build-alex-configuration-gadget && /bin/bash You had no conf/local.conf file. This configuration file has therefore been
created for you from /srv/work/alex/meta-alex/conf/templates/configuration-gadget/local.conf.sample
You may wish to edit it to, for example, select a different MACHINE (target
hardware).

You had no conf/bblayers.conf file. This configuration file has therefore been created for you from /srv/work/alex/meta-alex/conf/templates/configuration-gadget/bblayers.conf.sample To add additional metadata layers into your configuration please add entries
to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference manual which can be found at:
https://docs.yoctoproject.org

For more information about OpenEmbedded see the website:
https://www.openembedded.org/

This configuration will set up a build for the purposes of supporting gadget. Please refer to meta-alex/README for additional details and available bitbake targets.
==============================================

2. It is also possible to list available configurations without selecting one using 'setup-build list' or to select and setup one non-interactively with 'setup-build setup'.

3. The full set of command line options is:

$ ./setup-build --help
usage: setup-build [-h] [--layerlist LAYERLIST] {list,setup} ...

A script that discovers available build configurations and sets up a build environment based on one of them. Run without arguments to choose one interactively.

positional arguments:
{list,setup}
list List available configurations
setup Set up a build environment and open a shell session with it, ready to run builds.

optional arguments:
-h, --help show this help message and exit
--layerlist LAYERLIST
Where to look for available layers (as written out by setup-layers script) (default is /srv/work/alex/.oe-layers.json).

$ ./setup-build list --help
usage: setup-build list [-h] [-v]

optional arguments:
-h, --help show this help message and exit
-v Print detailed information and usage notes for each available build configuration.

$ ./setup-build setup --help
usage: setup-build setup [-h] [-c configuration_name] [-b build_path] [--no-shell]

optional arguments:
-h, --help show this help message and exit
-c configuration_name
Use a build configuration configuration_name to set up a build environment (run this script with 'list' to see what is available)
-b build_path Set up a build directory in build_path (run this script with 'list -v' to see where it would be by default)
--no-shell Create a build directory but do not start a shell session with the build environment from it.

4. There's an an added hint in oe-setup-layers about how to proceed (as it is really not user-friendly to fetch the layer repos successfully and then exit without a word), and a symlink to the script from the top level layer checkout directory.

5. The selftest to check layer setup has been adjusted to run a basic check for template discovery and build setup. The revision of poky to be cloned has been bumped to 4.1, as that's the first version with a default template in a standard location.

---
 meta/lib/oeqa/selftest/cases/bblayers.py |  26 ++++-
 scripts/.oe-layers.json                  |   7 ++
 scripts/oe-setup-build                   | 122 +++++++++++++++++++++++
 scripts/oe-setup-layers                  |  10 ++
 4 files changed, 163 insertions(+), 2 deletions(-)
 create mode 100644 scripts/.oe-layers.json
 create mode 100755 scripts/oe-setup-build
meta/lib/oeqa/selftest/cases/bblayers.py +24 -2
index 01fe17842e4..00b1e6ce96f 100644
@@ -152,12 +152,12 @@ class BitbakeLayers(OESelftestTestCase):
         self.validate_layersjson(jsonfile)
 
         # The revision-under-test may not necessarily be available on the remote server,
-        # so replace it with a revision that has a yocto-4.0 tag.
+        # so replace it with a revision that has a yocto-4.1 tag.
         import json
         with open(jsonfile) as f:
             data = json.load(f)
         for s in data['sources']:
-            data['sources'][s]['git-remote']['rev'] = '00cfdde791a0176c134f31e5a09eff725e75b905'
+            data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0'
         with open(jsonfile, 'w') as f:
             json.dump(data, f)
 
@@ -165,3 +165,25 @@ class BitbakeLayers(OESelftestTestCase):
         result = runCmd('{}/setup-layers --destdir {}'.format(self.testlayer_path, testcheckoutdir))
         layers_json = os.path.join(testcheckoutdir, ".oe-layers.json")
         self.assertTrue(os.path.exists(layers_json), "File {} not found in test layer checkout".format(layers_json))
+
+        # As setup-layers checkout out an old revision of poky, there is no setup-build symlink,
+        # and we need to run oe-setup-build directly from the current poky tree under test
+        oe_setup_build = os.path.join(get_bb_var('COREBASE'), 'scripts/oe-setup-build')
+        oe_setup_build_l = os.path.join(testcheckoutdir, 'setup-build')
+        os.symlink(oe_setup_build,oe_setup_build_l)
+
+        cmd = '{} --layerlist {} list -v'.format(oe_setup_build_l, layers_json)
+        result = runCmd(cmd)
+        cond = "conf/templates/default" in result.output
+        self.assertTrue(cond, "Incorrect output from {}: {}".format(cmd, result.output))
+
+        # rather than hardcode the build setup cmdline here, let's actually run what the tool suggests to the user
+        conf = None
+        if 'poky-default' in result.output:
+            conf = 'poky-default'
+        elif 'meta-default' in result.output:
+            conf = 'meta-default'
+        self.assertIsNotNone(conf, "Could not find the configuration to set up a build in the output: {}".format(result.output))
+
+        cmd = '{} --layerlist {} setup -c {} --no-shell'.format(oe_setup_build_l, layers_json, conf)
+        result = runCmd(cmd)
scripts/.oe-layers.json new file +7 -0
new file mode 100644
index 00000000000..1b00a84b542
@@ -0,0 +1,7 @@
+{
+    "layers": [
+        "../meta-poky",
+        "../meta"
+    ],
+    "version": "1.0"
+}
scripts/oe-setup-build new file +122 -0

122 lines not on this page · raw message

scripts/oe-setup-layers +10 -0
index bee4ef0fec8..6fbfefd656f 100755
@@ -63,6 +63,7 @@ def _write_layer_list(dest, repodirs):
 def _do_checkout(args, json):
     repos = json['sources']
     repodirs = []
+    oesetupbuild = None
     for r_name in repos:
         r_data = repos[r_name]
         repodir = os.path.abspath(os.path.join(args['destdir'], r_data['path']))
@@ -108,9 +109,18 @@ def _do_checkout(args, json):
 
             if _contains_submodules(repodir):
                 print("Repo {} contains submodules, use 'git submodule update' to ensure they are up to date".format(repodir))
+        if os.path.exists(os.path.join(repodir, 'scripts/oe-setup-build')):
+            oesetupbuild = os.path.join(repodir, 'scripts/oe-setup-build')
 
     _write_layer_list(args['destdir'], repodirs)
 
+    if oesetupbuild:
+        oesetupbuild_symlink = os.path.join(args['destdir'], 'setup-build')
+        if os.path.exists(oesetupbuild_symlink):
+            os.remove(oesetupbuild_symlink)
+        os.symlink(os.path.relpath(oesetupbuild,args['destdir']),oesetupbuild_symlink)
+        print("\nRun '{}' to list available build configuration templates and set up a build from one of them.".format(oesetupbuild_symlink))
+
 parser = argparse.ArgumentParser(description="A self contained python script that fetches all the needed layers and sets them to correct revisions using data in a json format from a separate file. The json data can be created from an active build directory with 'bitbake-layers create-layers-setup destdir' and there's a sample file and a schema in meta/files/")
 
 parser.add_argument('--force-bootstraplayer-checkout', action='store_true',
Signature · 1 line
2.39.2
#6 lore raw

Re: [PATCH 5/5] oe-setup-build: add a tool for discovering config templates and setting up builds

I just tried to run the selftest on bblayers using oe-core and not poky and I noticed some failures, which I thought I'd share.

Quoted 9 lines

# The revision-under-test may not necessarily be available on the
remote server,

meta/lib/oeqa/selftest/cases/bblayers.py +1 -2
-        # so replace it with a revision that has a yocto-4.0 tag.
+        # so replace it with a revision that has a yocto-4.1 tag.
         import json
         with open(jsonfile) as f:
             data = json.load(f)
         for s in data['sources']:
-            data['sources'][s]['git-remote']['rev'] =
Quoted 3 lines

'00cfdde791a0176c134f31e5a09eff725e75b905'
+ data['sources'][s]['git-remote']['rev'] =
'5200799866b92259e855051112520006e1aaaac0'

First I got a failure here, as this is not a valid reference on oe-core, only on poky is this valid.

Quoted 15 lines
scripts/oe-setup-build new file +11 -0
+def setup_build_env(args):
+    templates = discover_templates(args.layerlist)
+    if not templates:
+        return
+
+    template = find_template(args.c, templates)
+    if not template:
+        return
+    builddir = args.b if args.b else template["buildpath"]
+    no_shell = args.no_shell
+    coredir =

os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
+ cmd = "TEMPLATECONF={} . {} {}".format(template["templatepath"],
os.path.join(coredir, 'oe-init-build-env'), builddir)

scripts/oe-setup-build line 99

Quoted 5 lines
scripts/oe-setup-build new file +5 -0
+    if not no_shell:
+        cmd = cmd + " && {}".format(os.environ['SHELL'])
+    print("Running:", cmd)
+    subprocess.run(cmd, shell=True, executable=os.environ['SHELL'])
+
2024-02-08 13:14:26,793 - oe-selftest - INFO - ======================================================================
2024-02-08 13:14:26,793 - oe-selftest - INFO - FAIL: test_bitbakelayers_setup (bblayers.BitbakeLayers)
2024-02-08 13:14:26,794 - oe-selftest - INFO - ----------------------------------------------------------------------
2024-02-08 13:14:26,794 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/builder/workdir/openembedded-core-contrib/meta/lib/oeqa/selftest/cases/bblayers.py", line 189, in test_bitbakelayers_setup
    result = runCmd(cmd)
  File "/home/builder/workdir/openembedded-core-contrib/meta/lib/oeqa/utils/commands.py", line 212, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))

AssertionError: Command '/home/builder/workdir/build-st/test-layer-checkout/setup-build --layerlist /home/builder/workdir/build-st/test-layer-checkout/.oe-layers.json setup -c meta-default --no-shell' returned non-zero exit status 1:
Available build configurations:

1. meta-default
This configuration does not have a description.

Re-run with 'list -v' to see additional information.
Running: TEMPLATECONF=/home/builder/workdir/build-st/test-layer-checkout/openembedded-core-contrib/meta/conf/templates/default . /home/builder/workdir/openembedded-core-contrib/oe-init-build-env /home/builder/workdir/build-st/build-meta-default Traceback (most recent call last):
File "/home/builder/workdir/build-st/test-layer-checkout/setup-build", line 119, in <module>
args.func(args)
File "/home/builder/workdir/build-st/test-layer-checkout/setup-build", line 98, in setup_build_env
subprocess.run(cmd, shell=True, executable=os.environ['SHELL'])
File "/usr/lib/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'SHELL'

I'm not entirely sure what was going on here, the SHELL variable was set in the shell environment, however it was not in os.environ.

#7 lore raw

Re: [OE-core] [PATCH 5/5] oe-setup-build: add a tool for discovering config templates and setting up builds

Quoted 13 lines · Jermain Horsman
Quoted 9 lines

# The revision-under-test may not necessarily be available on the
remote server,

meta/lib/oeqa/selftest/cases/bblayers.py +1 -2
-        # so replace it with a revision that has a yocto-4.0 tag.
+        # so replace it with a revision that has a yocto-4.1 tag.
         import json
         with open(jsonfile) as f:
             data = json.load(f)
         for s in data['sources']:
-            data['sources'][s]['git-remote']['rev'] =
Quoted 3 lines

'00cfdde791a0176c134f31e5a09eff725e75b905'
+ data['sources'][s]['git-remote']['rev'] =
'5200799866b92259e855051112520006e1aaaac0'

Quoted 1 line

First I got a failure here, as this is not a valid reference on oe-core, only on poky is this valid.

Yes, the test is poky-specific and was before the change too. Something to address later on.

Quoted 15 lines

1. meta-default
This configuration does not have a description.

Re-run with 'list -v' to see additional information.
Running: TEMPLATECONF=/home/builder/workdir/build-st/test-layer-checkout/openembedded-core-contrib/meta/conf/templates/default . /home/builder/workdir/openembedded-core-contrib/oe-init-build-env /home/builder/workdir/build-st/build-meta-default Traceback (most recent call last):
File "/home/builder/workdir/build-st/test-layer-checkout/setup-build", line 119, in <module>
args.func(args)
File "/home/builder/workdir/build-st/test-layer-checkout/setup-build", line 98, in setup_build_env
subprocess.run(cmd, shell=True, executable=os.environ['SHELL'])
File "/usr/lib/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'SHELL'

Quoted 1 line

I'm not entirely sure what was going on here, the SHELL variable was set in the shell environment, however it was not in os.environ.

I ran this on two different computers now to make sure something didn't regress, and it passed on both. Can you try with a plain poky checkout?

Alex

#8 lore raw

RE: [OE-core] [PATCH 5/5] oe-setup-build: add a tool for discovering config templates and setting up builds

Quoted 2 lines

Yes, the test is poky-specific and was before the change too. Something to address later on.

Alright

Quoted 3 lines

I ran this on two different computers now to make sure something didn't regress, and it passed on both. Can you try with a plain poky checkout?

So I did a couple of runs, mostly failures until I changed my default SHELL Variable to '/bin/bash', i.e.:

oe-selftest - FAIL

builder@buildhost:~$ echo $SHELL
/bin/sh
builder@buildhost:~$ export SHELL=/bin/bash
builder@buildhost:~$ echo $SHELL
/bin/bash
builder@buildhost:~$ cd workdir
builder@buildhost:~/workdir$ . poky/oe-init-build-env

oe-selftest - OK

I've never had any issues with this before, and I'm not aware of bash being required, But I might be missing something, anyway hope this helps.

Sincerely,

Jermain Horsman

#9 lore raw
In reply to Alexander Kanavin
Quoted 23 lines · Alexander Kanavin

Existing conf-notes.txt is not adequate in situations where the user needs to select a config template from several, or get an overview of them and is interested only in a brief explanation of what the template is for, but not extended multi-paragraph instructions for how to use it.

Such descriptions can be provided via conf-description.txt and this patch adds such a description for the oe-core default template.

Updates to the tools and a tool for selecting templates which will make specific use of the description will follow.

---
 meta/conf/templates/default/conf-description.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 meta/conf/templates/default/conf-description.txt
meta/conf/templates/default/conf-description.txt new file +0 -0
new file mode 100644
index 00000000000..e49172fa0ce

meta/conf/templates/default/conf-description.txt line 1

Quoted 1 line
meta/conf/templates/default/conf-description.txt new file +1 -0
@@ -0,0 +1 @@
+This is the default build configuration for the openembedded-core layer.

I know this feedback is long delayed so my apologies for that.

I think I'm ok with the idea of this but I believe the naming isn't quite right.

"notes" does suggest something longer, so that is fine. My worry is that in the metadata we have the SUMMARY and DESCRIPTION variables. The former is the short one, the latter is the longer.

If developers see:

conf-notes.txt
conf-description.txt

then they don't know which is the "short" one.

If you however you have:

conf-notes.txt
conf-summary.txt

then I think that is much clearer?

I think I'm therefore ok with the idea but I'd like to suggest using "summary" instead of "description"...

Cheers

Richard

#10 lore raw
Quoted 18 lines · Richard Purdie

I know this feedback is long delayed so my apologies for that.

I think I'm ok with the idea of this but I believe the naming isn't quite right.

"notes" does suggest something longer, so that is fine. My worry is that in the metadata we have the SUMMARY and DESCRIPTION variables. The former is the short one, the latter is the longer.

If developers see:

conf-notes.txt
conf-description.txt

then they don't know which is the "short" one.

If you however you have:

Quoted 7 lines

conf-notes.txt
conf-summary.txt

then I think that is much clearer?

I think I'm therefore ok with the idea but I'd like to suggest using "summary" instead of "description"...

No problem. Peter suggested this previously as well, but I didn't think it's super important back then.

Alex