Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 10:44, Chris Johns wrote:

Can I add `default-by-family: []` before `default-by-variant` in the spec files?


Yes, the attributes should alphabetically sorted.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:01 pm, Sebastian Huber wrote:
> On 14/07/2021 08:51, chr...@rtems.org wrote:
>> @@ -695,12 +692,18 @@ class OptionItem(Item):
>>   return True
>>   return False
>>   -    def default_value(self, variant):
>> +    def default_value(self, variant, family):
>>   value = self.data["default"]
>>   for default in self.data["default-by-variant"]:
>>   if OptionItem._is_variant(default["variants"], variant):
>>   value = default["value"]
>>   break
>> +    if 'default-by-family' in self.data:
>> +    for default in self.data["default-by-family"]:
>> +    if 'families' in default:
>> +    if OptionItem._is_variant(default["families"], family):
>> +    value = default["value"]
>> +    break
> 
> During the discussion of the build items, we agreed that all attributes should
> be explicit in the items. So, a "default-by-family: []" should be added to all
> BSP items.

Can I add `default-by-family: []` before `default-by-variant` in the spec files?

It is easier to batch edit.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:24 pm, Sebastian Huber wrote:
> On 14/07/2021 09:21, Chris Johns wrote:
>> Is there a nice way to catch any missing fields and report them? The waf 
>> conf is
>> not present and I am not sure if we catch any standard python exception and
>> report them by waf?
> 
> The current approach is to check the user input (e.g. config.ini) and report
> configuration errors. For errors in the build specification which is supposed 
> to
> be maintained by experts you get exceptions.

I prefer a soft landing. It helps bring those who are learning to be experts
become experts.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 09:21, Chris Johns wrote:

Is there a nice way to catch any missing fields and report them? The waf conf is
not present and I am not sure if we catch any standard python exception and
report them by waf?


The current approach is to check the user input (e.g. config.ini) and 
report configuration errors. For errors in the build specification which 
is supposed to be maintained by experts you get exceptions.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:01 pm, Sebastian Huber wrote:
> On 14/07/2021 08:51, chr...@rtems.org wrote:
>> @@ -695,12 +692,18 @@ class OptionItem(Item):
>>   return True
>>   return False
>>   -    def default_value(self, variant):
>> +    def default_value(self, variant, family):
>>   value = self.data["default"]
>>   for default in self.data["default-by-variant"]:
>>   if OptionItem._is_variant(default["variants"], variant):
>>   value = default["value"]
>>   break
>> +    if 'default-by-family' in self.data:
>> +    for default in self.data["default-by-family"]:
>> +    if 'families' in default:
>> +    if OptionItem._is_variant(default["families"], family):
>> +    value = default["value"]
>> +    break
> 
> During the discussion of the build items, we agreed that all attributes should
> be explicit in the items. So, a "default-by-family: []" should be added to all
> BSP items.

OK I will generate a v3 patch.

Is there a nice way to catch any missing fields and report them? The waf conf is
not present and I am not sure if we catch any standard python exception and
report them by waf?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 08:51, chr...@rtems.org wrote:

@@ -695,12 +692,18 @@ class OptionItem(Item):
  return True
  return False
  
-def default_value(self, variant):

+def default_value(self, variant, family):
  value = self.data["default"]
  for default in self.data["default-by-variant"]:
  if OptionItem._is_variant(default["variants"], variant):
  value = default["value"]
  break
+if 'default-by-family' in self.data:
+for default in self.data["default-by-family"]:
+if 'families' in default:
+if OptionItem._is_variant(default["families"], family):
+value = default["value"]
+break


During the discussion of the build items, we agreed that all attributes 
should be explicit in the items. So, a "default-by-family: []" should be 
added to all BSP items.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel