public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] BaseTools KeyError When Building EmulatorPkg
@ 2023-11-19 22:43 ryderkeys via groups.io
  2023-11-21 16:22 ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: ryderkeys via groups.io @ 2023-11-19 22:43 UTC (permalink / raw)
  To: devel@edk2.groups.io

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 to devel@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 clone https://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 (#111431): https://edk2.groups.io/g/devel/message/111431
Mute This Topic: https://groups.io/mt/102698986/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] BaseTools KeyError When Building EmulatorPkg
  2023-11-19 22:43 [edk2-devel] BaseTools KeyError When Building EmulatorPkg ryderkeys via groups.io
@ 2023-11-21 16:22 ` Laszlo Ersek
  2023-11-27 18:16   ` Sean
       [not found]   ` <179B8D98556E51B3.32091@groups.io>
  0 siblings, 2 replies; 5+ messages in thread
From: Laszlo Ersek @ 2023-11-21 16:22 UTC (permalink / raw)
  To: devel, ryderkeys; +Cc: Sean Brogan

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 to devel@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 clone https://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 (#111560): https://edk2.groups.io/g/devel/message/111560
Mute This Topic: https://groups.io/mt/102698986/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] BaseTools KeyError When Building EmulatorPkg
  2023-11-21 16:22 ` Laszlo Ersek
@ 2023-11-27 18:16   ` Sean
       [not found]   ` <179B8D98556E51B3.32091@groups.io>
  1 sibling, 0 replies; 5+ messages in thread
From: Sean @ 2023-11-27 18:16 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com, ryderkeys@proton.me; +Cc: Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 5627 bytes --]

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 todevel@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 (#111736): https://edk2.groups.io/g/devel/message/111736
Mute This Topic: https://groups.io/mt/102698986/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 7124 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] BaseTools KeyError When Building EmulatorPkg
       [not found]   ` <179B8D98556E51B3.32091@groups.io>
@ 2023-11-27 19:43     ` Sean
  2023-11-27 22:48       ` ryderkeys via groups.io
  0 siblings, 1 reply; 5+ messages in thread
From: Sean @ 2023-11-27 19:43 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com, ryderkeys@proton.me; +Cc: Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 6486 bytes --]

@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 todevel@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 8756 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] BaseTools KeyError When Building EmulatorPkg
  2023-11-27 19:43     ` Sean
@ 2023-11-27 22:48       ` ryderkeys via groups.io
  0 siblings, 0 replies; 5+ messages in thread
From: ryderkeys via groups.io @ 2023-11-27 22:48 UTC (permalink / raw)
  To: devel; +Cc: lersek@redhat.com, Sean Brogan

On Monday, November 27th, 2023 at 2:43 PM, Sean via groups.io wrote:

> 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.

Hi Sean,

Thanks for the reply and the swift resolution. Regarding your suggestions:
0. I can confirm that after uninstalling the pip basetools, the error disappears and the build works.
1. It also works if I rename ".venv" to something that starts after B (such as venv)
2. It also works if I place the venv outside the source tree.

Thanks once again for the help,
Ryder



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111762): https://edk2.groups.io/g/devel/message/111762
Mute This Topic: https://groups.io/mt/102698986/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-27 22:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-19 22:43 [edk2-devel] BaseTools KeyError When Building EmulatorPkg ryderkeys via groups.io
2023-11-21 16:22 ` Laszlo Ersek
2023-11-27 18:16   ` Sean
     [not found]   ` <179B8D98556E51B3.32091@groups.io>
2023-11-27 19:43     ` Sean
2023-11-27 22:48       ` ryderkeys via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox