I'm trying to port to bazel a library. The library uses system includes (say #include <dir/foo.h>) also internally.
The headers are included both using double quotes and angle brackets. Externally is used mostly via angle brackets.
I made a simple repository that mocks the situation:
When I try to compile bazel build //dir:foo I get:
dir/foo.cc:3:10: fatal error: dir/foo.h: No such file or directory
3 | #include <dir/foo.h>
By inspecting the sandbox with and adding more verbosity, the command is the following:
As you can see, bazel-out/k8-fastbuild/bin/dir/_virtual_includes/dir_headers is included, but there's no such directory or path in the sandbox environment.
Feature requests: what underlying problem are you trying to solve with this feature?
Since it's impossible to add includes = ["."] because it would import the root workspace as include. And since adding the prefix and virtual includes is not working, it' impossible for me to let source files including #include <dir/foo.h> to work effectively.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Description of the problem / feature request:
I'm trying to port to bazel a library. The library uses system includes (say
#include <dir/foo.h>
) also internally. The headers are included both using double quotes and angle brackets. Externally is used mostly via angle brackets.I made a simple repository that mocks the situation:
When I try to compile
bazel build //dir:foo
I get:By inspecting the sandbox with and adding more verbosity, the command is the following:
As you can see,
bazel-out/k8-fastbuild/bin/dir/_virtual_includes/dir_headers
is included, but there's no such directory or path in the sandbox environment.Feature requests: what underlying problem are you trying to solve with this feature?
Since it's impossible to add
includes = ["."]
because it would import the root workspace as include. And since adding the prefix and virtual includes is not working, it' impossible for me to let source files including#include <dir/foo.h>
to work effectively.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Example
What operating system are you running Bazel on?
Debian
What's the output of
bazel info release
?release 6.2.1
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.N/A
What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?
N/A, I also used both the latest version of rules_cc and the "embedded" version already present in bazel.
What Bazel options do you use to trigger the issue? What C++ toolchain do you use?
System toolchain.
Have you found anything relevant by searching the web?
Not really.
Any other information, logs, or outputs that you want to share?
Already added in the first question.