Skip to contentSkip to conversation

bitbake: cooker: list all nonexistent bblayer directories

PATCH In review Oleksandr Kravchuk 2 participants 3 messages Jun 13, 2019 – Jun 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake: cooker: list all nonexistent bblayer directories

Check existence of all the bblayer direcotories at once and print them all, so if there are multiple nonexistent directories, user does not have to correct bblayers.conf and restart bitbake multiple times.

[YOCTO #11647]

---
 bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
bitbake/lib/bb/cookerdata.py +13 -3
index f8ae41093b..be1c332eb5 100644
@@ -342,14 +342,24 @@ class CookerDataBuilder(object):
             data = parse_config_file(layerconf, data)
 
             layers = (data.getVar('BBLAYERS') or "").split()
+            broken_layers = []
 
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
+
+            # Check whether present layer directories exist
             for layer in layers:
                 if not os.path.isdir(layer):
-                    parselog.critical("Layer directory '%s' does not exist! "
-                                      "Please check BBLAYERS in %s" % (layer, layerconf))
-                    sys.exit(1)
+                    broken_layers.append(layer)
+
+            if broken_layers:
+                parselog.critical("The following layer directories do not exist:")
+                for layer in broken_layers:
+                    parselog.critical("- %s", layer)
+                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
+                sys.exit(1)
+
+            for layer in layers:
                 parselog.debug(2, "Adding layer %s", layer)
                 if 'HOME' in approved and '~' in layer:
                     layer = os.path.expanduser(layer)
Signature · 1 line
2.17.1
#1 lore raw

This is how it'll look like:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/sashko/projects/yocto/open-embedded/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 7414 at 2019-06-14 01:35:10.070371 ---
ERROR: The following layer directories do not exist:
ERROR: - /home/sashko/projects/yocto/open-embedded/sources/poky/meta-abc
ERROR: - /home/sashko/projects/yocto/open-embedded/sources/poky/meta-xyz
ERROR: Please check BBLAYERS in /home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf

Feel free to suggest better way to present this information to a user.

Quoted 43 lines · Oleksandr Kravchuk

Check existence of all the bblayer direcotories at once and print them all, so if there are multiple nonexistent directories, user does not have to correct bblayers.conf and restart bitbake multiple times.

[YOCTO #11647]

---
 bitbake/lib/bb/cookerdata.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
bitbake/lib/bb/cookerdata.py +13 -3
index f8ae41093b..be1c332eb5 100644
@@ -342,14 +342,24 @@ class CookerDataBuilder(object):
             data = parse_config_file(layerconf, data)
 
             layers = (data.getVar('BBLAYERS') or "").split()
+            broken_layers = []
 
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
+
+            # Check whether present layer directories exist
             for layer in layers:
                 if not os.path.isdir(layer):
-                    parselog.critical("Layer directory '%s' does not exist! "
-                                      "Please check BBLAYERS in %s" % (layer, layerconf))
-                    sys.exit(1)
+                    broken_layers.append(layer)
+
+            if broken_layers:
+                parselog.critical("The following layer directories do not exist:")
+                for layer in broken_layers:
+                    parselog.critical("- %s", layer)
+                parselog.critical("Please check BBLAYERS in %s" % (layerconf))
+                sys.exit(1)
+
+            for layer in layers:
                 parselog.debug(2, "Adding layer %s", layer)
                 if 'HOME' in approved and '~' in layer:
                     layer = os.path.expanduser(layer)
#2 lore raw

✗ patchtest: failure for bitbake: cooker: list all nonexistent bblayer directories

In reply to Oleksandr Kravchuk

== Series Details ==

Series: bitbake: cooker: list all nonexistent bblayer directories
Revision: 1
URL : https://patchwork.openembedded.org/series/18148/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list]

  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     [email protected] [http://git.openembedded.org/bitbake/]
  Patch's path:    bitbake/lib/bb/cookerdata.py

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at ca737408bb)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe