Repository navigation
change the include style in _pymodule.h and remove unused or duplicate headers in two header files - #8473
Conversation
gmarkall
left a comment
There was a problem hiding this comment.
This looks good to me - I think that the change is a move in the right direction - my understanding is that in general the search order of both < / > and " / " includes is implementation-defined, but in general one ought to only expect system paths to be searched when using angle brackets. For example from the GCC Search Path docs:
For the angle-bracket form
#include <file>, the preprocessor’s default behavior is to look only in the standard system directories.
We have been getting away with this because the distutils / setuptools / Python build setup (I'm not sure exactly which / what) adds the Python include dir as a system dir - for example, I see -isystem /home/gmarkall/mambaforge/envs/numbadev/include on the compiler's command line when building Numba. I am actually a little surprised that this never caused an issue before :-)
I do think this should have a full buildfarm run to ensure it doesn't cause a surprise build failure on any of the platforms we support, but other than that I have confidence in this change.
|
@esc / @stuartarchibald Could this have a buildfarm run please? |
|
Thanks for writing up our OOB discussion @gmarkall. The Thanks for the patch @dlee992 ! |
|
@sklam / @stuartarchibald Can this have a buildfarm run please? I think it's the only thing it's waiting on since we decided this change was OK, but want to check there's no surprises on all platforms. |
|
BFID: |
This passed with the exception of a known failure on |
Hi, guys.
In this PR, I changed the include style from <..> to ".." in
_pymodule.h. Since I want to use some Numba headers in my numba extension, and meanwhile I use bazel to build accfile in my extension (because I also depends on a 3rd C++ library). But because of these "ill-formed" include usages, bazel will output some errors to me, like this:Meanwhile, I also deleted
Python.hinlistobject.handdictobject.h, becausecext.hwill include this for them. I also deleted../_pymodule.hindictobject.h, since they seem not use any marcos or other things in it.After these changes, the building process seems still good.
PS, I hope these changes in
_pymodule.hcan be merged into a recent Numba release version at least, thanks.=============
updates [Sept. 29]: After changing the include style in the
_pymodule.h, bazel can successfully compile theccfile for me.Sure, I have done some tricky things in
WORKSPACE:Then, add these two headers into the cc_binary arguments.