bazel: Bazel can't build .c files including other .c files

I have a project which happens to #include .c files from other .c files. When sandboxing is disabled, undeclared inclusion errors will be thrown for .c files which are, in fact, declared.

As it happens, this particular project does not build with sandboxing enabled, either (whereas it did in prior versions of Bazel), but the cause is not readily discernable.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 15 (10 by maintainers)

Most upvoted comments

textual_hdrs is what we’re using internally, and we’ll make a broad announcement if this is going to change.

I think files in textual_hdrs are allowed to be included by srcs from the rule itself, so if you put the #included .c files in there it should work.

It does technically make them “public”, but I don’t think Bazel currently distinguishes between .h files in hdrs vs srcs anyways.