tensorflow / tensorflow/build

compile_commands.json

Open
#11 25 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
311
Forks
139
Avg merge
1h 28m
Merged PRs (30d)
1

Description

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:
https://github.com/bazelbuild/bazel/issues/258
https://github.com/bazelbuild/vscode-bazel/issues/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 https://github.com/bazelbuild/bazel/issues/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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading python configure.py and the generated .bazelrc, then examine how bazel query handles the --action_env settings described in the issue. Compare the official VS Code Bazel plugin and bazel-compilation-database workaround linked here. Done means a usable compile_commands.json can be generated and distributed for the C++ code without invalidating the required environment variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, vscode
Domain
build-system, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.