Skip to content

gh-81057: Vendor a Subset of distutils for the c-analyzer Tool - #102505

Merged
ericsnowcurrently merged 1 commit into
python:mainfrom
ericsnowcurrently:c-analyzer-vendor-distutils
Mar 9, 2023
Merged

gh-81057: Vendor a Subset of distutils for the c-analyzer Tool#102505
ericsnowcurrently merged 1 commit into
python:mainfrom
ericsnowcurrently:c-analyzer-vendor-distutils

Conversation

@ericsnowcurrently

@ericsnowcurrentlyericsnowcurrently commented Mar 7, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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.

@sobolevnsobolevn left a comment

Copy link
Copy Markdown
Member

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:

importdistutils.log
fromdistutils.coreimportDistribution, Extension
fromdistutils.tests.supportimportfixup_build_ext# type: ignore
fromdistutils.ccompilerimportnew_compiler
fromdistutils.dep_utilimportnewer_group
fromdistutils.sysconfigimportcustomize_compiler

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

@ericsnowcurrently

Copy link
Copy Markdown
MemberAuthor

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

@AlexWaygood

Copy link
Copy Markdown
Member

See these two previous issues that were opened on this topic:

@ericsnowcurrently

Copy link
Copy Markdown
MemberAuthor

(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:mainMar 9, 2023
@ericsnowcurrently
ericsnowcurrently deleted the c-analyzer-vendor-distutils branch March 9, 2023 16:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ericsnowcurrently@AlexWaygood@sobolevn@bedevere-bot