Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distutils default compiler API is incomplete #70221

Closed
stefanseefeld mannequin opened this issue Jan 7, 2016 · 2 comments
Closed

distutils default compiler API is incomplete #70221

stefanseefeld mannequin opened this issue Jan 7, 2016 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@stefanseefeld
Copy link
Mannequin

stefanseefeld mannequin commented Jan 7, 2016

BPO 26033
Nosy @stefanseefeld, @merwok, @dstufft

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-10-22.21:46:33.795>
created_at = <Date 2016-01-07.00:32:48.646>
labels = ['type-bug', 'library']
title = 'distutils default compiler API is incomplete'
updated_at = <Date 2020-10-22.21:46:33.795>
user = 'https://github.com/stefanseefeld'

bugs.python.org fields:

activity = <Date 2020-10-22.21:46:33.795>
actor = 'eric.araujo'
assignee = 'none'
closed = True
closed_date = <Date 2020-10-22.21:46:33.795>
closer = 'eric.araujo'
components = ['Distutils']
creation = <Date 2016-01-07.00:32:48.646>
creator = 'stefan'
dependencies = []
files = []
hgrepos = []
issue_num = 26033
keywords = []
message_count = 2.0
messages = ['257663', '379363']
nosy_count = 3.0
nosy_names = ['stefan', 'eric.araujo', 'dstufft']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue26033'
versions = ['Python 2.7', 'Python 3.5']

@stefanseefeld
Copy link
Mannequin Author

stefanseefeld mannequin commented Jan 7, 2016

I'm trying to use the distutil compiler to preprocess some header (to be used with the cffi package).
The code is

    compiler = distutils.ccompiler.new_compiler()
    compiler.add_include_dir(join(sys.prefix, 'include'))
    compiler.preprocess(source)

This raises this exception (on Linux):

File ".../distutils/unixccompiler.py", line 88, in preprocess
pp_args = self.preprocessor + pp_opts
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

caused by 'set.preprocessor' to be set to None (with the preceding comment:

# The defaults here
# are pretty generic; they will probably have to be set by an outsider
# (eg. using information discovered by the sysconfig about building
# Python extensions).

Seems that code never got fully implemented.
Further, the MSVC version of the compiler (msvccompiler.py) doesn't even implement a "preprocess()" method, so this falls back to the CCompiler.preprocess() default, which does nothing !

@stefanseefeld stefanseefeld mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 7, 2016
@merwok
Copy link
Member

merwok commented Oct 22, 2020

Distutils does not evolve anymore — if CFFI still needs something like this, I think it should build on setuptools and request features there.

@merwok merwok closed this as completed Oct 22, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant