Skip to contentSkip to conversation

cookerdata: Improve missing core layer error message

PATCH New Richard Purdie 3 participants 4 messages Sep 10, 2021 – Sep 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cookerdata: Improve missing core layer error message

If the core layer is missing from bblayers.conf, the message the user sees is hard to understand. Improve it.

[YOCTO #14340]

---
 lib/bb/cookerdata.py | 2 ++
 1 file changed, 2 insertions(+)
lib/bb/cookerdata.py +2 -0
index 1c1e008c6b..e54858cf02 100644
@@ -396,6 +396,8 @@ class CookerDataBuilder(object):
                 if c in collections_tmp:
                     bb.fatal("Found duplicated BBFILE_COLLECTIONS '%s', check bblayers.conf or layer.conf to fix it." % c)
                 compat = set((data.getVar("LAYERSERIES_COMPAT_%s" % c) or "").split())
+                if compat and not layerseries:
+                    bb.fatal("No core layer found to work with layer '%s'. Missing entry in bblayers.conf?" % c)
                 if compat and not (compat & layerseries):
                     bb.fatal("Layer %s is not compatible with the core layer which only supports these series: %s (layer is compatible with %s)"
                               % (c, " ".join(layerseries), " ".join(compat)))
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/1 cookerdata: Show error for no BBLAYERS in bblayers.conf

If there is no BBLAYERS set in bblayers.conf show a more helpful error and exit.

[YOCTO #14340]

---
 lib/bb/cookerdata.py | 3 +++
 1 file changed, 3 insertions(+)
lib/bb/cookerdata.py +3 -0
index e54858cf02..d6206b7319 100644
@@ -342,6 +342,9 @@ class CookerDataBuilder(object):
             layers = (data.getVar('BBLAYERS') or "").split()
             broken_layers = []
 
+            if not layers:
+                bb.fatal("The bblayers.conf file doesn't contain any BBLAYERS definition")
+
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
 
Signature · 1 line
2.32.0
#2 lore raw

Re: [bitbake-devel] [PATCH] cookerdata: Show error for no BBLAYERS in bblayers.conf

Hi, Richard

This patch cause one problem for layerindex.

function init_parser in http://git.yoctoproject.org/cgit.cgi/layerindex-web/tree/layerindex/recipeparse.py,

will setup tinfoil in an temp dir without setting BBLAYERS . This patch will make layerindex update failed since setup tinfoil failed.

layerindex setup tinfoil for parsing current target-layer's layer.conf, so don't need to set BBLAYERS.

Can we revert this or just report as warning?

Thanks

Changqing

||

Quoted 38 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

If there is no BBLAYERS set in bblayers.conf show a more helpful error and exit.

[YOCTO #14340]

---
  lib/bb/cookerdata.py | 3 +++
  1 file changed, 3 insertions(+)
lib/bb/cookerdata.py +3 -1
index e54858cf02..d6206b7319 100644
@@ -342,6 +342,9 @@ class CookerDataBuilder(object):
              layers = (data.getVar('BBLAYERS') or "").split()
              broken_layers = []
 
+            if not layers:
+                bb.fatal("The bblayers.conf file doesn't contain any BBLAYERS definition")
+
              data = bb.data.createCopy(data)
              approved = bb.utils.approved_variables()
 
--

2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12629): https://lists.openembedded.org/g/bitbake-devel/message/12629
Mute This Topic: https://lists.openembedded.org/mt/85510606/3616873
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [bitbake-devel] [PATCH] cookerdata: Show error for no BBLAYERS in bblayers.conf

Quoted 9 lines · Changqing Li

Hi, Richard

This patch cause one problem for layerindex.

function init_parser in
http://git.yoctoproject.org/cgit.cgi/layerindex-web/tree/layerindex/recipeparse.py,

will setup tinfoil in an temp dir without setting BBLAYERS . This patch will make layerindex update failed since setup tinfoil failed.

Does the temp dir need this configured? I believe other parts of the parsing we do configure things to work with specific default variable definitions. Defining the branch/release we're looking for seems like the right answer here.

Quoted 4 lines

layerindex setup tinfoil for parsing current target-layer's layer.conf, so don't need to set BBLAYERS.

Can we revert this or just report as warning?

It really should be a error. I've ended up accidently doing this before and it's really painful to debug.

I could see some of the other utilities thought failing here (bitbake-tests or even bitbake-layers in some cases.)

So I think it's a setup issue within the scope of the layer index parser. It might be enough to set the name in a variable in the 'if not classic' case to simulate a properly configured machine. (i.e. BBLAYERS = " " or generate a dummy layer that does nothing and include it.)

--Mark

Quoted 46 lines

Thanks

Changqing

||

Quoted 27 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

If there is no BBLAYERS set in bblayers.conf show a more helpful error and exit.

[YOCTO #14340]

---
 lib/bb/cookerdata.py | 3 +++
 1 file changed, 3 insertions(+)
lib/bb/cookerdata.py +3 -1
index e54858cf02..d6206b7319 100644
@@ -342,6 +342,9 @@ class CookerDataBuilder(object):
             layers = (data.getVar('BBLAYERS') or "").split()
             broken_layers = []
 
+            if not layers:
+                bb.fatal("The bblayers.conf file doesn't contain any BBLAYERS definition")
+
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
 
--
Quoted 3 lines

2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12709): https://lists.openembedded.org/g/bitbake-devel/message/12709
Mute This Topic: https://lists.openembedded.org/mt/85510606/3616948
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-