cpc / openasip

Open Application-Specific Instruction Set processor tools (OpenASIP)
http://openasip.org
Other
144 stars 43 forks source link

tce-selftest fails on Python >= 3.10 due to deprecation warning #136

Closed sarahec closed 2 years ago

sarahec commented 2 years ago

Beginning with Python 3.10, Python prints a deprecation warning for any use of distutils. Since the selftest checks for an empty stdout to pass the test, this triggers a failure.

tcecc appears to be the culprit.

The fix is to switch to setuptools.

FAIL: test_noOpt (main.TestCompiler) Test C compilation with -O0

Traceback (most recent call last): File "/home/sec/local/bin/tce-selftest", line 199, in test_noOpt self._test_compilation("-O0 --swfp") File "/home/sec/local/bin/tce-selftest", line 192, in _test_compilation self.assertEqual(stderr, "") AssertionError: '/home/sec/local/bin/tcecc:40: Deprecation[187 chars]le\n' != ''

sarahec commented 2 years ago

I found the problem, and it's a trivial fix. Line 40 of /src/bintools/Compiler/tcecc.in reads:

from distutils.spawn import find_executable

but the code was fixed to no longer use distutils. Removing this line and rebuilding solves the problem.

It's probably quicker for you to make the edit than merge a PR, but let me know if you want the PR.

pjaaskel commented 2 years ago

Thanks @sarahec -- a PR would be great so you get all the glory in 'git blame' etc.! :)

sarahec commented 2 years ago

Whoops, merged to my personal copy! Let me send this in properly.