@Ryder

We have identified the issue.

A new issue will be created here Issues · tianocore/edk2-basetools (github.com) <https://github.com/tianocore/edk2-basetools/issues> to track it.

In the meantime there are two easy workarounds (pick one).


1. Create your venv named something like "venv" instead of ".venv".  It just must come later in the default directory sort than "Basetools".

or

2. Create your venv outside the edk2 source code tree.  Generally this is what I do as I don't like my virtual environment mixed with my source code.


As mentioned before don't forget to build the basetools.  From there, my experience is everything works.  Thanks for reporting your issue.


Thanks

Sean


On 11/27/2023 10:16 AM, Sean wrote:

We are looking at it.

It seems to be a problem in the edk2-basetools but at this point it still isn't obvious.

You can do a 'pip uninstall edk2-basetools' and then I would expect your build would work.

I also see that you didn't build edk2 basetools (step 6) documented here: edk2/EmulatorPkg/PlatformCI at master · tianocore/edk2 (github.com) <https://github.com/tianocore/edk2/tree/master/EmulatorPkg/PlatformCI>.  Without doing that your build will fail as well.


The CI system is building fine so we are still looking into it.

I'll update the thread when we have more info.


Thanks

Sean



On 11/21/2023 8:22 AM, Laszlo Ersek wrote:
Adding Sean

Laszlo

On 11/19/23 23:43, ryderkeys via groups.io wrote:
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










-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111757): https://edk2.groups.io/g/devel/message/111757
Mute This Topic: https://groups.io/mt/102698986/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to