Ask questionsBuild failure - missing dependency declarations LLVM
With the current trunk at 8b87c1a09bf156ca9a42d9f72fad07da62100318 (Jun 29), even after a bazel clean, I see:
$ CC=clang CXX=clang++ bazel --per_file_copt=llvm-project@-UNDEBUG --linkopt="-fuse-ld=lld" //tensorflow/compiler/mlir/xla/tests:all ... INFO: Found 1 target and 40 test targets... ERROR: /ws/2cca323f33485b8e970325d856ce9b72/external/llvm-project/llvm/BUILD:665:1: undeclared inclusion(s) in rule '@llvm-project//llvm:count': this rule is missing dependency declarations for the following files included by 'external/llvm-project/llvm/utils/count/count.c': '/usr/lib64/clang/10.0.0/include/stddef.h' '/usr/lib64/clang/10.0.0/include/stdarg.h' INFO: Elapsed time: 0.140s, Critical Path: 0.02s INFO: 0 processes.
$ clang --version clang version 10.0.0 (Fedora 10.0.0-2.fc32) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin $ bazel --version bazel 3.1.0
OS: Fedora 32, x86-64
Answer questions jpienaar
Maybe, but if the same header is included from different files build with different C++ macros enabled, then you would end with different includes. You'd need to ensure that any header or build rule that is optionally included due to macro (which one can do with conditional rules) is always included or not for all compilation paths else bazel is correct in flagging it as it is a missing dependency.
I don't know why this happens for count though. But unless one wrote the build files expecting this and have a CI for it, it may or may not work.