public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* EDK2 build errors with Python 3.9
@ 2020-12-10 16:15 Kiselev, Sergey
  2020-12-11  1:14 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 3+ messages in thread
From: Kiselev, Sergey @ 2020-12-10 16:15 UTC (permalink / raw)
  To: devel@edk2.groups.io

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

Hi,

The array object in Python 3.9 no longer supports fromstring() and tostring() methods. EDK2 BaseTools use these methods, and therefore the EDK2 build fails when using Python 3.9. See the trace below.

Thanks,
Sergey

build.py...
: error C0DE: Tools code failure
        Please send email to devel@edk2.groups.io for help, attaching following call stack trace!

Traceback (most recent call last):
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line 371, in GenFdsApi
    GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line 510, in GenFd
    FdObj.GenFd()
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fd.py", line 131, in GenFd
    RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self.DefineVarDict, Flag=Flag)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Region.py", line 134, in AddToBuffer
    FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum, ErasePolarity, Flag=Flag)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in AddToBuffer
    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line 153, in GenFfs
    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GuidSection.py", line 95, in GenSection
    ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FvImageSection.py", line 108, in GenSection
    FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict, Flag=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in AddToBuffer
    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line 153, in GenFfs
    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\UiSection.py", line 70, in GenSection
    GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=NameString, IsMakefile=IsMakefile)
  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py", line 466, in GenerateSection
    SectionData.fromstring(Ui.encode("utf_16_le"))
AttributeError: 'array.array' object has no attribute 'fromstring'


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

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

* 回复: [edk2-devel] EDK2 build errors with Python 3.9
  2020-12-10 16:15 EDK2 build errors with Python 3.9 Kiselev, Sergey
@ 2020-12-11  1:14 ` gaoliming
  2020-12-14  0:22   ` fengyunhua
  0 siblings, 1 reply; 3+ messages in thread
From: gaoliming @ 2020-12-11  1:14 UTC (permalink / raw)
  To: devel, sergey.kiselev
  Cc: gaoliming, 'Bob Feng', 'Yunhua Feng'

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

Bob and Yunhua:

 I remember you have the patch to fix this issue. Right?

 

Thanks

Liming

发件人: bounce+27952+68668+4905953+8761045@groups.io
<bounce+27952+68668+4905953+8761045@groups.io> 代表 Kiselev, Sergey
发送时间: 2020年12月11日 0:16
收件人: devel@edk2.groups.io
主题: [edk2-devel] EDK2 build errors with Python 3.9

 

Hi,

 

The array object in Python 3.9 no longer supports fromstring() and
tostring() methods. EDK2 BaseTools use these methods, and therefore the EDK2
build fails when using Python 3.9. See the trace below.

 

Thanks,
Sergey

 

build.py...

: error C0DE: Tools code failure

        Please send email to devel@edk2.groups.io <mailto:devel@edk2.groups.
io>  for help, attaching following call stack trace!

 

Traceback (most recent call last):

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line
371, in GenFdsApi

    GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line
510, in GenFd

    FdObj.GenFd()

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fd.py", line 131, in
GenFd

    RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList,
self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self.DefineVarDict,
Flag=Flag)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Region.py", line
134, in AddToBuffer

    FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum,
ErasePolarity, Flag=Flag)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in
AddToBuffer

    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress,
IsMakefile=Flag, FvName=self.UiFvName)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line
153, in GenFfs

    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex,
self.KeyStringList, None, Dict)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GuidSection.py",
line 95, in GenSection

    ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName,
SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FvImageSection.py",
line 108, in GenSection

    FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict,
Flag=IsMakefile)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in
AddToBuffer

    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress,
IsMakefile=Flag, FvName=self.UiFvName)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line
153, in GenFfs

    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex,
self.KeyStringList, None, Dict)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\UiSection.py", line
70, in GenSection

    GenFdsGlobalVariable.GenerateSection(OutputFile, None,
'EFI_SECTION_USER_INTERFACE', Ui=NameString, IsMakefile=IsMakefile)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py",
line 466, in GenerateSection

    SectionData.fromstring(Ui.encode("utf_16_le"))

