Hi all,
I am trying to build EDK2 from most recent Github (namely, EmulatorPkg) with
the new Stuart build system on Windows 10 22H2 64 bit with VS 2019. I'm getting
the following error which directed me to this mailing list. More details on my
build process below.
INFO - build.py...
INFO - : error C0DE: Unknown fatal error when processing
[c:\users\ryder\edk2_2023\edk2\EmulatorPkg\EmulatorPkg.dsc]
INFO -
INFO - (Please send email tode...@edk2.groups.io for help, attaching following
call stack trace!)
INFO -
INFO - (Python 3.11.5 on win32) Traceback (most recent call last):
INFO - File
"C:\Users\ryder\edk2_2023\edk2\BaseTools\Source\Python\build\build.py", line
2692, in Main
INFO - MyBuild = Build(Target, Workspace, Option,LogQ)
INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\BaseTools\Source\Python\build\build.py", line
815, in __init__
INFO - self.InitPreBuild()
INFO - File
"C:\Users\ryder\edk2_2023\edk2\BaseTools\Source\Python\build\build.py", line
1015, in InitPreBuild
INFO - self.LoadConfiguration()
INFO - File
"C:\Users\ryder\edk2_2023\edk2\BaseTools\Source\Python\build\build.py", line
971, in LoadConfiguration
INFO - self.GetToolChainAndFamilyFromDsc (self.PlatformFile)
INFO - File
"C:\Users\ryder\edk2_2023\edk2\BaseTools\Source\Python\build\build.py", line
905, in GetToolChainAndFamilyFromDsc
INFO - dscobj = self.BuildDatabase[File, BuildArch]
INFO - ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\WorkspaceDatabase.py",
line 104, in __getitem__
INFO - BuildObject = self.CreateBuildObject(FilePath, Arch, Target,
Toolchain)
INFO -
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\WorkspaceDatabase.py",
line 125, in CreateBuildObject
INFO - BuildObject = self._GENERATOR_[FileType](
INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\DscBuildData.py",
line 231, in __init__
INFO - self.SkuIdMgr = SkuClass(self.SkuName, self.SkuIds)
INFO - ^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\DscBuildData.py",
line 510, in SkuName
INFO - self._GetHeaderInfo()
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\DscBuildData.py",
line 310, in _GetHeaderInfo
INFO - RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch]
INFO - ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\MetaFileParser.py",
line 250, in __getitem__
INFO - self._PostProcess()
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\MetaFileParser.py",
line 1429, in _PostProcess
INFO - Processer[self._ItemType]()
INFO - File
"C:\Users\ryder\edk2_2023\edk2\.venv\Lib\site-packages\edk2basetools\Workspace\MetaFileParser.py",
line 1609, in __ProcessDirective
INFO - __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
INFO - ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
INFO - KeyError: 'WORKSPACE'
I followed the directions
on<https://github.com/tianocore/tianocore.github.io/wiki/How-to-Build-With-Stuart>
and<https://github.com/tianocore/edk2/tree/master/EmulatorPkg/PlatformCI>. Are these
the correct set of instructions to follow? If so, I entered the following commands and
received the error above.
git clonehttps://github.com/tianocore/edk2.git
cd edk2
python -m venv .venv
.\.venv\Scripts\Activate.ps1
stuart_setup -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-a X64
stuart_update -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-a X64
stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TAG=VS2019
-a X64
A quick couple of print statements in the python code of basetools reveal that
gGlobalDefines is an empty dictionary. Help would be greatly appreciated. Let
me know if you need more information.
Thank you,
Ryder