bazelbuild / bazelbuild/bazel

FR: Add ability to generate clang indexstore files for CC builds

Open
#15,983 4 comments 0 reactions 0 assignees View on GitHub
not stale P4 team-Rules-CPP type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 16h
Merged PRs (30d)
72

Description

### Description of the feature request:

Allow (probably via a feature) the ability for C/C++/Obj-C files to generate clang indexstore files (`-index-store-path`) for each source file. This is similar to the https://github.com/bazelbuild/bazel/issues/15191 request.

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

I have an IDE integration (Xcode) use case where I want `-index-store-path index_store_path` to be applied to each C/C++/Obj-C compilation, as the IDE consumes these files for indexing. These files need to be fetched from cache as well, so they need to be a declared output.

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

_No response_

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

_No response_

### 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 master; 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?

I'm willing to contribute this change, if it will be accepted.

Contributor guide

Open the contributing guide

Research direction

Start by locating Bazel’s C/C++/Obj-C compilation action configuration and declared outputs; the issue names no files or tests. Check how -index-store-path can be applied to each source file and how the resulting indexstore files are fetched from cache. Done means the files are generated for these compilations, declared as outputs, and available to the Xcode integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, objective-c
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.