Failling tests on make BaseTools


Schultschik, Sven
 

Hi all,

I currently work on integrate the edk2 build within a buildsystem.

I startet with the docu, made manual builds and wrote me a bash script to automate the steps. Worked very well till now.

Then I tried to add it to the build system and some of tests of the "make -C edks/BaseTools" fail now.

The checkout source is the same, the python version, the gcc version is the same.

I wonder why the tests are failing on one machine and are ok on the other ...

Thank you for any hints

======================================================================
FAIL: test_FMMT_FMMT (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py", line 48
def __init__(self) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BinaryFactoryProduct (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py", line 34
type:list = []
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTree (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py", line 31
def __init__(self, NodeName: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTreeNode (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py", line 34
def __init__(self, name: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTOperation (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py", line 16
def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: str=None, outputfile: str=None) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTParser (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py", line 15
def __init__(self, name: str, TYPE: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FvHandler (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py", line 16
def ChangeSize(TargetTree, size_delta: int=0) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_GuidTools (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py", line 18
def ExecuteCommand(cmd: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_utils_FvLayoutPrint (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py", line 9
def GetFormatter(layout_format: str):
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_Common (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py", line 42
def from_list(self, listformat: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FfsFileHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py", line 41
def FFS_FILE_SIZE(self) -> int:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FvHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py", line 77
def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_SectionHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py", line 22
def SECTION_SIZE(self) -> int:
^
SyntaxError: invalid syntax


Rebecca Cran
 

My initial guess would be that for some reason it's trying to use Python 2.x instead of 3.x.

--
Rebecca Cran

On 5/25/22 15:04, Schultschik, Sven wrote:
Hi all,

I currently work on integrate the edk2 build within a buildsystem.

I startet with the docu, made manual builds and wrote me a bash script to automate the steps. Worked very well till now.

Then I tried to add it to the build system and some of tests of the "make -C edks/BaseTools" fail now.

The checkout source is the same, the python version, the gcc version is the same.

I wonder why the tests are failing on one machine and are ok on the other ...

Thank you for any hints

======================================================================
FAIL: test_FMMT_FMMT (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py", line 48
def __init__(self) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BinaryFactoryProduct (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py", line 34
type:list = []
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTree (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py", line 31
def __init__(self, NodeName: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTreeNode (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py", line 34
def __init__(self, name: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTOperation (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py", line 16
def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: str=None, outputfile: str=None) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTParser (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py", line 15
def __init__(self, name: str, TYPE: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FvHandler (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py", line 16
def ChangeSize(TargetTree, size_delta: int=0) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_GuidTools (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py", line 18
def ExecuteCommand(cmd: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_utils_FvLayoutPrint (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py", line 9
def GetFormatter(layout_format: str):
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_Common (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py", line 42
def from_list(self, listformat: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FfsFileHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py", line 41
def FFS_FILE_SIZE(self) -> int:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FvHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py", line 77
def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_SectionHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py", line 22
def SECTION_SIZE(self) -> int:
^
SyntaxError: invalid syntax




Schultschik, Sven
 

Hi Rebecca,

thank you that was a very good hint. I now set the PYTHON_COMMAND manually to python3 and the tests working.

But the build behaves really odd in that environment, but that's another topic.

Regards Sven

-----Urspr√ľngliche Nachricht-----
Von: Rebecca Cran <quic_rcran@...>
Gesendet: Donnerstag, 26. Mai 2022 00:04
An: discuss@edk2.groups.io; Schultschik, Sven (DI PA DCP R&D 2) <sven.schultschik@...>
Betreff: Re: [edk2-discuss] Failling tests on make BaseTools

My initial guess would be that for some reason it's trying to use Python 2.x instead of 3.x.

--
Rebecca Cran

On 5/25/22 15:04, Schultschik, Sven wrote:
Hi all,

I currently work on integrate the edk2 build within a buildsystem.

I startet with the docu, made manual builds and wrote me a bash script to automate the steps. Worked very well till now.

Then I tried to add it to the build system and some of tests of the "make -C edks/BaseTools" fail now.

The checkout source is the same, the python version, the gcc version is the same.

I wonder why the tests are failing on one machine and are ok on the other ...

Thank you for any hints

======================================================================
FAIL: test_FMMT_FMMT (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/FMMT.py", line 48
def __init__(self) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BinaryFactoryProduct (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py", line 34
type:list = []
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTree (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTree.py", line 31
def __init__(self, NodeName: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_BiosTreeNode (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py", line 34
def __init__(self, name: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTOperation (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py", line 16
def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: str=None, outputfile: str=None) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FMMTParser (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FMMTParser.py", line 15
def __init__(self, name: str, TYPE: str) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_FvHandler (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/FvHandler.py", line 16
def ChangeSize(TargetTree, size_delta: int=0) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_core_GuidTools (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/core/GuidTools.py", line 18
def ExecuteCommand(cmd: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FMMT_utils_FvLayoutPrint (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py", line 9
def GetFormatter(layout_format: str):
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_Common (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/Common.py", line 42
def from_list(self, listformat: list) -> None:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FfsFileHeader
(CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py", line 41
def FFS_FILE_SIZE(self) -> int:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_FvHeader (CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py", line 77
def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE:
^
SyntaxError: invalid syntax


======================================================================
FAIL: test_FirmwareStorageFormat_SectionHeader
(CheckPythonSyntax.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 49, in <lambda>
newmethod = lambda self: self.SingleFileTest(filename)
File "/home/builder/edk2/git/edk2/BaseTools/Tests/CheckPythonSyntax.py", line 27, in SingleFileTest
self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
AssertionError: syntax error: /home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py, Error is File "/home/builder/edk2/git/edk2/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py", line 22
def SECTION_SIZE(self) -> int:
^
SyntaxError: invalid syntax