[issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2020-05-18 Thread Kevin Mooney


Change by Kevin Mooney :


--
keywords: +patch
nosy: +Kevin Mooney
nosy_count: 5.0 -> 6.0
pull_requests: +19482
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20181

___
Python tracker 
<https://bugs.python.org/issue39026>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2020-05-18 Thread Kevin Mooney


Kevin Mooney  added the comment:

Ok, I think I see. Is there a concern that removing the cpython/ prefix might 
lead to the wrong initconfig.h being included?

So your proposal is all includes in the root will do 

#include "cpython/cpython_foo.h"

And any includes done in the cpython dir will be

#include "cpython_foo.h"

Currently there's only one file in the cpython dir that includes another, which 
would explain why this has never come up before.

--

___
Python tracker 
<https://bugs.python.org/issue39026>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2020-05-18 Thread Kevin Mooney


Kevin Mooney  added the comment:

Ok, so there are three potential solutions

1. Add cpython_ prefix to cpython headers
2. Remove cpython/initconfig.h from cpython/pystate.h
3. Include initconfig.h rather than cpython/initconfig.h

1 intoduces verbosity and touches more than the other solutions. 2
introduces a dependency on the include order. 3 adds potential nasty
surprises. Doing nothing means C API users need to adapt their include
paths.

I'd appreciate your guidance on which path is preferable.

On Mon, 18 May 2020, 23:08 STINNER Victor,  wrote:

>
> STINNER Victor  added the comment:
>
> I propose to rename "cpython/initconfig.h" to
> "cpython/cpython_initconfig.h".
>
> #include "cpython/initconfig.h"
>
> would become:
>
> #include "cpython/cpython_initconfig.h"
>
> So it becomes possible to include a cpython_xxx.h header from another
> cpython_xxx.h header (as done py cpython/pystate.h which includes
> cpython/initconfig.h).
>
> --
>
> Maybe a simpler change is simply to remove #include "cpython/initconfig.h"
> from cpython/pystate.h. Currently, cpython/pystate.h is included indirectly
> by Python.h at line 137, whereas cpython/initconfig.h is included by
> Python.h at line 135 (two lines before).
>
> C extensions must include "Python.h" first and when "Python.h" is used,
> pystate.h gets the cpython/initconfig.h definitions as expected.
>
> --
>
> ___
> Python tracker 
> <https://bugs.python.org/issue39026>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue39026>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com