sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
706 stars 1.35k forks source link

Build failure for 'target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl' #19301

Closed Weitang-Zheng closed 2 weeks ago

Weitang-Zheng commented 1 month ago

Description

Build the target/sonic-vs.img.gz on the master branch, got the following errors with the target target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl:

2024-06-13T04:36:30.6518850Z [ FAIL LOG START ] [ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ]
2024-06-13T04:36:30.6556449Z Build start time: Thu Jun 13 04:35:20 UTC 2024
2024-06-13T04:36:30.6610450Z [ REASON ] :      target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl does not exist   NON-EXISTENT PREREQUISITES: target/python-wheels/buster/sonic_py_common-1.0-py2-none-any.whl-install target/debs/buster/python-swsscommon_1.0.0_amd64.deb-install 
2024-06-13T04:36:30.6613581Z [ FLAGS  FILE    ] : [] 
2024-06-13T04:36:30.6691001Z [ FLAGS  DEPENDS ] : [] 
2024-06-13T04:36:30.6691553Z [ FLAGS  DIFF    ] : [] 
......
2024-06-13T04:36:30.9589440Z ======================================================================
2024-06-13T04:36:30.9590102Z ERROR: tests.test_multinpu_cfggen (unittest.loader.ModuleImportFailure)
2024-06-13T04:36:30.9590711Z ----------------------------------------------------------------------
2024-06-13T04:36:30.9591212Z ImportError: Failed to import test module: tests.test_multinpu_cfggen
2024-06-13T04:36:30.9591665Z Traceback (most recent call last):
2024-06-13T04:36:30.9592124Z   File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
2024-06-13T04:36:30.9592614Z     module = self._get_module_from_name(name)
2024-06-13T04:36:30.9593122Z   File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
2024-06-13T04:36:30.9593610Z     __import__(name)
2024-06-13T04:36:30.9594206Z   File "/sonic/src/sonic-config-engine/tests/test_multinpu_cfggen.py", line 10, in <module>
2024-06-13T04:36:30.9594757Z     from unittest import mock
2024-06-13T04:36:30.9595053Z ImportError: cannot import name mock
2024-06-13T04:36:30.9595280Z 
2024-06-13T04:36:30.9595284Z 
2024-06-13T04:36:30.9595446Z ======================================================================
2024-06-13T04:36:30.9595959Z ERROR: test_device_metadata (tests.test_chassis_cfggen.TestPacketChassisSup)
2024-06-13T04:36:30.9596542Z ----------------------------------------------------------------------
2024-06-13T04:36:30.9596923Z Traceback (most recent call last):
2024-06-13T04:36:30.9597506Z   File "/sonic/src/sonic-config-engine/tests/test_chassis_cfggen.py", line 971, in setUp
2024-06-13T04:36:30.9598135Z     super().setUp()
2024-06-13T04:36:30.9598464Z TypeError: super() takes at least 1 argument (0 given)
2024-06-13T04:36:30.9598752Z 
2024-06-13T04:36:30.9598883Z ======================================================================
2024-06-13T04:36:30.9599541Z ERROR: test_device_metadata_for_namespace (tests.test_chassis_cfggen.TestPacketChassisSup)
2024-06-13T04:36:30.9600366Z ----------------------------------------------------------------------
2024-06-13T04:36:30.9600750Z Traceback (most recent call last):
2024-06-13T04:36:30.9601402Z   File "/sonic/src/sonic-config-engine/tests/test_chassis_cfggen.py", line 971, in setUp
2024-06-13T04:36:30.9601908Z     super().setUp()
2024-06-13T04:36:30.9602221Z TypeError: super() takes at least 1 argument (0 given)

It looks these test cases in src/sonic-config-engine/tests/test_multinpu_cfggen.py and src/sonic-config-engine/tests/test_chassis_cfggen.py is NOT compatible with Python2.7 in buster build environment.

Steps to reproduce the issue:

  1. make init
  2. make configure PLATFORM=vs
  3. make SONIC_BUILD_JOBS=8 target/sonic-vs.img.gz

Describe the results you received:

Describe the results you expected:

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

prabhataravind commented 1 month ago

@Weitang-Zheng master should be on bookworm. Could you please try with NOBUSTER=1 flag passed to make? Adding @saiarcot895 for viz

saiarcot895 commented 1 month ago

Most packages are built on Bookworm now, which means python packages will only target python 3 or newer, not python 2.7

Please use make target/python-wheels/bookworm/sonic_config_engine-1.0-py3-none-any.whl instead.