audk/BaseTools/Source/Python
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
..
AmlToC BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
AutoGen Basetools: Include PCD declarations from Library Instance 2024-01-31 10:58:05 +00:00
BPDG
Capsule BaseTools/Capsule: Support signtool input subject name to sign capsule file 2022-07-27 05:00:06 +00:00
Common BaseTools: Fix raw strings containing valid escape characters 2024-01-10 13:54:01 +00:00
CommonDataClass BaseTools: Add support for SUBTYPE_GUID section generation 2022-10-19 06:32:07 +00:00
Ecc BaseTools: Remove duplicated words in Python tools 2022-10-19 06:32:07 +00:00
Eot
FMMT BaseTools: FMMT GuidTool Auto Select Config file Enabling 2023-12-20 22:59:03 +00:00
FirmwareStorageFormat BaseTools: FMMT support ELF UPLD parser 2023-12-11 10:12:52 +00:00
GenFds BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
GenPatchPcdTable BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
PatchPcdValue BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
Pkcs7Sign
Rsa2048Sha256Sign
Split BaseTools: use shutil.copyfile instead shutil.copy2 2021-08-02 03:52:15 +00:00
Table
TargetTool BaseTools: Remove hard-coded strings for target and tools_def 2021-09-29 14:31:37 +00:00
Trim BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
UPT BaseTools: Updated build tools to support new LoongArch. 2022-10-14 02:16:33 +00:00
Workspace BaseTools: Fix raw strings containing valid escape characters 2024-01-10 13:54:01 +00:00
build BaseTools: Extend fields for module_report.json 2023-03-11 06:21:49 +00:00
tests/Split BaseTools: fix the split output files root dir 2021-02-07 01:46:18 +00:00
GNUmakefile
Makefile BaseTools: strip trailing whitespace 2019-10-04 11:18:22 +01:00
README.md BaseTools: Use pip module if available, CI uses it by default 2021-02-09 03:56:37 +00:00
basetool_tiano_python_path_env.yaml BaseTools: Add YAML files with path env and tool extdeps 2019-11-11 13:01:53 -08:00
sitecustomize.py BaseTools: Do not call sys.setdefaultencoding with python 3 2019-10-23 14:25:23 +08:00

README.md

Edk2 Basetools

This folder has traditionally held the source of Python based tools used by EDK2. The official repo this source has moved to https://github.com/tianocore/edk2-basetools. This folder will remain in the tree until the next stable release (expected 202102). There is a new folder under Basetools BinPipWrappers that uses the pip module rather than this tree for Basetools. By adding the scope pipbuild-win or pipbuild-unix (depending on your host system), the SDE will use the BinPipWrappers instead of the regular BinWrappers.

Why Move It?

The discussion is on the mailing list. The RFC is here: https://edk2.groups.io/g/rfc/topic/74009714#270 The benefits allow for the Basetools project to be used separately from EDK2 itself as well as offering it in a globally accessible manner. This makes it much easier to build a module using Basetools. Separating the Basetools into their own repo allows for easier CI and contribution process. Additional pros, cons, and process can be found on the mailing list.

How Do I Install It?

By default, EDK2 is tied to and tested with a specific version of the Basetools through pip-requirements.txt. You can simply run:

pip install -r pip-requirements.txt

This will install the required module, thought we strongly suggest setting up a virtual environment. Additionally, you can also install a local clone of the Basetools as well as a specific git commit.