bazelbuild / bazelbuild/bazel

offcial support for cpp to generate compile_commands.json

Open
#23,508 4 comments 4 reactions 0 assignees View on GitHub
P4 type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

hi, bazel is easy and useful when manage c++ source file.
but language server like clangd is typeical common tools for C++ developer.

There is alreay a third party tools: https://github.com/hedronvision/bazel-compile-commands-extractor.git for generate commpile_commands.json. but it seems not work properly in some case.

Does the bazel team plan to support offcially? Thank you for developing such a wondeful tool.

### Which category does this issue belong to?

C++ Rules

### What underlying problem are you trying to solve with this feature?

_No response_

### Which operating system are you running Bazel on?

ubuntu

### What is the output of `bazel info release`?

release 7.3.1-homebrew

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

The request concerns Bazel's C++ Rules and the bazel-compile-commands-extractor project; start by reviewing that tool and Bazel's current C++ build-information interfaces. Done means defining and implementing official support for generating compile_commands.json, including cases the third-party tool does not handle.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.