Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BaseTools: Detect library class mismatch [REBASE&FF] (#499)
## Description Performs a check that will verify that the library instance implements the specified library by ensuring a LIBRARY_CLASS definition exists in the INF [Defines] section matches the library. That is to say, for the following example: `TestLib|Path/To/BaseTestLib.inf`, that BaseTestLib.inf has `LIBRARY_CLASS = TestLib` defined in the [Defines] section. Changes the previous check for library overrides to be a warning instead of an error. - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested Built multiple platforms to confirm warning showed properly. ## Integration Instructions While no Integration is required, a new build warning will be seen in the build log. The warning is in the following format: `$(DSC_PATH): warning: $(INF) does not support LIBRARY_CLASS $(LIBRARY_CLASS)` where `$(DSC_PATH)` is the DSC being built, `$(INF)` is the INF described in the DSC, and `$(LIBRARY_CLASS)` is the name of the library class that the INF is attempting to represent. (i.e., `$(LIBRARY_CLASS)|$(INF)` or `TestLib|Path\to\BaseTestLib.inf`). To resolve these errors, verify the library class is real (The Library class should have a header file associated with it in the DEC of the defining package). If it is real, then ensure the library instance truly implements the library class and add it to the DEFINE section of the library INF. If not, update the DSC to use the correct library class. If this warning appears, it will appear at the beginning of the build command: INFO - Processing meta-data . INFO - Architecture(s) = IA32 X64 INFO - Build target = DEBUG INFO - Toolchain = VS2022 INFO - INFO - Active Platform = c:\src\Path\Platform.dsc INFO - build... INFO - c:\src\Path\Platform.dsc(...): warning: c:\src\Path\BaseTestLib.inf does not support LIBRARY_CLASS TestLib
- Loading branch information