From nobody Fri Dec 19 16:04:24 2025
Delivered-To: importer@patchew.org
Received-SPF: pass (zohomail.com: domain of groups.io designates
66.175.222.108 as permitted sender) client-ip=66.175.222.108;
envelope-from=bounce+27952+97094+1787277+3901457@groups.io;
helo=mail02.groups.io;
Authentication-Results: mx.zohomail.com;
dkim=pass;
spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as
permitted sender)
smtp.mailfrom=bounce+27952+97094+1787277+3901457@groups.io;
dmarc=fail(p=none dis=none) header.from=linux.microsoft.com
ARC-Seal: i=1; a=rsa-sha256; t=1670430267; cv=none;
d=zohomail.com; s=zohoarc;
b=M+q5SPjlzV7kFBbGRXQ84VgFDGns353jvbDRpz5aj/2FmGyLmk1H7tZEsZwol0ORLcGMt66FfePM4WbS36tyjFbK/I5M2BMHbaETHg9UDSHeiCGh3FQ11Lfh1fnFbs/biCUwID4IamWuIxYmIVIJDtfeyZl07xDiQN33R4SpCnM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
s=zohoarc;
t=1670430267;
h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To;
bh=KsQAU13z9rR0QHKEfvs6tMf6Z8lYsFlJpAmUwMFxXSo=;
b=LLbiwadDYY9/FI+UvJy3+obb1tuzeUoiNd1S8xejXUSsAmOL9VN/lTIyipPoyKjD1L0oGIJSwTCMfyr1AhZ/MxjFV2ico5t2wPSxicy7X7pC8bdCcOaOaMZqw1NSCwhlQXiUR5lP/JwVB2Bo1jHGp0KaOgprJIW7YiCAlljY508=
ARC-Authentication-Results: i=1; mx.zohomail.com;
dkim=pass;
spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as
permitted sender)
smtp.mailfrom=bounce+27952+97094+1787277+3901457@groups.io;
dmarc=fail header.from=
+ Click to download Visual Studio 2022 Build Tools
+
+ Click to download Visual Studio 2019 Build Tools
+
+ Click to download Visual Studio 2017 Build Tools
+
+ Pre-requisites (Git, Python, Compiler)
+
+
+
+
git to pull the edk2 source code onto your system,=
make changes in the code, and submit
+ your changes back to the GitHub repository.
+
+ Git Download=
Page
+ stuart<=
/code>, which is written in Python.
+
+ It is recommended you install a Python version that is equal to the vers=
ion used in the
+ UsePythonVersion@0 step in this file
+ .azurepipelines/templates/p=
r-gate-steps.yml.
+
+ That version is constantly tested against the code in the repository.
+
+ Python D=
ownload Page
+
+
Ubuntu GCC Installation Instructions
+ apt-get update && apt-get install -y build-essential git nasm =
wget m4 bison flex uuid-dev python unzip acpica-tools gcc-multilib
+ Visual Studio Installation Instructions (Windows)
+
+ Visual Studio 2022 Installation Instructions
+
+
+
+ vs_Buil=
dTools.exe file
+ (e.g. C:\Downloads)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --noca=
che --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --a=
dd Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows11SDK.22000 --=
add Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+ Visual Studio 2019 Installation Instructions
+
+
+
+ vs_BuildT=
ools.exe file
+ (e.g. C:\Downloads)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --nocach=
e --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add=
Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --ad=
d Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+ Visual Studio 2017 Installation Instructions
+
+
+
+ vs_BuildToo=
ls.exe file
+ (e.g. C:\Downloads)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --nocach=
e --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add=
Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --ad=
d Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+
+
+
+ Download the Windows Software Development Kit (SDK) from + Windows Dev Center - Windows SDK +
++ Follow the default options until you reach the "Select the= features you want to install" page. +
+ Select the following options: ++ Click Download and complete the installation proc= ess. +
+Mono= needs to be installed on Linux.
+ apt-get install mono-complete +python -m venv .venv
+ source .venv/bin/activate
+ py -m venv .venv
+ .venv\Scripts\activate.bat
+
+ The important parameter here is the -p parameter which sp=
ecifies that MdeModulePkg
+ should be built.
+
+ The example below uses: +
TOOL_CHAIN_TAG parameter to specify the build sho=
uld use VS2019
+ (Visual Studio 2019).
+ -a parameter is used to specify that the IA=
32 and X64 architectures
+ should be built.
+ + OvmfPkg is considered a "platform firmware" for the + QEMU open-source e= mulator. +
+stuart_build instead of
+ stuart_ci_build to compile the code
+
+ If you want to run CI checks such as CI plugins, you can use stu=
art_ci_build with the CI build file.
+
+ OvmfPkg is considered a "platform firmware" for the + QEMU open-source e= mulator. +
+ +stuart_build instead of
+ stuart_ci_build
+
+ To see what parameters are supported by this platform build file (at t=
he time this page was written), we can pass
+ the --help argument to the stuart_build comm=
and:
+
+ =E2=9D=AF stuart_build -c PlatformBuild.py --help + usage: stuart_build [-h] [--SKIPBUILD] [--SKIPPREBUILD] [--SKIPPOSTBUI= LD] [--FLASHONLY] [--FLASHROM] + [--UPDATECONF] [--CLEAN] [--CLEANONLY] [--OUTPUTCO= NFIG OUTPUTCONFIG] [-a BUILD_ARCH] + [--build-config BUILD_CONFIG] [--verbose] + + options: + -h, --help show this help message and exit + --SKIPBUILD, --skipbuild, --SkipBuild + Skip the build process + --SKIPPREBUILD, --skipprebuild, --SkipPrebuild + Skip prebuild process + --SKIPPOSTBUILD, --skippostbuild, --SkipPostBuild + Skip postbuild process + --FLASHONLY, --flashonly, --FlashOnly + Flash rom after build. + --FLASHROM, --flashrom, --FlashRom + Flash rom. Rom must be built previously. + --UPDATECONF, --updateconf, --UpdateConf + Update Conf. Builders Conf files will be repla= ced with latest template files + --CLEAN, --clean, --CLEAN + Clean. Remove all old build artifacts and inte= rmediate files + --CLEANONLY, --cleanonly, --CleanOnly + Clean Only. Do clean operation and don't build= just exit. + --OUTPUTCONFIG OUTPUTCONFIG, --outputconfig OUTPUTCONFIG, --OutputCo= nfig OUTPUTCONFIG + Provide shell variables in a file + -a BUILD_ARCH, --arch BUILD_ARCH + Optional - CSV of architecture to build. IA32 = will use IA32 for Pei & Dxe. X64 will use + X64 for both PEI and DXE. IA32,X64 will use IA= 32 for PEI and X64 for DXE. default is + IA32,X64 + --build-config BUILD_CONFIG + Provide shell variables in a file + --verbose, --VERBOSE, -v + verbose + + positional arguments: ++=3D - Set an env variable for the pre/post = build process + BLD_*_ =3D - Set a build flag for all build types + (key=3Dvalue will get passed to build pr= ocess) + BLD_ _ =3D - Set a build flag for build type of + (key=3Dvalue will get passed to build pr= ocess for given build type) +
+ The --flashonly and --flashrom commands are =
especially useful with OvmfPkg. They
+ automatically load QEMU with the newly built firmware.
+
+ The example below uses: +
TOOL_CHAIN_TAG parameter to specify that the buil=
d should use GCC5
+ to build with GCC.
+ -a parameter is used to specify the IA32 and X64 architectures should be
+ built.
+ --flashrom parameter is used to load the firmware=
in QEMU and boot QEMU after the firmware build
+ is completed.
+ + The file BaseTools/Edk2ToolsBuild.py + can be called as a standalone Python script. You just need to pass the= tool chain tag you would like to build with. +
++ Example: + python BaseTools/Edk2ToolsBuild.py -t GCC5 +
+
+ The NO-TARGET build target specifies that the actual firm=
ware source code should not be built for any
+ particular target and, instead, the other parts of the CI process will=
be active such as the non-compiler checks
+ (plugins).
+
+ In the following example, the CI plugins will be run against all packa= ges supported by the + CISettings.py file. +
+ stuart_ci_build -c .pytool/CISettings.py -t NO-TARGET +
+ The CI checks could be run against a single package (or a selection of=
packages) by passing the package names to
+ with the -p parameter.
+
+ Plugins are automatically discovered in the workspace by stuart. +
++ The easiest way to have stuart only one run plugin if many others are = present (as is the case in edk2) is to simply + delete the other plugin directories so they are not discovered. You ca= n then test with the remaining plugins and + then use git to restore the deleted plugin directories back when done = testing. +
+
+ For example, to only test with the SpellCheck plugin, del=
ete every other plugin folder from
+ .pytool/Plugin in your
+ workspace.
+
+ Run the command to only perform CI checks:
+
+ stuart_ci_build -c .pytool/CISettings.py -t NO-TARGET
+
+ When done, restore the other plugin directories:
+
+ git restore .pytool/Plugin/**
+
+ Continuous integration is used in edk2 to test new contributions befor= e they are merged to the edk2 main branch. + Stuart is used within the edk2 CI process to pull build dependencies a= nd build the code. +
++ You can use stuart to perform the same CI checks locally that are done= on the server (see the examples section). +
++ Also see EDK II Continuous Inte= gration. +
+A collection of build related tools for edk2.
++ Examples: + +
+ Each tool has a user manual located in BaseTool= s/UserManuals. +
++ A more complete list of BaseTools is located in the EDK II Tools List. +
+A collection of Python code for working with edk2.
+
+ CISettings.py is a common name given to a configuration f=
ile used with Stuart for CI. It is often
+ stored in a folder named .pytools in the root of a reposi=
tory. So you'll likely encounter commands
+ like the following be used with the file:
+
+ PlatformBuild.py is a common name given to a configuratio=
n file used with Stuart for platform build.
+ It is often stored in the root directory of the package it builds.
+
+ For example: +
++ Like Stuart CI has "CI plugins", the build process has "build plugins"= . These can hook into the build in + "pre-build" or "post-build". +
++ Note: Build plugins will also run during CI if a CompilerPlugin is pre= sent that builds the code. ++
stuart_ci_build and =
stuart_build?
+ stuart_ci_build - Runs CI plugins. By default, often ru=
ns CI on several packages at once. This
+ includes all of the checks needed to consider the code ready for int=
egration to the mainline.
+ stuart_build - Does not run CI plugins. Builds one plat=
form. Platforms often expose
+ platform-specific parameters as defined in their PlatformBuild=
.py file.
+ stuart_ci_b=
uild do exactly?+ The Stuart CI process is composed of "CI plugins" that get discovered = in the code tree at CI time and hook into + the CI process. Some examples of CI plugins are a host-based unit test= compile and execution, spell checking the + code, performing markdown lint on the code, etc. Firmware (C code) com= pilation is performed during CI by a compiler + CI plugin. +
+
+ Each plugin reports back a pass/fail status. If any plugin fails, CI f=
ails. However, plugins usually provide some
+ level of customization in a "CI package configuration file". If this f=
ile is present, it is in the root of the
+ package with the naming convention PkgName.ci.yaml. For e=
xample,
+ MdePkg.ci.yaml is
+ the CI package configuration file for MdePkg. Sometimes, =
CI plugins will allow the plugin to be set to
+ run in "audit mode" so the plugin will run and report results but not =
fail CI if errors are found. As an example,
+ some packages in edk2 currently use this file to run the spell checker=
CI plugin in audit mode.
+
+ The two main places to look for CI settings are: +
+ You can pass the -v argument to Stuart commands to get mo=
re detailed output.
+
+ Also, look in your /Build directory.
+
+ Each Stuart command produces a separate file. Open the file correspond= ing to the command you're using that has the + failure. +
+stuart_ci_setup - CISETUP.txtstuart_setup - SETUPLOG.txtstuart_update - UPDATE_LOG.txtstuart_ci_build - CI_BUILDLOG.txtstuart_build - BUILDLOG_PACKAGENAME.txt<=
/li>
+ + The different types of plugins supported by Stuart and details about e= ach type are available in the + edk2-pytool-ex= tensions Plugin Manager + page. +
++ Start in the + edk2-pytool-extensions User Docu= mentation. +
+