AttributeError: 'array.array' object has no attribute 'fromstring'

 




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

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

* 回复: [edk2-devel] EDK2 build errors with Python 3.9
  2020-12-11  1:14 ` 回复: [edk2-devel] " gaoliming
@ 2020-12-14  0:22   ` fengyunhua
  0 siblings, 0 replies; 3+ messages in thread
From: fengyunhua @ 2020-12-14  0:22 UTC (permalink / raw)
  To: 'gaoliming', devel, sergey.kiselev, mingyuex.liang
  Cc: 'Bob Feng'

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

Please refer to Mingyue submitted patch

https://edk2.groups.io/g/devel/message/67511

 

Thanks

Yunhua

 

发件人: gaoliming <gaoliming@byosoft.com.cn> 
发送时间: 2020年12月11日 9:15
收件人: devel@edk2.groups.io; sergey.kiselev@intel.com
抄送: gaoliming@byosoft.com.cn; 'Bob Feng' <bob.c.feng@intel.com>; 'Yunhua
Feng' <fengyunhua@byosoft.com.cn>
主题: 回复: [edk2-devel] EDK2 build errors with Python 3.9

 

Bob and Yunhua:

 I remember you have the patch to fix this issue. Right?

 

Thanks

Liming

发件人: bounce+27952+68668+4905953+8761045@groups.io
<mailto:bounce+27952+68668+4905953+8761045@groups.io>
<bounce+27952+68668+4905953+8761045@groups.io
<mailto:bounce+27952+68668+4905953+8761045@groups.io> > 代表 Kiselev, Sergey
发送时间: 2020年12月11日 0:16
收件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> 
主题: [edk2-devel] EDK2 build errors with Python 3.9

 

Hi,

 

The array object in Python 3.9 no longer supports fromstring() and
tostring() methods. EDK2 BaseTools use these methods, and therefore the EDK2
build fails when using Python 3.9. See the trace below.

 

Thanks,
Sergey

 

build.py...

: error C0DE: Tools code failure

        Please send email to devel@edk2.groups.io <mailto:devel@edk2.groups.
io>  for help, attaching following call stack trace!

 

Traceback (most recent call last):

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line
371, in GenFdsApi

    GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFds.py", line
510, in GenFd

    FdObj.GenFd()

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fd.py", line 131, in
GenFd

    RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList,
self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self.DefineVarDict,
Flag=Flag)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Region.py", line
134, in AddToBuffer

    FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum,
ErasePolarity, Flag=Flag)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in
AddToBuffer

    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress,
IsMakefile=Flag, FvName=self.UiFvName)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line
153, in GenFfs

    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex,
self.KeyStringList, None, Dict)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GuidSection.py",
line 95, in GenSection

    ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName,
SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FvImageSection.py",
line 108, in GenSection

    FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict,
Flag=IsMakefile)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\Fv.py", line 127, in
AddToBuffer

    FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress,
IsMakefile=Flag, FvName=self.UiFvName)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\FfsFileStatement.py", line
153, in GenFfs

    sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex,
self.KeyStringList, None, Dict)

  File "C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\UiSection.py", line
70, in GenSection

    GenFdsGlobalVariable.GenerateSection(OutputFile, None,
'EFI_SECTION_USER_INTERFACE', Ui=NameString, IsMakefile=IsMakefile)

  File
"C:\edk2-upx\edk2\BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py",
line 466, in GenerateSection

    SectionData.fromstring(Ui.encode("utf_16_le"))

AttributeError: 'array.array' object has no attribute 'fromstring'

 




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

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

end of thread, other threads:[~2020-12-14  0:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-10 16:15 EDK2 build errors with Python 3.9 Kiselev, Sergey
2020-12-11  1:14 ` 回复: [edk2-devel] " gaoliming
2020-12-14  0:22   ` fengyunhua

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