Skip to contentSkip to conversation

sanity.bbclass: Improved error message

PATCH Superseded Juro Bystricky 4 participants 6 messages Jan 12, 2017 – Jan 13, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sanity.bbclass: Improved error message

When a non-existing MACHINE is specified, sanity check issues the following message:

Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

This patch remedies this by explicitly naming the offending MACHINE and adding conf/multiconfig/*.conf to the list of places where this erroneous MACHINE definition could have originated.

Invalid MACHINE=xyz. Please set a valid MACHINE in your local.conf, conf/multiconfig/*.conf or environment

[YOCTO#10810]

---
 meta/classes/sanity.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sanity.bbclass +1 -1
index c876dc6..8477d38 100644
@@ -823,7 +823,7 @@ def check_sanity_everybuild(status, d):
     machinevalid = True
     if d.getVar('MACHINE'):
         if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
-            status.addresult('Please set a valid MACHINE in your local.conf or environment\n')
+            status.addresult('Invalid MACHINE=%s. Please set a valid MACHINE in your local.conf, conf/multiconfig/*.conf or environment\n' % (d.getVar('MACHINE')))
             machinevalid = False
         else:
             status.addresult(check_sanity_validmachine(d))
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · Juro Bystricky

When a non-existing MACHINE is specified, sanity check issues the following message:

    Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

Quoted 8 lines

This patch remedies this by explicitly naming the offending MACHINE and
adding conf/multiconfig/*.conf to the list of places where this erroneous
MACHINE definition could have originated.

    Invalid MACHINE=xyz. Please set a valid MACHINE in your local.conf, conf/multiconfig/*.conf or environment

Can we change this to:

"MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file."

I don't want to have to list all the possible places you could set MACHINE.

Cheers,

Richard

#2 lore raw

No problem. Will send in patch V2 shortly.

Quoted 39 lines

-----Original Message-----
From: Richard Purdie [mailto:[email protected]]
Sent: Thursday, January 12, 2017 1:42 PM
To: Bystricky, Juro <[email protected]>; openembedded- [email protected]
Cc: [email protected]
Subject: Re: [PATCH] sanity.bbclass: Improved error message

Quoted 10 lines · Juro Bystricky

When a non-existing MACHINE is specified, sanity check issues the following message:

    Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

Quoted 8 lines

This patch remedies this by explicitly naming the offending MACHINE and
adding conf/multiconfig/*.conf to the list of places where this erroneous
MACHINE definition could have originated.

    Invalid MACHINE=xyz. Please set a valid MACHINE in your local.conf, conf/multiconfig/*.conf or environment

Can we change this to:

"MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file."

I don't want to have to list all the possible places you could set MACHINE.

Cheers,

Richard

#3 lore raw
In reply to Richard Purdie
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Juro Bystricky

When a non-existing MACHINE is specified, sanity check issues the following message:

Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

This patch remedies this by explicitly naming the offending MACHINE and
adding conf/multiconfig/*.conf to the list of places where this erroneous
MACHINE definition could have originated.

Quoted 7 lines
Quoted 2 lines

Invalid MACHINE=xyz. Please set a valid MACHINE in your
local.conf, conf/multiconfig/*.conf or environment

Can we change this to:

"MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file."

I commented elsewhere as well -- but is there any way to see where MACHINE was actually set and display that -- or is it limited to 'bitbake -e' usage?

--Mark

Quoted 7 lines

I don't want to have to list all the possible places you could set MACHINE.

Cheers,

Richard

#4 lore raw
Quoted 22 lines · On Thu, 12 Jan 2017 16:04:09 Mark Hatle wrote:
Quoted 21 lines · Richard Purdie
Quoted 19 lines · Juro Bystricky

When a non-existing MACHINE is specified, sanity check issues

the following message:
Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

This patch remedies this by explicitly naming the offending MACHINE and
adding conf/multiconfig/*.conf to the list of places where this erroneous
MACHINE definition could have originated.

Invalid MACHINE=xyz. Please set a valid MACHINE in your

local.conf, conf/multiconfig/*.conf or environment

Quoted 8 lines
Quoted 4 lines

Can we change this to:

"MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file."

I commented elsewhere as well -- but is there any way to see where MACHINE was actually set and display that -- or is it limited to 'bitbake -e' usage?

You need to have history enabled in the datastore to be able to retrieve that, and we don't during normal mode for performance over the entire run. It's possible we could enable it reparse the configuration when errors like this occur to get it though - it probably wouldn't take too long, but I don't know if there are other practical barriers.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#5 lore raw
Quoted 32 lines · Paul Eggleton
Quoted 22 lines · On Thu, 12 Jan 2017 16:04:09 Mark Hatle wrote:
Quoted 21 lines · Richard Purdie
Quoted 19 lines · Juro Bystricky

When a non-existing MACHINE is specified, sanity check issues

the following message:
Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s). Hence we may have several different MACHINE settings within one (multiconfig) build, so the present error message is fairly ambiguous.

This patch remedies this by explicitly naming the offending MACHINE and
adding conf/multiconfig/*.conf to the list of places where this erroneous
MACHINE definition could have originated.

Invalid MACHINE=xyz. Please set a valid MACHINE in your

local.conf, conf/multiconfig/*.conf or environment

Quoted 8 lines
Quoted 4 lines

Can we change this to:

"MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file."

I commented elsewhere as well -- but is there any way to see where MACHINE was actually set and display that -- or is it limited to 'bitbake -e' usage?

Quoted 5 lines

You need to have history enabled in the datastore to be able to retrieve that, and we don't during normal mode for performance over the entire run. It's possible we could enable it reparse the configuration when errors like this occur to get it though - it probably wouldn't take too long, but I don't know if there are other practical barriers.

Ok.. I couldn't remember if history was needed or not. I know one of the implementations included a history reference for the last one (instead of a full history...)

It's not worth making this more difficult to implement then.

--Mark

Quoted 3 lines

Cheers,
Paul