Missing file in hdrs attribute of cc_library
rule causes a RuntimeException
#8350
Labels
P2
We'll consider working on this in future. (Assignee optional)
stale
Issues or PRs that are stale (no activity for 30 days)
team-Rules-CPP
Issues for C++ rules
type: bug
Description of the problem:
Missing file in
hdrs
attribute ofcc_library
rule causes a RuntimeException instead of a proper error message. However, this only happens in a very specific case illustrated in theBUILD
file below. I'm using two different toolchains (Visual Studio for local builds, a cross GCC toolchain for an ARM target). Only in case if thecc_library
rule is reference from targets built by both toolchains this happens.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
This was a hard one to isolate...
Create a workspace with empty WORKSPACE and BUILD files in the root folder. Add the following files:
In
Bar/inc/lib.h
Bar/inc/lib_internal.h
can be empty.In
Bar/lib.cpp
:In
Bar/test.cpp
:Finally, in
Bar/BUILD
:The last commands mentioned in the comment in the
BUILD
file results in the following output:What operating system are you running Bazel on?
Windows 10
What's the output of
bazel info release
?Also works with 0.25.2.
Might not reproduce with 0.18.1, however I can't get mingw properly to work with that version.
Have you found anything relevant by searching the web?
Issues #7279 and #7247 mention the same kind of exception location, but for me they don't seem to be related.
Any other information, logs, or outputs that you want to share?
If the last command is executed a second time, the build runs fine (although I would expect an error because
lib_internal.h
isn't mentioned in thehdrs
attribute?)The text was updated successfully, but these errors were encountered: