base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
PATCH v3 1/1 base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
When a MACHINEOVERRIDES has more than one value, split by ':' as usual OVERRIDES, this were not being properly checked in COMPATIBLE_MACHINE matching as we need to iterate over each SoC family and check if it is compatible or not.
---
Changes for v3:
- Stop checking for SOC_FAMILY as it is just for compatibility with old BSPs; we move to MACHINEOVERRIDES for this case (RP)
meta/classes/base.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
meta/classes/base.bbclass +6 -5
@@ -515,11 +515,12 @@ python () { need_machine = d.getVar('COMPATIBLE_MACHINE', True) if need_machine: import re - this_machine = d.getVar('MACHINE', True) - if this_machine and not re.match(need_machine, this_machine): - this_soc_family = d.getVar('SOC_FAMILY', True) - if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family: - raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine) + compat_machines.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":")) + for m in compat_machines: + if re.match(need_machine, m): + break + else: + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE', True)) bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
Signature · 1 line
1.8.1
Quoted 6 lines · Otavio Salvador
When a MACHINEOVERRIDES has more than one value, split by ':' as usual OVERRIDES, this were not being properly checked in
COMPATIBLE_MACHINEmatching as we need to iterate over each SoC family and check if it is compatible or not.Signed-off-by Otavio Salvador <[email protected]>
...
Quoted 1 line
+
compat_machines.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))
...
I did run it and it fails. I am fixing it and will send a new version well tested.
--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Quoted 19 lines · Otavio Salvador
When a MACHINEOVERRIDES has more than one value, split by ':' as usual OVERRIDES, this were not being properly checked in
COMPATIBLE_MACHINEmatching as we need to iterate over each SoC family and check if it is compatible or not.Signed-off-by Otavio Salvador <[email protected]>---
Changes for v3:
- Stop checking forSOC_FAMILYas it is just for compatibility with old BSPs; we move to MACHINEOVERRIDES for this case (RP)meta/classes/base.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)meta/classes/base.bbclass +0
-0
meta/classes/base.bbclass python () { · line 518
Quoted 9 lines
meta/classes/base.bbclass +1
-5@@ -515,11 +515,12 @@ python () { need_machine = d.getVar('COMPATIBLE_MACHINE', True) if need_machine: import re - this_machine = d.getVar('MACHINE', True) - if this_machine and not re.match(need_machine, this_machine): - this_soc_family = d.getVar('SOC_FAMILY', True) - if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family: - raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine) + compat_machines.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))
No variable "compat_machines" exists before this line so this patch cannot possibly work. What did you test?
We're close to release and I'm getting pushed hard in places like IRC to take patches like this which clearly don't work :(
I'm not happy.
Cheers,
Richard
Quoted 24 lines · Richard Purdie
Quoted 23 lines · Otavio Salvador
When a MACHINEOVERRIDES has more than one value, split by ':' as usual OVERRIDES, this were not being properly checked in
COMPATIBLE_MACHINEmatching as we need to iterate over each SoC family and check if it is compatible or not.Signed-off-by Otavio Salvador <[email protected]>---
Changes for v3:
- Stop checking forSOC_FAMILYas it is just for compatibility with old BSPs; we move to MACHINEOVERRIDES for this case (RP)meta/classes/base.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)meta/classes/base.bbclass +0
-1@@ -515,11 +515,12 @@ python () { need_machine = d.getVar('COMPATIBLE_MACHINE', True) if need_machine: import re - this_machine = d.getVar('MACHINE', True)
Quoted 8 lines
meta/classes/base.bbclass python () { · line 518
Quoted 5 lines
meta/classes/base.bbclass +1
-4- if this_machine and not re.match(need_machine, this_machine): - this_soc_family = d.getVar('SOC_FAMILY', True) - if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family: - raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine) + compat_machines.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))No variable "
compat_machines" exists before this line so this patch cannot possibly work. What did you test?
I got it when testing, hence my previous e-mail saying I found a problem.
--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br