bazelbuild / bazelbuild/bazel

Add a way to control duplication of include directories

Open
#19,766 1 comment 4 reactions 0 assignees View on GitHub
P2 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:

Currently Bazel duplicates include directories (i.e. those that are specified in the `includes` attribute of `cc_library` and similar rules) by prepending `bazel-out/.../` prefixes to them. In most cases this is not a problem, however we discovered that sometimes it may be desirable to be able to disable this feature. For example, on Windows such duplication can significantly slow down certain compilers. Right now it is not possible to disable the duplication without patching Bazel itself, because the relevant logic is hardcoded in its Java source code. It would be nice to have more control over this.

### Which category does this issue belong to?

C++/Objective-C Rules, Configurability

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

Almost 50% slow-down compared to invocations without duplicated includes.

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

Windows

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

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating the hardcoded include-directory duplication logic in Bazel's Java sources, then determine how configurability is exposed for C++ and Objective-C rules; done means Windows builds can opt out and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java, objective-c
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.