compile_commands.json
bhack opened this issue · comments
Migrating from https://github.com/tensorflow/addons/issues/1894
It could be nice if we could generate/distribute compile_commands.json to better interact with some IDE and our c++ code.
I.e. In Bazel and also in Vscode the the official Bazel team vscode plugin we don't have in tree support to generate compile_commands:
bazelbuild/bazel#258
bazelbuild/vscode-bazel#179
I've tried some quite popular community workaround like:
https://github.com/grailbio/bazel-compilation-database
But the problem is that we are using --action_env for build when we generate our .bazelrc with python configure.py and so these arguments not supported in other command like e.g. bazel query bazelbuild/bazel#10226.
This is going to invalidate the official bazel vscode plugin that need to execute query command but also the bazel-compilation-database workaround cause we have problem to retrieve our env variable.
generate
how we genrerate compile_commands.json?
@bhack I am curious if you can use https://github.com/hedronvision/bazel-compile-commands-extractor to generate compile_commands.json for tensorflow? It cannot work with TensorFlow due to errors like "Analysis of target '//tensorflow/tools/toolchains/win_1803/py36:py3_runtime' failed
ERROR: Analysis of target '//tensorflow/tools/toolchains/win_1803/py36:py3_runtime' failed; build aborted:"