-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Option to Generate Compilation Databases #1975
Comments
One thing I'll note is that we're trying to move away from any user-facing The one thing is that I am not entirely convinced as to whether this should go in To me the question of whether this should go in
|
I do not know of any other formats. It appears to be the only build-system independent format supported by the tools that use it, like I'm a bit confused what you mean with symbols. Perhaps I should give an example, to make clear what this format involves. This is a line from a random project of mine:
As you can see, these are just the commands that
With how simple it is, it would be hard for me to imagine any major breaking changes.
This is useful for developers that use any of the tools I've mentioned above and develop cpython extensions. It does not affect users of packages generated by
It only involves dumping the compile commands that would be executed into a json file, so the overhead should be negligible. Meson generates one under |
Is there any update on this idea? Also, is there any way that this works now with |
It works out of the box when using alternative build backends such as meson-python. I'm pretty sure that setuptools has not implemented it, though. |
For anybody else who ends up here, it's possible to use Bear to generate bear -- python setup.py build_ext --inplace && mv compile_commands.json build |
The Compilation Database Format describes a way for build systems to inform tools such as linters and autocompleters of the compilation commands used for a specific translation unit. This is especially important for CPython extensions, as
#include <Python.h>
will not work without special options. This means that most editors are unable to provide any completions or errors in-editor for Python extensions compiled with setuptools.I have been writing compilation databases for my setuptools projects by hand by copying from the stdout of
setup.py build_ext
, but it would be nice to be able to generate them directly from setup.py.This issue is mainly to gauge interest and establish what would be required to implement this. This might also be a task for
distutils
and bpo, but I am not familiar enough with the setuptools/distutils ecosystem to tell.The text was updated successfully, but these errors were encountered: