bazelbuild / bazelbuild/bazel

Include scanning hints support

Open
#29,354 3 comments 0 reactions 0 assignees View on GitHub
P3 team-Rules-CPP 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:

One of the features of include scanning that is implemented internally at google, but not implemented externally, is the concept of a "hints" file. This file allows you to add extra files that are required by an action even if they don't match the regex. This allows users to solve the case like:

```
#define FOO "foo.h"
#include FOO
```

I would like to submit a PR for support with this feature (or if google wants to export their internal version that would be fine too)

Currently the include scanning flag docs say:

> Use at your own risk. Any issues relating to this flag that are filed will be closed. At Google without this flag your build will most likely fail.

So I know this had some history of not being supported and I wanted to file an issue before I submitted the PR

### Which category does this issue belong to?

_No response_

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

_No response_

### 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 HEAD` ?

```text

```

### 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

Start by locating Bazel's include-scanning implementation and the documentation for the include-scanning flag. Determine how a hints file should be specified and consumed for macro-based includes such as the FOO example, then define coverage and documentation updates that demonstrate the feature works.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.