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

Issue 625122 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: ----



Sign in to add a comment

'gn check' checks #includes that are filtered out by preprocessor conditions.

Project Member Reported by cfroussios@chromium.org, Jul 1 2016

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.



 
Cc: justincohen@chromium.org
I cc'ed justincohen, because vasilii said you've worked on such things before.

Comment 2 by vabr@chromium.org, Jul 1 2016

Labels: Build-Tools-GN
Cc: -justincohen@chromium.org dpranke@chromium.org sdefresne@chromium.org
Cc: bbrettw@chromium.org
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).

Cc: -bbrettw@chromium.org brettw@chromium.org
Status: WontFix (was: Untriaged)
@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