Issue metadata
Sign in to add a comment
|
'gn check' checks #includes that are filtered out by preprocessor conditions. |
||||||||||||||||||||||
Issue description"gn check" on the trybots does not correctly detect that #includes are hidden behind preprocessor conditions. I have created a CL with examples. https://codereview.chromium.org/2113803003/ In the first revision, there is an #error inside the body of a preprocessor condition. This demonstrates which bots should actually be affected by the statements in the body. In the second revision, I include a header without depending on the appropriate target. This is an error that is caught by 'gn check'. The preprocessor condition is the same as before. Expected: the bots that fail should be the same in both cases. Actual: In the case where the failure comes from 'gn check', more bots fail. More specifically, the preprocessor condition is defined(OS_LINUX) && !defined(OS_CHROMEOS) which means that only linux builds are affected. However, mac and win bots fail as well.
,
Jul 1 2016
,
Jul 7 2016
,
Jul 8 2016
I think this is a duplicate. As I remember it, "gn check" does not know the macro defines (or does not use them) and you are supposed to use "// nogncheck" comment on those includes (or if possible split the file in multiple part that are build using the same conditions as the deps).
,
Jul 8 2016
@sdefresne is correct. At the moment, at least, this is by design, as this doesn't come up too often in Chrmoium code and we don't want to complicate and slow down GN too much by having to implement a more fully-featured C preprocessor to deal with it when it does. See https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#nogncheck_Skip-an-include-line-from-checking |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by cfroussios@chromium.org
, Jul 1 2016