<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/BaseTools/Tests, branch dependabot/github_actions/github/codeql-action-4</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2025-06-07T17:56:04+00:00</updated>
<entry>
<title>BaseTools: Add support for mingw-w64</title>
<updated>2025-06-07T17:56:04+00:00</updated>
<author>
<name>Nate DeSimone</name>
<email>nathaniel.l.desimone@intel.com</email>
</author>
<published>2025-06-06T23:04:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=c0ef2b017855177903d87937ac4cdaec5c7851db'/>
<id>urn:sha1:c0ef2b017855177903d87937ac4cdaec5c7851db</id>
<content type='text'>
Adds support for building the C language BaseTools for Windows using
toolchains based on mingw-w64.

Mingw-w64 is a collection of header files, libraries, and tools that
when combined with a compiler enable development of Windows software.
Mingw-w64 is a fork of the original MinGW (Minimalist GNU for Windows).
Most active development on MinGW has ceased and mingw-w64 is now the
actively maintained successor.  Mingw-w64 provides a libc implementation
built on top of Microsoft's UCRT (Universal C Runtime) with all
nessesary compiler bindings needed to support the C++11 feature set.

Modern mingw-w64 development appears to have coalesced around MSYS2,
which produces a distributions of both GCC and LLVM/Clang that use
mingw-w64 to target the Windows OS. This MSYS2 Clang distribution has a
UNIX-like directory layout and includes Windows binaries of GNU Make.
Combined with the open source licensing, MSYS2's Clang distribution is a
highly attractive choice as an alternative Windows SDK for open source
projects such as TianoCore.

If one wishes to use EDK II to build UEFI firmware on the Windows
platform, then the C BaseTools need to be compiled as Windows
applications. This includes the PcdValueInit.exe program, which needs
to be recompiled every time a firmware build is run in order to
regenerate the initial values for structured PCDs. Currently, BaseTools
only supports the Visual C++ toolchain on the Windows platform. The
following new features have been added to enable usage of the toolchains
derived from mingw-w64:

 - Fixes to the BaseTools C source code to support the use of a
   GCC-style compiler on the Windows OS.
 - The GNU Make-style Makefiles for the C BaseTools have been modified
   to support Windows. Both GCC + mingw-w64 and Clang + mingw-w64 have
   been tested and confirmed to build a working BaseTools.
 - BaseTools now supports generating GNU Make-style Makefiles on the
   Windows platform for the purpose of building firmware.
 - edksetup.bat has been modified to optionally build BaseTools via
   mingw-w64. There is no impact to the existing support for Visual C++
   and Visual C++ remains the default toolchain.

Usage Instructions:

For the vast majority of users, the only system setup change nessesary
to use a mingw-w64 toolchain is to set the BASETOOLS_MINGW_PATH to the
directory containing the desired mingw-w64 based toolchain.

A new command line argument has been added to edksetup.bat: Mingw-w64
If this command line argument is set, then the script will set the
BASETOOLS_MINGW_BUILD environment variable. The user can also opt to set
this environment variable manually before running edksetup.bat

If BASETOOLS_MINGW_BUILD is defined, then the BASETOOLS_MINGW_PATH
environment variable must point to the directory containing the
mingw-w64 toolchain.

If CLANG_BIN is not defined and %BASETOOLS_MINGW_PATH%\bin\clang.exe
exists, then edksetup.bat will set CLANG_BIN=%BASETOOLS_MINGW_PATH%\bin\
This removes the requirement to configure the CLANG_BIN environment
variable manually in order to run a CLANGPDB or CLANGDWARF build if one
has the MSYS2 Clang distribution installed. If one wishes to use a
different copy of Clang (for example official LLVM binaries) to build
firmware and only use the MSYS2 Clang to build BaseTools, then one can
continue to set the CLANG_BIN environment variable, same as before. I
have tested the MSYS2 Clang distribution against the official LLVM
distribution and can confirm that if the compiler version is the same
the emitted machine code is identical between the two. Interestingly,
the MSYS2 Clang distribution emits the path to the PDB file using "/" as
the path seperator instead of "\". That appears to be the only
difference in output. Therefore, using the MSYS2 Clang distribution to
compile firmware seems a reasonable choice.

If CLANG_HOST_BIN is not defined and BASETOOLS_MINGW_BUILD is defined
and %BASETOOLS_MINGW_PATH%\bin\mingw32-make.exe exists, then
edksetup.bat will add %BASETOOLS_MINGW_PATH%\bin\ to the PATH and set
CLANG_HOST_BIN=mingw32-
This enable usage of the GNU Make included in the mingw-w64 toolchain
to build firmware in addition to BaseTools. if BASETOOLS_MINGW_BUILD is
not defined, edksetup.bat will continue to set CLANG_HOST_BIN=n, which
uses nmake to build firmware. This behavior can be overridden by
manually setting the value of CLANG_HOST_BIN before executing
edksetup.bat if one wishes to use a specific Make utility for the
CLANGPDB/CLANGDWARF toolchains.

References:
 - https://www.mingw-w64.org/
 - https://www.msys2.org/

Co-authored-by: Sandesh Jain &lt;sandesh.jain@intel.com&gt;
Signed-off-by: Nate DeSimone &lt;nathaniel.l.desimone@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Add Unit Test Support for X64 BaseTools on Windows</title>
<updated>2025-06-07T17:56:04+00:00</updated>
<author>
<name>Nate DeSimone</name>
<email>nathaniel.l.desimone@intel.com</email>
</author>
<published>2025-05-30T23:56:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=18fdec11b1ab6475d1c3f328953f225547983dd5'/>
<id>urn:sha1:18fdec11b1ab6475d1c3f328953f225547983dd5</id>
<content type='text'>
Fixes a BaseTools Bin directory path detection bug in the the BaseTools
Unit Tests. The script incorrectly assumes that sys.platform
will be win64 on a 64-bit Python interperter.
The "win64" platform string has not been used for 64-bit Python
interperters since May 10, 2000:

https://github.com/python/cpython/commit/da5cc82d

Moreover, this patch was merged before the Python 2.0 release, so there
never has been a released Python interperter that used the "win64"
string.

Signed-off-by: Nate DeSimone &lt;nathaniel.l.desimone@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Update Tests/TestTools.py to allow it to work on Windows</title>
<updated>2023-05-11T02:14:12+00:00</updated>
<author>
<name>Rebecca Cran</name>
<email>rebecca@bsdio.com</email>
</author>
<published>2023-05-06T11:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=77f75c7fb8388a1429374419c823d70fc4cf3881'/>
<id>urn:sha1:77f75c7fb8388a1429374419c823d70fc4cf3881</id>
<content type='text'>
On Windows, executables have a '.exe' suffix which needs to be added for
them to be found in a path.

Also, files need to be explicitly opened as binary.

Signed-off-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver</title>
<updated>2023-05-08T19:03:18+00:00</updated>
<author>
<name>Rebecca Cran</name>
<email>rebecca@bsdio.com</email>
</author>
<published>2023-04-24T17:10:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=5215cd5baf6609e54050c69909273b7f5161c59e'/>
<id>urn:sha1:5215cd5baf6609e54050c69909273b7f5161c59e</id>
<content type='text'>
Update toolsetup.bat and Tests/PythonTest.py to check if we're running a
version of Python that's compatible with BaseTools and the Pip
BaseTools.

BaseTools uses syntax from Python 3.6 or newer, so set that as the minimum
version EDK2 requires.

Signed-off-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>BaseTools/Tests: Use quotes around PYTHON_COMMAND</title>
<updated>2022-10-24T13:04:40+00:00</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ardb@kernel.org</email>
</author>
<published>2022-10-24T06:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=acb2acccfdd34a6643e7a203e68cbe7e523a4a02'/>
<id>urn:sha1:acb2acccfdd34a6643e7a203e68cbe7e523a4a02</id>
<content type='text'>
Commit ("2355f0c09c52 BaseTools: Fix check for ${PYTHON_COMMAND} in
Tests/GNUmakefile") fixed a latent issue in the BaseTools/Tests
Makefile, but inadvertently broke the BaseTools build for cases where
PYTHON_COMMAND is not set. As it turns out, running 'command' without a
command argument makes the invocation succeed, causing the empty
variable to be evaluated and called later.

Let's put double quotes around PYTHON_COMMAND in the invocation of
'command' and force it to fail when PYTHON_COMMAND is not set.

Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Fix check for ${PYTHON_COMMAND} in Tests/GNUmakefile</title>
<updated>2022-10-22T07:52:20+00:00</updated>
<author>
<name>Rebecca Cran</name>
<email>rebecca@bsdio.com</email>
</author>
<published>2022-09-19T21:39:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=2355f0c09c52d6979f9f471b23816f3081cc946b'/>
<id>urn:sha1:2355f0c09c52d6979f9f471b23816f3081cc946b</id>
<content type='text'>
When checking if $PYTHON_COMMAND exists, curly braces should
be used instead of parentheses.

Also, "1" causes an error on FreeBSD: it's likely supposed to
be 2&gt;&amp;1 like other scripts.

Signed-off-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Drop check for distutils.utils</title>
<updated>2021-08-02T03:09:59+00:00</updated>
<author>
<name>Cole</name>
<email>crobinso@redhat.com</email>
</author>
<published>2021-07-23T20:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=fc50df0d8eb5331b6641daeedd7f05ae75014ece'/>
<id>urn:sha1:fc50df0d8eb5331b6641daeedd7f05ae75014ece</id>
<content type='text'>
distutils.utils is no longer used anywhere, so this check can
be dropped.

Signed-off-by: Cole Robinson &lt;crobinso@redhat.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
Reviewed-by: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "BaseTools:code of test python module is moved to edksetup"</title>
<updated>2019-05-09T11:02:35+00:00</updated>
<author>
<name>Fan, ZhijuX</name>
<email>zhijux.fan@intel.com</email>
</author>
<published>2019-05-09T06:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=49693202ec9cf2990507adeb5e088553dfcdc743'/>
<id>urn:sha1:49693202ec9cf2990507adeb5e088553dfcdc743</id>
<content type='text'>
This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80.

In commint df7c81b5b219c9,used a function to test python module
But the Boolean value of the return value of this function is the
opposite of the Correct result, resulting in an unexpected result

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Signed-off-by: Zhiju.Fan &lt;zhijux.fan@intel.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools:The code used to test python module is moved to edksetup</title>
<updated>2019-05-08T01:41:43+00:00</updated>
<author>
<name>Fan, ZhijuX</name>
<email>zhijux.fan@intel.com</email>
</author>
<published>2019-04-30T02:16:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=df7c81b5b219c9aee776baa466dd64c9d318dd80'/>
<id>urn:sha1:df7c81b5b219c9aee776baa466dd64c9d318dd80</id>
<content type='text'>
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1582

testing for presence of python modules should be done in edksetup
to reduce impact on subsequent build times.
This code currently exists in BaseTools/Tests/RunTest.py.

This patch is going to fix this issue.

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Signed-off-by: Zhiju.Fan &lt;zhijux.fan@intel.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Replace BSD License with BSD+Patent License</title>
<updated>2019-04-09T16:10:20+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2019-04-03T23:03:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=2e351cbe8e190271b3716284fc1076551d005472'/>
<id>urn:sha1:2e351cbe8e190271b3716284fc1076551d005472</id>
<content type='text'>
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
</feed>
