summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts
AgeCommit message (Collapse)AuthorFilesLines
2024-06-30BaseTools: BinToPcd: Remove xdrlib dependencyrelease/rpl_programJoey Vagedes1-4/+3
The xdrlib dependency was removed in commit 5cadb8ce2148979b6c464f6da5a8cd97425c5165 but the actual import of the module was not removed. This commit removes the import of xdrlib and sorts the imports. Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com>
2024-06-07BaseTools/Scripts: Fix PatchCheck commit rangeMichael D Kinney1-2/+0
Fix logic error that changes the commit range checked depending on the verbosity level set. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-05-28BaseTools/Scripts: Remove Cc: tag check from PatchCheck.pyMichael D Kinney1-2/+0
The commit message format requirements have been updated for GitHub PR based code reviews and no longer required Cc: tags for the maintainers and reviewers. Remove the Cc: tag check from PatchCheck.py. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-04-26BaseTools/GetUtcDateTime.py: Python 3.12 supportGua Guo1-1/+1
Ref to https://docs.python.org/3/whatsnew/3.12.html utcnow() and utcfromtimestamp() are deprecated Prevent use it cause build error. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-27BaseTools/Scripts/PatchCheck: Error if commit modifies multiple packagesMichael D Kinney1-1/+76
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4679 Update PatchCheck.py to evaluate all the files modified in each commit and generate an error if: * A commit adds/modifies files in multiple package directories * A commit adds/modifies files in multiple non-package directories * A commit adds/modifies files in both a package and a non-package directory * A commit deletes files from multiple package directories * A commit deletes files from multiple non-package directories * A commit deletes files from both a package and a non-package directory Modifications to files in the root of the repository are not evaluated. This check is skipped if PatchCheck.py is run on a patch file or input from stdin because this multiple package commit check depends on information from a git repository. If --ignore-multi-package option is set, then reduce the multiple package commit check from an error to a warning for all commits in the commit range provided to PatchCheck.py. Add check for a 'Continuous-integration-options:' commit message tag that allows one or more options to be specified at the individual commit scope to enable/disable continuous integration checks. This tag must start at the beginning of a commit message line and may appear more than once in a commit message. Add support for a Continuous-integration-options tag value of 'PatchCheck.ignore-multi-package' that reduces the multiple package commit check from an error to a warning for the specific commits that specify this option. Example: Continuous-integration-options: PatchCheck.ignore-multi-package The set of packages are found by searching for DEC files in a git repository. The list of DEC files in a git repository is collected with the following git command: git ls-files *.dec The set of files added/modified by each commit is found using the following git command: git diff-tree --no-commit-id --name-only --diff-filter=AM -r <commit> The set of files deleted by each commit is found using the following git command: git diff-tree --no-commit-id --name-only --diff-filter=D -r <commit> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Error if no Cc tags are presentMichael D Kinney1-2/+4
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4694 If no Cc tags are detected in a commit message, then generate an error. All patches sent for review are required to provide the set of maintainers and reviewers responsible for the directories/files modified. The set of maintainers and reviewers are documented in Maintainers.txt and can be retrieved using the script BaseTools/Scripts/GetMaintainer.py. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Return CommitMessageCheck errorsMichael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4693 Commit signatures are checked and error messages are logged but errors are not captured and returned from find_signatures() in the CommitMessageCheck class. This causes signature errors to be silently ignored by CI. Update logic in CommitMessageCheck class to return errors detected in commit message signatures. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2024-02-27BaseTools/Scripts/PatchCheck: Update Author checksMichael D Kinney1-1/+5
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4680 * Reject patches that match Author email "devel@edk2.groups.io" * Update the current check for " via Groups.Io" to perform a case insensitive match. It appears that groups.io has changed the format of this string to use all lower case. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-04BaseTools/Scripts/PatchCheck.py: Check for Change-idPierreGondois1-1/+17
Code review tools like gerrit might use a 'Change-id' tag to track the evolution of patches. This tag should be removed before submitting a patch to the mailing-list. It has been observed that contributors sometimes forget to remove this tag. Add a check in PatchCheck.py to automate this. Also add a '--ignore-change-id' command line parameter to ignore the above check. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Acked-by: Pedro Falcato <pedro.falcato@gmail.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2023-11-11BaseTools/Scripts/GetMaintainer: Sort output addressesMichael D Kinney1-4/+6
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 Sort the list of output addresses alphabetically so this script produces the same output even if the order of patches in a patch series is modified such that that order of files processed by this script changes. Use set() logic instead of OrderedDict to accumulate the list of unique addresses that are sorted alphabetically. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-11BaseTools/Scripts/GetMaintainer: Handle reviewer only caseMichael D Kinney1-4/+14
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 If a package only has reviewers and no maintainers, then also return the <default> maintainers. In order to detect this case, get_maintainers() is updated to return maintainers, reviews, and lists separately instead of a single merged list. This also allows this module to be used by other scripts that need to distinguish between maintainers, reviewers, and lists. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-11BaseTools/Scripts/GetMaintainer: refactor internal returns as dictsLeif Lindholm1-9/+10
To clean up interfaces, change the lookup functions to return dictionaries rather than multiple values. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-11-11BaseTools/Scripts/GetMaintainer: Simplify logicMichael D Kinney1-4/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 get_section_maintainers() either returns a list with valid entries or an empty list. It never returns None. Simplify logic that accumulates maintainers and lists by unconditionally appending lists returned from get_section_maintainers(). Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-11BaseTools/Scripts/GetMaintainer: Fix logic bug collecting maintainersMichael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 Fix logic bug where maintainers is incorrectly added to lists. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2023-11-06BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf filesRebecca Cran1-1/+4
Allow .rtf files created by applications such as Notepad to be committed as-is without further manual editing by skipping the requirements for CRLF, no tabs and no trailing whitespace. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Laszlo Ersek <lersek@redhat.com>
2023-08-02BaseTools: BinToPcd: Resolve xdrlib deprecationJoey Vagedes1-4/+15
Removes the dependency on xdrlib and replaces it with custom logic to pack a per the xdr requirements. Necessary as xdrlib is being deprecated in python 3.13. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Joey Vagedes <joeyvagedes@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-06-01BaseTools: make sure the got is emptyGerd Hoffmann2-0/+20
Add ASSERT()s that .got and .got.plt sections are empty to linker scripts for gcc and clang. Suggested-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
2023-05-05BaseTools: Remove VS2008-VS2013 remnantsRebecca Cran2-65/+1
Remove remnants of Visual Studio 2008-2013 support from Conf/tools_def.txt and various batch scripts. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-14BaseTools: Update SetupGit.py to add new 'fp' alias for patch formattingRebecca Cran1-0/+2
To help people format patches with the correct options, add an alias named 'fp' to SetupGit.py that runs format-patch with '-M --stat=1000 --stat-graph-width=20'. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-14BaseTools: Update PatchCheck.py to check for __FUNCTION__Rebecca Cran1-0/+6
New code should use the C99 macro __func__ instead of the pre-Standard macro __FUNCTION__. Update PatchCheck.py to reject patches with the latter. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-03BaseTools/PatchCheck.py: Add PCCTS to tab exemption listMichael Kubacki1-1/+4
Purdue Compiler Construction Tool Set (PCCTS) source code was copied/ pasted into BaseTools/Source/C/VfrCompile/Pccts/. The code contains tab characters instead of spaces. PatchCheck.py gives an error on modifications to files that contain tabs. The goal of my upcoming change there is not to mix tabs and spaces but to fix a bug while preserving its current formatting characters. This change adds that directory to the pre-existing list of directories in which tab checks are ignored in PatchCheck.py and also updates the check for makefiles to check for *.makefile: this allows {header,footer,app,lib}.makefile in BaseTools/Source/C/Makefiles to be detected and avoid having PatchCheck.py complain about tab characters. The check for "Makefile" is updated to be case-insensitive since there are some Makefiles named 'makefile' instead of 'Makefile'. Co-authored-by: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2023-01-30BaseTools: Remove CYGWIN_NT-5.1-i686 ref from Scripts/PatchCheck.pyRebecca Cran1-1/+0
With the removal of RVCT support and the related Bin/CYGWIN_NT-5.1-i686 and Darwin-i386 directories, remove a leftover reference to CYGWIN_NT-5.1-i686 from Scripts/PatchCheck.py. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Bob Feng <bob.c.feng@intel.com>
2022-10-22BaseTools/Scripts/PatchCheck.py: Allow tab in MakefileBob Feng1-0/+3
The syntax for Makefiles requires that indented lines s tart with a tab, but not a space. This change of PatchCheck.py make the patch for Makefile/GNUmakefile pass the PatchCheck.py. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-05-13BaseTools: Remove RVCT supportedk2-stable202205-rc1Rebecca Cran2-38/+0
RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-04-09BaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty PrintRebecca Cran1-0/+1044
https://bugzilla.tianocore.org/show_bug.cgi?id=3500 Use efi_debugging.py Python Classes to implement EFI gdb commands: efi_symbols, guid, table, hob, and devicepath You can attach to any standard gdb or kdp remote server and get EFI symbols. No modifications of EFI are required. Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py" Note you may also have to teach lldb about QEMU: -o "settings set plugin.process.gdb-remote.target-definition-file x86_64_target_definition.py" Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> 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: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-04-09BaseTools: Scripts/efi_gdb.py: Add gdb EFI commands and pretty PrintRebecca Cran1-0/+918
https://bugzilla.tianocore.org/show_bug.cgi?id=3500 Use efi_debugging.py Python Classes to implement EFI gdb commands: (gdb) help efi Commands for debugging EFI. efi <cmd> List of efi subcommands: efi devicepath -- Display an EFI device path. efi guid -- Display info about EFI GUID's. efi hob -- Dump EFI HOBs. Type 'hob -h' for more info. efi symbols -- Load Symbols for EFI. Type 'efi_symbols -h' for more info. efi table -- Dump EFI System Tables. Type 'table -h' for more info. This module is coded against a generic gdb remote serial stub. It should work with QEMU, JTAG debugger, or a generic EFI gdb remote serial stub. No modifications of EFI is required to load symbols. Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 gdb -ex "target remote localhost:9000" -ex "source efi_gdb.py" Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> 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: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2022-04-09BaseTools: efi_debugging.py: Add debugger agnostic dbg Python ClassesRebecca Cran1-0/+2185
Add Scripts/efi_debugging.py to provide debugger agnostic debugging utility Python classes. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> 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: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-11-08BaseTools: Fix StructurePcd offset error.Yuwei Chen1-2/+2
Currently when parse VFR files to get the struct info, BOOLEAN type struct is ignored, which caused offset errors. This patch fixed these bugs. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-10-14BaseTools: add edk2-test repo to SetupGit.pyHeinrich Schuchardt1-1/+4
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3066 The SctPkg is managed in repository https://github.com/tianocore/edk2-test. Make SetupGit.py usable for this repository. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-07-26BaseTools: Remove COMMON section from the GCC discard listChristopher Zurcher1-1/+0
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507 The COMMON section is used by OpenSSL assembly-optimized crypto functions. OpenSSL assembly code is auto-generated from the submodule and cannot be modified to remove dependence on the COMMON section. The default -fno-common compiler flag should still prevent variable from being emitted into the COMMON section. Cc: Ard Biesheuvel <ardb@kernel.org> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2021-07-22BaseTools/Scripts: Allow GitHub ID at end Maintainers.txt linesMichael D Kinney1-2/+4
* Update GetMaintainer.py to support an optional GitHub ID at the end of maintainer and reviewer lines. * Remove contents after email address from standard output * Fix minor issue in --lookup to convert file path separators from '\' to '/' to be compatible with regular expression file matching. 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>
2021-07-22BaseTools/Scripts: Fix GetMaintainer.py line endingsMichael D Kinney1-190/+190
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>
2021-07-12BaseTools: Remove non-ascii character of StructurePcd commentChen, Christine1-1/+9
Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd dsc file with comments from UNI file including non-ascii character. Following DSC spec, there should not have non-ascii character in DSC file. This patch removes the non-ascii character when adding the comment and changes the circle R to (R). Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-07-09BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.pyMichael D Kinney1-6/+12
Mergify adds merge commits to a PR when processing PRs using the queue feature with auto rebase. Update PatchCheck.py to ignore commit message issues with these merge commits. These merge commits are not added to the base branch when the PR is merged by Mergify. 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: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-06-04BaseTools: Update ClangBase.lds to keep dynamic sectionNi, Ray1-3/+2
The .dynamic section is needed for ELF runtime relocation. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-04BaseTools: Add ClangBase.lds for CLANG8 tool chain with max-page-sizeLiming Gao1-0/+79
LLVM LLD linker doesn't support common-page-size option. So, max-page-size is used. To not impact GCC tool chain, new ClangBase.lds is added. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
2021-03-08BaseTools: Modify struct parser for StructPcdYuwei Chen1-0/+2
Currently the struct parser for StructPcd Generation does not filter the types such as UINT8 which should be ignored successfully. This patch modifies this issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-03-08BaseTools: Adjust StructurePcd List Order.Chen, Christine1-3/+26
Currently StructurePcd.dsc have the list order issue. For a Pcd with several elements, the list indexs are used to distinguish these elements like this: PcdName.name.offset_name[0]|0x0 PcdName.name.offset_name[10]|0x0 PcdName.name.offset_name[11]|0x0 ... PcdName.name.offset_name[2]|0x0 ... However, the index is not strictly sorted by decimal numerical order, which is not user friendly. One more sort rule for index is added to the current rules to support for decimal numerical order in this patch. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-02-09BaseTools: Use pip module if available, CI uses it by defaultMatthew Carlson1-0/+1
Use the new edk2-basetools pip module. Includes a helpful message in setup to let users know which has been selected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei <Chen<yuwei.chen@intel.com> Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
2020-12-15BaseTools: Add comments in StructurePcd DSC file.Chen, Christine1-3/+12
Currently VFR files have variables comments which will not be added into StructurePcd.dsc file. Thus, it is not convenient for developer to Modify Pcds. To solve this problem, The comments will be modified to user friendly format and added after the corresponding Pcd values in StructurePcd.dsc file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-11-30BaseTools: Collect full Header files for struct finding.Chen, Christine1-6/+19
Currently, only parts of the Header files can be collected which caused some struct definition can not be found. To solve this issue, Header files full collection has been added in this file to support the struct finding. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-07-31Revert "BaseTools/PatchCheck.py: Add LicenseCheck"Leif Lindholm1-50/+0
This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace. This commit suggests inclusion of non-edk2+license content without a contribution agreement is something the community has made a decision on, which is incorrect. Cc: Shenglei Zhang <shenglei.zhang@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-07-24BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.Jiang, Guomin1-1/+1
If the submodule is upgraded, skip the CRLF check as it isn't change for file. Signed-off-by: Guomin Jiang <guomin.jiang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-07-20BaseTools/PatchCheck.py: Skip length check for user name in xxx-byShenglei Zhang1-1/+8
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2836 Current PatchCheck.py checks each line to ensure line's length is not larger than 76. But there's a case that length of user's name is much longer than that number. So enhance the script to handle this case. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-07-03BaseTools: explicitly import email.header PatchCheck.pyLeif Lindholm1-0/+2
On Debian 10 (Buster), when running PatchCheck.py with python2, a backtrace is printed, starting from: File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595, in find_patch_pieces parts = email.header.decode_header(pmail.get('subject')) AttributeError: 'module' object has no attribute 'header' When using python3, this backtrace does not appear. Explicitly importing email.header resolves this for python2 and does not appear to cause any issues with python3. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-07-03BaseTools/PatchCheck.py: add exception for diff orderfileLeif Lindholm1-4/+5
SetupGit.py adds BaseTools/Conf/diff.order as a diff orderfile, but that file currently has CRLF line endings, which causes all pattern matches to fail and the ordering remaining unaffected. Add an exception to PatchCheck.py (to the existing .gitmodules clause), so that we can merge the fix to the config file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-07-02BaseTools: PatchCheck: Exclude bash scripts from CRLF checkPierre Gondois1-1/+7
Bash scripts require LF line endings to work. PatchCheck.py checks that the files added in a patch have CRLF line endings. It excludes files ending with the ".sh" extension from this check. Some bash script don't have a ".sh" extension. Most of them are located in: - BaseTools/BinWrappers/PosixLike/ - BaseTools/Bin/CYGWIN_NT-5.1-i686/ This patch excludes these folder plus BaseTools/BuildEnv from this CRLF check. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-06-12BaseTools/PatchCheck.py: Add LicenseCheckShenglei Zhang1-0/+50
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2691 For files to be added to the tree, this feature will check whether it has BSD plus patent license. If not, licenses listed in Readme are also accepted but warning will be reported. Otherwise, it should be error. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-05-08BaseTools: add handling for 'S:' flag to GetMaintainer.pyLeif Lindholm1-0/+4
GetMaintainer.py already extracts the value of any S: tags for sections, but it doesn't do anything with that information. Print a warning message, with the status, for each matching section with a status explicitly set to anything other than 'Supported' or 'Maintained'. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-05-08BaseTools: add repo name option to SetupGit.pyRebecca Cran1-3/+9
Allow users who didn't clone one of the TianoCore repos from a canonical URL to specify the name of the repo (edk2, edk2-platforms or edk2-non-osi) when running SetupGit.py to allow them to configure their repo properly. The new option is: -n repo, --name repo set the repo name to configure for, if not detected automatically Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>