This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: CPPFLAGS during ./configure are not passed-through in sysconfig.customize_compiler
Type: behavior Stage: resolved
Components: Build, Distutils Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, ericvw, lkollar, pablogsal, steve.dower
Priority: normal Keywords: patch

Created on 2018-06-28 19:13 by ericvw, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7997 closed ericvw, 2018-06-28 19:23
Messages (3)
msg320683 - (view) Author: Eric N. Vander Weele (ericvw) * Date: 2018-06-28 19:13
When specifying CPPFLAGS during `./configure`, `sysconfig.get_config_var('CPPFLAGS')` does capture the originally specified flags.  However, when building a C/C++ extension, any flags specified via CPPFLAGS are not present during compilation of extension source files.

Since preprocessor flags (e.g., '-I' rules) may be used during `./configure` instead of `CFLAGS`, it appears that the `CPPFLAGS` captured should also be injected when customizing the compiler executable to be invoked.

I have PR that will be submitted and linked shortly.
msg338040 - (view) Author: Eric N. Vander Weele (ericvw) * Date: 2019-03-15 22:17
I discovered that `` injects include paths for building the interpreter, itself, which should probably not be passed along via distutils for building C/C++ extensions 😕.

It seems like more investigation is required in determining the purpose of `CPPFLAGS` with respect to building the interpreter and if `distutils` should be passing along at`./configure` time of the interpreter.

For now, specifying include paths via `CFLAGS` will still suffice until the scope of `CPPFLAGS` is better defined.
msg386308 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:16
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78171
2021-02-04 20:46:09yan12125setnosy: - yan12125
2021-02-03 18:16:24steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386308

resolution: out of date
stage: patch review -> resolved
2019-03-15 22:17:01ericvwsetmessages: + msg338040
2018-06-30 10:24:26yan12125setnosy: + yan12125
2018-06-29 11:32:08lkollarsetnosy: + lkollar
2018-06-28 21:07:26pablogsalsetnosy: + pablogsal
2018-06-28 19:23:00ericvwsetkeywords: + patch
stage: patch review
pull_requests: + pull_request7606
2018-06-28 19:13:38ericvwcreate