New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 809985 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

GN is not complaining when a header file does not exist but it is part of sources

Project Member Reported by mbonadei@chromium.org, Feb 7 2018

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?
 

Comment 1 by bre...@gmail.com, Feb 7 2018

It will only complain when you run "gn check".
Status: WontFix (was: Untriaged)
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