Skip to content

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Mar 7, 2023

distutils was removed in November. However, the c-analyzer relies on it. To solve that here, we vendor the parts the tool needs so it can be run against 3.12+. (Also see gh-92584.)

@ericsnowcurrently
Copy link
Member Author

Note that none of the Windows-related support actually implements the preprocessor code the c-analyzer needs. Here's what that might look like, though: elijahr/python-autopxd2#40.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, distutils is also used in peg_generator:

import distutils.log
from distutils.core import Distribution, Extension
from distutils.tests.support import fixup_build_ext # type: ignore
from distutils.ccompiler import new_compiler
from distutils.dep_util import newer_group
from distutils.sysconfig import customize_compiler

Will it be convinient to use the single vendored version for both of them?

@ericsnowcurrently
Copy link
Member Author

Thanks for pointing this out. I'll take a look.

@ericsnowcurrently
Copy link
Member Author

(See #92584 (comment).)

I'm fine with sharing a solution with peg_generator (e.g. a common vendored distutils). In the meantime, I'd like to land this PR. We can remove this vendored distutils when there's a shared solution.

@ericsnowcurrently ericsnowcurrently merged commit ca066bd into python:main Mar 9, 2023
@ericsnowcurrently ericsnowcurrently deleted the c-analyzer-vendor-distutils branch March 9, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants