-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undeclared headers dependencies doesn't lead to error (Windows) #9965
Comments
Also, if I change some of these headers bazel will rebuild dependent library (which has no dependency in BUILD file on these headers). So looks like bazel knows, that dependency exists, but ignores that this dependecy is undeclared. |
I just add some results of my analysis. After exploring bazel source code I've found that include paths from another targets dependencies are passed with Explanation above is appliable for
But if enable
is still doesn't lead to error. For unknown reason for me empty paths (i.e. headers in workspace root) are ignored in CppCompileAction.java |
jfyi: actually, issue present on other platforms (at least linux), but only if sandboxing is disabled ( |
@maximyurchuk : Thanks for your report, I concluded the same as you. Forwarding the bug to the C++ team. |
Please note, that actually this issue consists from 2 different parts (which appeared after some analisys):
Maybt it's better split issue on two different issues. |
Good point. I can confirm that (2) also appears on Linux with |
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so. |
Description of the problem / feature request:
Not all headers in cpp files are checked by Bazel that they are in dependencies (there is no
this rule is missing dependency declarations for the following files included by ...
error).Since there is no sanbox on Windows there is should be some adequate way to detect undeclared dependencies.
Moreover bazel invokes
cl.exe
with/showIncludes
option, but undeclared headers are not detected.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
You can find reproduce code here.
Attention on
lib.cc
file:All these headers are not declared as dependencies.
What operating system are you running Bazel on?
Windows 10, 1903.
What's the output of
bazel info release
?The text was updated successfully, but these errors were encountered: