mdavidsaver / ci-core-dumper

Utility to automate analysis of core dumps from crashes during CI builds and test runs
GNU General Public License v3.0
5 stars 4 forks source link

No module named 'distutils' #2

Closed mdavidsaver closed 1 year ago

mdavidsaver commented 1 year ago

Continued fallout from the removal of distutils from python 3.12 ...


Run python -m ci_core_dumper exec python .ci/cue.py test
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/__w/_actions/mdavidsaver/ci-core-dumper/master/ci_core_dumper/__main__.py", line 3, in <module>
    main()
  File "/__w/_actions/mdavidsaver/ci-core-dumper/master/ci_core_dumper/__init__.py", line 131, in main
    args = getargs().parse_args(args)
           ^^^^^^^^^
  File "/__w/_actions/mdavidsaver/ci-core-dumper/master/ci_core_dumper/__init__.py", line 93, in getargs
    from .linux import LinuxDumper as Dumper
  File "/__w/_actions/mdavidsaver/ci-core-dumper/master/ci_core_dumper/linux.py", line 24, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils'

Present usage:

$ git grep distutils
build_crasher.py:from distutils.ccompiler import new_compiler
ci_core_dumper/linux.py:from distutils.spawn import find_executable
mdavidsaver commented 1 year ago

Should be fixed by 96219fd5fbe37e99841e205ee61d14b410bf7aed, at least for the time being. setuptools does not seem to offer an alternative interface for distutils.ccompiler.new_compiler(). Import setuptools first, which can monkey patch in it's bundled distutils. Presumably this will break again in future.