Skip to content

[Feature]: improve CSV processing and error messges #212

@apop5

Description

@apop5

Feature Overview

When dealing with multiple CSV files for profile support, error messages are sparse (i.e. the specific filename being processed is not displayed, and this can result in difficulty in finding the offending code.

Other minor annoyances:

in CSV profile, having a blank line at the end of the file causes tool failure:

INFO -   File "C:\Code\mu_tiano_platforms\Features\CONFIG\SetupDataPkg\Tools\VariableList.py", line 1201, in read_csv
INFO -     knob_value_string = row[value_index]

Enum Knob override in Profile CSV cannot have a leading space. Example:

Modify CfgData.xml in Q35 to add enum and enum knob. Same limitation doesn't exist for

   <Enums>
    <Enum name="EnableDisableCombo" help="">
      <Value name="Disabled" value="0" help="" />
      <Value name="Enabled"  value="1" help="" />
    </Enum>
   </Enums>
   
    <Knob name="ExampleEnum" type="EnableDisableCombo" default="Enabled" help="" />

in CfgData.csv, add override with leading space:

*,ExampleEnum, Disabled,00 00 00 00,
INFO -   File "C:\Code\mu_tiano_platforms\Features\CONFIG\SetupDataPkg\Tools\VariableList.py", line 365, in string_to_object
INFO -     raise ParseError(
INFO - VariableList.ParseError: Value ' Disabled' is not a valid value of enum 'EnableDisableCombo'

enum values are a maximum of uint32_t, which is in conflict with flexibility of yaml.
Would it be possible to specify a size for enums? or to increase their default size to uint64_t to account for larger values that need storing?

Solution Overview

Minor changes/improvements

Alternatives Considered

No response

Urgency

Low

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions