audk/.pytool/Plugin/GuidCheck
Michael D Kinney 61364ab927 .pytool: Add CI support for host based unit tests with results
https://bugzilla.tianocore.org/show_bug.cgi?id=2505

* Add plugin to build and run host based unit tests
* Add plugin that performs a DSC complete check DSC files
  used to build host based tests
* Update DscCompleteCheck plugin to ignore module INFs with
  a MODULE_TYPE of HOST_APPLICATION and library INFs that
  only support a module type of HOST_APPLICATION.
* Fix issues in XML reports from checkers.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
2020-02-07 19:18:53 +00:00
..
GuidCheck.py
GuidCheck_plug_in.yaml
Readme.md

Readme.md

Guid Check Plugin

This CiBuildPlugin scans all the files in a code tree to find all the GUID definitions. After collection it will then look for duplication in the package under test. Uniqueness of all GUIDs are critical within the UEFI environment. Duplication can cause numerous issues including locating the wrong data structure, calling the wrong function, or decoding the wrong data members.

Currently Scanned:

  • INF files are scanned for there Module guid
  • DEC files are scanned for all of their Protocols, PPIs, and Guids as well as the one package GUID.

Any GUID value being equal to two names or even just defined in two files is considered an error unless in the ignore list.

Any GUID name that is found more than once is an error unless all occurrences are Module GUIDs. Since the Module GUID is assigned to the Module name it is common to have numerous versions of the same module named the same.

Configuration

The plugin has numerous configuration options to support the UEFI codebase.

"GuidCheck": {
        "IgnoreGuidName": [],
        "IgnoreGuidValue": [],
        "IgnoreFoldersAndFiles": [],
        "IgnoreDuplicates": []
    }

IgnoreGuidName

This list allows strings in two formats.

  • GuidName
    • This will remove any entry with this GuidName from the list of GUIDs therefore ignoring any error associated with this name.
  • GuidName=GuidValue
    • This will also ignore the GUID by name but only if the value equals the GuidValue.
    • GuidValue should be in registry format.
    • This is the suggested format to use as it will limit the ignore to only the defined case.

IgnoreGuidValue

This list allows strings in guid registry format GuidValue.

  • This will remove any entry with this GuidValue from the list of GUIDs therefore ignoring any error associated with this value.
  • GuidValue must be in registry format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

IgnoreFoldersAndFiles

This supports .gitignore file and folder matching strings including wildcards

  • Any folder or file ignored will not be parsed and therefore any GUID defined will be ignored.
  • The plugin will always ignores the following ["/Build", "/Conf"]

IgnoreDuplicates

This supports strings in the format of GuidName=GuidName=GuidName

  • For the error with the GuidNames to be ignored the list must match completely with what is found during the code scan.
    • For example if there are two GUIDs that are by design equal within the code tree then it should be GuidName=GuidName
    • If instead there are three GUIDs then it must be GuidName=GuidName=GuidName
  • This is the best ignore list to use because it is the most strict and will catch new problems when new conflicts are introduced.
  • There are numerous places in the UEFI specification in which two GUID names are assigned the same value. These names should be set in this ignore list so that they don't cause an error but any additional duplication would still be caught.