If a C++ directory referenced by include_prefix already exists in the repo, prefer to use that rather than _virtual_includes #17591
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Description of the feature request:
Hi,
I am compiling my C++ project with bazel, and we use include_prefix referencing folders which already exist in our build. For LSP completion, we generate a compile_commands.json which then has lines referencing the inclusion of these virtual includes. However, it is preferable that these includes are direct when possible, since this doesn't entail copying / symlinking files and also would make the LSP references better (referencing the actual files rather than _virtual_includes files deep in the bazel-out directory). More context and discussion can be found here: hedronvision/bazel-compile-commands-extractor#102.
What underlying problem are you trying to solve with this feature?
include_prefix can be much more user friendly if it only generates virtual directories when it actually needs to.
When possible, can bazel optimize include_prefix and strip_include_prefix to just use includes directly, so the end user can use any of those three options without worrying about it.
Which operating system are you running Bazel on?
Ubuntu 20.04.1 LTS
What is the output of
bazel info release
?release 4.0.0
If
bazel info release
returnsdevelopment 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
The text was updated successfully, but these errors were encountered: