summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/build/build.py
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Remove duplicated words in Python toolsPierre Gondois2022-10-191-1/+1
| | | | | | | | | | In an effort to clean the documentation of the above package, remove duplicated words. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
* BaseTools: Remove hard-coded strings for target and tools_defPierre Gondois2021-09-291-4/+0
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653 The "target.txt" and "tools_def.txt" filenames are hard-coded at some places when global definitions are available at: BaseTools/Source/Python/Common/TargetTxtClassObject.py: DefaultTargetTxtFile and BaseTools/Source/Python/Common/ToolDefClassObject.py: DefaultToolsDefFile Use these global definitions instead. Also remove the unused gBuildConfiguration and gToolsDefinition variables from build.py Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove Makefile/MakefileName fieldsPierre Gondois2021-09-291-2/+0
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653 The Makefile and MakefilName fields are never set/used. Remove them. To check this, the following commands can be used: - grep -rIn "\.Makefile" - grep -rIn "\.MakefileName" Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/build: Set MakefileNamePierre Gondois2021-09-291-1/+4
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653 Running the following command: python3 build/build.py -a AARCH64 -t GCC5 -p ArmPlatformPkg/ArmPlatformPkg.dsc -b DEBUG libraries triggers the following error: make: *** Build/ArmPlatform/DEBUG_GCC5/AARCH64/MdePkg/Library/ BasePcdLibNull/BasePcdLibNull: Is a directory. Stop. Indeed, MakefileName is set to en empty string. Setting MakefileName resolves the error. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* build: Fix python3.10 threading DeprecationWarningsCole2021-08-021-24/+24
| | | | | | | | | threading camelCase functions have preferred alternatives since python2.6. python3.10 has started emitting DeprecationWarnings for them Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: build: Set ReturnCode on POSTBUILD failGarrett Kirkendall2021-05-211-0/+1
| | | | | | | | | | | | | | | When build.by POSTBUILD handling section returns other than 0, set ReturnCode to POSTBUILD_ERROR so build.py exits with return code other than 0. Fix for https://bugzilla.tianocore.org/show_bug.cgi?id=1977 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Garrett Kirkendall <garrett.kirkendall@amd.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix DSC override of Guided toolMichael D Kinney2021-05-101-18/+34
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 If the DSC file provides an override of a Guided tool path and/or Guided tool GUID value, then make sure the one from the DSC file is used if it is higher priority than the Guided tool in the tools_def.txt file. This makes the Guided tool used by GenFds match the tool listed GuidedSectionTools.txt. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix New Target/ToolChain/Arch in DSC [BuildOptions] issuesMichael D Kinney2021-05-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 * Save/Restore global state in GetToolChainAndFamilyFromDsc() This resolves an issue where the multi-arch build for UefiPayloadPkg would skip the autogen and build of IA32 components. * Expand tools wildcard. This resolves the issue where autogen makefile contents would have a BUIDLRULEFAMILY tools definitions with an '*' in the tool field that breaks the build from invalid makefile syntax. * Build rule family higher priority than Family. This resolves the issue where flags were appended from both the BUILDRULEFAMILY and FAMILY when only BUILDRULEFAMILY should be appended when present. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Andrew Fish <afish@apple.com>
* BaseTools/Source/Python: New Target/ToolChain/Arch in DSC [BuildOptions]Michael D Kinney2021-04-291-33/+78
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 Update BaseTools to support new build targets, new tool chains, and new architectures declared in DSC file [BuildOptions] sections. * Do not expand * when tools_def.txt is parsed. Only expand when both tools_def.txt and DSC [BuilsOptions] sections have been parsed. This also requires more flexible matching of tool keys that contain * in tool key fields. * Pre-scan the platform DSC file for FAMILY and TOOLCHAIN declarations DSC in [BuildOptions] sections before the FAMILY and TOOLCHAIN need to be known. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move CreateAsBuiltInf into AutoGenWorker for parallelBob Feng2020-08-141-3/+1
| | | | | | | | | | | AsBuiltInf can be created during AutoGen phase. Move CreateAsBuiltInf into AutoGenWorker to make this step run in parallel. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Improve the method of checking queue emptyFeng, Bob C2020-08-071-1/+2
| | | | | | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2807 The Queue.empty() method is not reliable in the multiple process runtime environment. This patch uses a new method to check if all modules are processed and workers need to be stopped. That is to add a None item at the bottom of the queue. Worker check if it gets that None item to know if all the module is processed. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Lucy Yan <lucyyan@google.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/build.py: Exit with 1 when AutoGen error occurredIrene Park2020-06-071-2/+4
| | | | | | | | | | | AutoGen manager/workers halt the progress when an error occurs but doesn't propagate the error code to main and allows main exit with 0 and gets the build system unable to catch the occurrence of an error. This change informs main with an error when a progress is halted and helps main exit with 1. Signed-off-by: Irene Park <ipark@nvidia.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools:Add the spare space FV image size checkerFan, Zhiju2020-04-231-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2654 If FV is placed in FD region, its FV image size is fixed. When FV image size exceeds it, it will trig the build break. To alert the developer to adjust FV image size earlier, I request to add new checker for the the spare FV space. When the spare FV space is less than the specified threshold, build tool will report the error. This checker is the optional. It can be enabled by -D FV_SPARE_SPACE_THRESHOLD=10000. Macro is the value of the spare space threshold size. It can be decimal or hex format. If it is enabled, BaseTools will check every FV with the fixed size. If FV doesn't meet with the size requirement, Build tool will report error message to say there is no enough spare space. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:GuidedSectionTools.txt is not generated correctlyFan, ZhijuX2020-03-311-13/+3
| | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2538 For LzmaCompress or BrotliCompress, the platform may use the different options and add their batch file, such as LzmaCompressPlatform. Then, specify it in platform.dsc [BuildOptions] to override the default one in tools_def.txt. *_*_*_LZMA_PATH = LzmaCompressPlatform This override tool will be used. But, its name is not specified in the generated GuidedSectionTools.txt. Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Rationalise makefile generationPierre Gondois2020-02-121-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GenMake.py script tests the platform environment to determine the type of makefile that needs to be generated. If a Windows build host is detected, the makefile generated is of Nmake type. Otherwise a GNUmake type is generated. Furthermore, the <TARGET>_<TAGNAME>_<ARCH>_MAKE_PATH option in tools_def.template defines the make tool to use. E.g.: for VS2017 this is configured to use Nmake, cf. *_VS2017_*_MAKE_PATH = DEF(VS2017_BIN_HOST)\nmake.exe while for GCC5 it is setup to use GNU make. *_GCC5_*_MAKE_PATH = DEF(GCC_HOST_PREFIX)make This prevents using the GCC compiler toolchain on a Windows build host. To address this issue this patch introduces 2 factors to determine the generated makefile output. 1. Platform -> to determine shell commands used in makefile. 2. MakeTool -> to determine the type of makefile that needs to be generated. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fixed a incremental build bugBob Feng2020-01-191-1/+2
| | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2451 If removing a header file from source code and file system, the incremental build will fail. This patch is to fix this issue by setting each header file as a target without any actions in makefile. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools:Fix GenFds issue for BuildOption replace GenFdsOptionFan, ZhijuX2020-01-131-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2455 BuildOption is used by TargetTxtClassObj.py GenFdsOption is used by GenFds.py When the GenFds tool is used alone (e.g. python3 -m GenFds.GenFds -h) With the OptionParser function, the first detected function prints the help message import TargetTxtClassObj to GenFds, The BuildOption will be executed and replace GenFdsOption We removed all objects associated with this problem that were created directly during the import process (e.g. BuildOption, BuildTarget = MyOptionParser(), TargetTxt = TargetTxtDict()) The Patch is going to fix this issue Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Resolve a issue of Incremental buildBob Feng2019-12-181-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 In patch set 13c5e34a - 0c3e8e99, we implemented incremental build with using compiler/pre-processor generate dependent header file function. A issue is found for MSVC compiler, that the cl.exe /showIncludes build option generate header file list to either stdout or stderr. For .c file, the header file list is print out to stdout while for .vfr, .aslc and .nasm file, the file list is print out to stderr. The build tool use two threads to process the message from stdout and stderr, but to generate correct *.deps file, build tool need to combine the header file list from stderr and other messages from stdout together with correct time sequence order. So this patch is trying to combine the stdout and stderr together for the process which is for calling make program. The impact of this patch is that the output message of build with -q will be changed. The compiler error message will not print out. The build behavior of other log level setting will not be impacted. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix build failure when multiple build targets givenBob Feng2019-12-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2371 This patch is to fix a regression issue that build fails if multiple build targets given. Two changes cause this regression issue. One is AutoGen object __hash__ function only hash file path and arch, missing ToolChain and build target. The other is changing the multiple-thread-genfds function as default build behavior. To generate the genffs command to Makefile, there is a global data set is used, GenFdsGlobalVariable, which cause build tool use the data of first build-target build in the second build-target build. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Leverage compiler output to optimize binary cacheSteven Shi2019-12-101-156/+120
| | | | | | | | | | | | | | | | | Redesign the binary cache and bases on the compiler to output the dependency header files info for every module. The binary cache will directly consume the dependency header files info and doesn't parse the C source code by iteself. Also redesign the dependency files list format for module and try to share the common lib hash result as more as possible in local process. Remove the unnecessary share data access across multiprocessing. Signed-off-by: Steven Shi <steven.shi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Enhance Basetool for incremental buildBob Feng2019-12-101-14/+49
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Include dependency file in Makefile to enhance incremental build Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools:fix regression issue for platform .map fileFan, ZhijuX2019-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2363 This patch is to fix a build tool regression issue which was introduced by commit b8ac0b7f28.This issue caused map file lost the line of IMAGE=***. For example,in Ovmf.map, there is no line of (IMAGE=<path to efi> ) under each of modules item. The path to the efi file generated by each module is written on this line The purpose of this line is add the debug image full path. there is no information about the module in the map file other than FVName, it allows us to quickly know which module this part corresponds to. In commit b8ac0b7f28,add a line ("self.BuildModules = []") in function, but it's used to calculate the variable ModuleList in the following code. Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix build failure when using python38Ni, Ray2019-11-131-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2304 Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Bob C Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:Replace PlatformInfo with PlatformAutoGen for MoudleFan, ZhijuX2019-09-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2188 build -p MdeModulePkg\MdeModulePkg.dsc -a IA32 -m MdeModulePkg\Universal\PCD\Pei\Pcd.inf Error: AttributeError: 'PlatformInfo' object has no attribute 'DynamicPcdList' The DSC data object used to build a separate module today is PlatformInfo rather than PlatformAutoGen 'PlatformAutoGen' object has attribute 'DynamicPcdList' This patch is going to fixed this issue Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fixed a bug of IgnoreAutoGenFeng, Bob C2019-09-121-0/+1
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2080 After checking that if the build can't ignore Autogen due to there is no compelet autogen files, the build tool need to do a completely Autogen. This patch is to fix a bug that if AutoGen can't be skiped, the SkipAutoGen flag need to set to False Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enable --genfds-multi-thread to default buildFeng, Bob C2019-09-111-1/+1
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1302 This patch enable --genfds-multi-thread to default build. This patch keep --genfds-multi-thread build option for compatibility and also add a new build option to disable genfds-multi-thread as --no-genfds-multi-thread. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed the bug of multi-thread genffs for override infFeng, Bob C2019-09-111-4/+4
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1302 If there is a inf override, and multi-thread genffs is enabled, build will fail. This patch is going to fix this bug. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed issue for IgnoreAutoGenFeng, Bob C2019-09-101-132/+219
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2080 This patch is to improve build -u option to re-use GlobalVar_<platformguid>_<arch>.bin file which is introduced by multiple-process-autogen feature. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed build clean regression issueFeng, Bob C2019-09-101-5/+3
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2166 file_lock and cache_lock are used as global data, so move file_lock and cache_lock initialization in Build object __init__ function. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix incremental build genmake issueFeng, Bob C2019-08-231-1/+2
| | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2090 This is a regression issue introduced by commit e8449e. This patch is going to fix this issue. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Improve the file saving and copying reliabilityShi, Steven2019-08-201-1/+4
| | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2079 The Basetool CopyFileOnChange() and SaveFileOnChange() functions might raise the IOError occasionally when build in Windows with multi-process and build cache enabled. The CopyFileOnChange() and SaveFileOnChange() might be invoked in multiple sub-processes simultaneously, and this patch adds global locks to sync these functions invoking which can harden their reliability. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Change the [Arch][Name] module key in Build cacheShi, Steven2019-08-201-28/+20
| | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1951 Current build cache use the module's [self.Arch][self.Name] info as the ModuleAutoGen object key in hash list and dictionary. The [self.Arch][self.Name] is not safe as the module key because there could be two modules with same module name and arch name in one platform. E.g. A platform can override a module or library instance in another different path, the overriding module can has the same module name and arch name as the original one. Directly use the ModuleAutoGen obj self as the key, because the obj __hash__ and __repr__ attributes already contain the full path and arch name. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Improve the cache hit in the edk2 build cacheShi, Steven2019-08-201-28/+101
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1927 Current cache hash algorithm does not parse and generate the makefile to get the accurate dependency files for a module. It instead use the platform and package meta files to get the module depenedency in a quick but over approximate way. These meta files are monolithic and involve many redundant dependency for the module, which cause the module build cache miss easily. This patch introduces one more cache checkpoint and a new hash algorithm besides the current quick one. The new hash algorithm leverages the module makefile to achieve more accurate and precise dependency info for a module. When the build cache miss with the first quick hash, the Basetool will caculate new one after makefile is generated and then check again. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move buildoptions.py to Common folderBob Feng2019-08-141-1/+1
| | | | | | | | | | buildoptions is used by build.py and TargetTxtClassObj.py Move buildoptions.py to Common folder so that build tool and ECC tool work fine. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enable block queue log agent.Feng, Bob C2019-08-091-18/+21
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 To support Ctrl+S and Ctrl+Q, we enable block queue for log. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Move BuildOption parser out of build.pyFeng, Bob C2019-08-091-103/+5
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 Build tool supports user to specify the conf folder. To make the build options be evaluated at the beginning of launching build, extract the buildoption function from build.py to a new .py file. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add LogAgent to support multiple process AutogenFeng, Bob C2019-08-091-8/+19
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 AutoGen processes race the logfile. To resolve this issue, this patch create a LogAgent thread in main process to write the log content to console or file, Other process will send the log content to the LogAgent. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add shared data for processesFeng, Bob C2019-08-091-4/+6
| | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 Add shared data for autogen processes. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enable Multiple Process AutoGenFeng, Bob C2019-08-091-44/+83
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 Assign the Module AutoGen tasks into multiple sub process. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Decouple AutoGen ObjectsFeng, Bob C2019-08-091-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 1. Separate the AutoGen.py into 3 small py files. One is for AutoGen base class, one is for WorkspaceAutoGen class and PlatformAutoGen class, and the one for ModuleAutoGen class. 2. Create a new class DataPipe to store the Platform scope settings. Create a new class PlatformInfo to provide the same interface as PlatformAutoGen. PlatformInfo class is initialized by DataPipe instance. Create a new class WorkspaceInfo to provide the same interface as WorkspaceAutoGen. WorkspaceInfo class is initialized by DataPipe instance. 3. Change ModuleAutoGen to depends on DataPipe, PlatformInfo and WorkspaceInfo. Remove the dependency of ModuleAutoGen to PlatformAutoGen. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Singleton the object to handle build conf fileFeng, Bob C2019-08-091-23/+6
| | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 The build config files are target.txt, build rule, tooldef During a build, the config is not changed, so the object to handle them need to be singleton. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Create ".cache" folder when initialize Build objectFeng, Bob C2019-07-221-1/+2
| | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1986 Create "Conf/.cache" folder as early as possible so that the later code do need to check if it exits and then create it. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix python3.8 SyntaxWarningCole Robinson2019-07-151-1/+1
| | | | | | | | | | | | | | Building with python3.8 shows a warning like: SyntaxWarning: invalid escape sequence \( GuidName = re.compile("\(GUID=[-a-fA-F0-9]+") It seems harmless, but it's easy enough to fix: mark the string as raw with the 'r' prefix like is used elsewhere in the file Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move Build Cache related function out of CreateAsBuiltInfBob Feng2019-06-251-6/+22
| | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1932 There are two functions in current CreateAsBuiltInf, Copy Binary files to build cache folder and create asbuild inf file. This patch is to separate UpdateBuildCache and CreateAsBuiltInf into two functions. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Christian Rodriguez <christian.rodriguez@intel.com> Reviewed-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools: refine CreateAsBuiltInf functionBob Feng2019-06-251-2/+4
| | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1932 ModuleAutogen.CreateAsBuiltInf IsOnlyCopy parameter and related function can be moved out of CreateAsBuiltInf, so that CreateAsBuiltInf is more clean. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Christian Rodriguez <christian.rodriguez@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools:Build Cache output notification messageShi, Steven2019-06-171-0/+10
| | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1868 Build need output the cache miss or hit notification message when consume the build cache. Current build does not output any message which is not clear for user to know whether the module built result is from cache or not. This patch adds message about the cache miss or hit when build consumes the cache. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Zhiju.Fan <zhijux.fan@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Refactor hash tracking after checking for Sources sectionRodriguez, Christian2019-06-101-24/+41
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1804 After adding a check to see if [Sources] section lists all the header type files of a module, track module and library hashes for --hash feature. If above check is not in compilance for a library or module, force hash invalidation on that library or module. Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove './SecMain' from 'run' targetBob Feng2019-05-241-4/+0
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1561 This patch is related to commit 9ca1f1 It's to remove the second .SecMain call from 'run' target. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools: Remove './SecMain' from 'run' targetFeng, Bob C2019-05-221-4/+0
| | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1561 When a target of 'run' is passed into build.py, BaseTools unconditionally attempts to execute the application called './SecMain' in the build output directory. This behavior applies to the Nt32Pkg which is being replaced with features in the EmulatorPkg. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools:Update mailing list address in BaseTools error messagesFan, ZhijuX2019-05-221-1/+1
| | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1815 The edk2 source tree contains four instances of the outdated mailing list address "edk2-devel@lists.01.org". I created a new variable, MSG_EDKII_MAIL_ADDR, to receive the new email address and replaced the old one with this variable Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>