GN is not complaining when a header file does not exist but it is part of sources |
||
Issue description
Hi,
today I was investigating a weird failure and after some time I realized that GN does not complain if we add a non existing header file to a GN target.
E.g.:
$ cat tools/gn/BUILD.gn
[...]
source_set("foo") {
sources = ["src/bar.h"] # src/bar.h does not exists
}
[...]
$ ninja -C out/Default tools/gn:foo
ninja: Entering directory `out/Default'
[1/1] Regenerating ninja files
[1/1] STAMP obj/tools/gn/foo.stamp
$ echo $?
0
I understand why this happens. Header files are not compiled if they are not included so, this will not trigger any error when ninja runs. But isn't it weird that GN is not complaining about it?
,
Feb 7 2018
After thinking a bit, this makes sense. In WebRTC we use 'gn check' but I had to disable it on a couple of folders because after https://chromium-review.googlesource.com/827014 it discovered some missing deps that result in circular dependencies (thanks for improving it). Today I was looking at a CL with a wrong header and I though... "this should not happen, GN should complain!", but now I realize that the target was part of a directory I had to skip, so 'gn check' was ignoring it. :-) I think it is fine. Thanks! |
||
►
Sign in to add a comment |
||
Comment 1 by bre...@gmail.com
, Feb 7 2018