edk2/BaseTools/Source/Python/AutoGen
levi.yun 40a45b5a2b Basetools: Include PCD declarations from Library Instance
The patch "[PATCH v3 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver
architecture independent" (https://edk2.groups.io/g/devel/message/109178)
removed ArmPkg/ArmPkg.dec from the Packages section in the
INF file: StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf

This change was done as part of making the StandaloneMmCpu driver
architecture independent.

Although this change is correct, it results in a side effect
here some platforms that utilise PCDs declared in ArmPkg.dec are
no longer declared.

An example of this issue can be seen when building
edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc

$ build -a AARCH64 -t GCC -p Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
build.py...
/mnt/source/edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf(23):
  error F001: PCD (gArmTokenSpaceGuid.PcdFdBaseAddress) used in
  FDF is not declared in DEC files.

As seen above, removing ArmPkg.dec from the Packages section in the
StandAloneMmCpu Driver Inf file triggers build failure.
Although, ArmPkg.dec is included in other Library Instances,
the build system does not include the declarations from
.dec files defined in Library instances.

The build system only includes the PCD declarations from DEC files
that are specified in INF files for Modules (components).

Therefore, extend the build system to include the Packages from
Library Instances so that the PCD declarations from the respective package
DEC files are included.

This patch can be seen on
    https://github.com/LeviYeoReum/edk2/tree/levi/2848_dec_check_on_library

Signed-off-by: levi.yun <yeoreum.yun@arm.com>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-01-31 10:58:05 +00:00
..
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
AutoGen.py BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
AutoGenWorker.py BaseTools: Move gPlatformFinalPcd to Datapipe and optimize size 2022-04-22 13:55:16 +00:00
BuildEngine.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
DataPipe.py BaseTools: Move gPlatformFinalPcd to Datapipe and optimize size 2022-04-22 13:55:16 +00:00
GenC.py BaseTools: Add EDKII_DSC_PLATFORM_GUID MACRO 2020-10-13 02:35:08 +00:00
GenDepex.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
GenMake.py BaseTools: Fix raw strings containing valid escape characters 2024-01-10 13:54:01 +00:00
GenPcdDb.py BaseTools: Fix the improper error logging 2021-01-06 02:57:38 +00:00
GenVar.py BaseTools: Fix wrong variable header size 2022-01-13 09:35:35 +00:00
IdfClassObject.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
IncludesAutoGen.py BaseTools: Resolve index out of range errors. 2020-11-19 02:22:57 +00:00
InfSectionParser.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
ModuleAutoGen.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
ModuleAutoGenHelper.py BaseTools: Fix New Target/ToolChain/Arch in DSC [BuildOptions] issues 2021-05-03 18:16:23 +00:00
PlatformAutoGen.py BaseTools: Fix DSC override of Guided tool 2021-05-10 23:28:58 +00:00
StrGather.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
UniClassObject.py python: Replace distutils.utils.split_quotes with shlex.split 2021-08-02 03:09:59 +00:00
ValidCheckingInfoObject.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
WorkspaceAutoGen.py Basetools: Include PCD declarations from Library Instance 2024-01-31 10:58:05 +00:00