New issue
Advanced search Search tips

Issue 862521 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

gn check doesn't take -isystem into account

Project Member Reported by mbonadei@chromium.org, Jul 11

Issue description

gn check is able to enforce dependencies then headers are included starting from the root of the repository or from an include_dir [1].

If -isystem or -imsvc are used (sometimes they are useful in order to avoid to trigger warnings on third_party code), gn check is not able to enforce dependencies because -isystem and -imsvc are considered cflags.

The work to take include_dirs into account is tracked here: https://bugs.chromium.org/p/chromium/issues/detail?id=794926.

[1] - https://chromium.googlesource.com/chromium/src/tools/gn/+/HEAD/docs/reference.md#include_dirs
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/62331d00a03f1585645400c08a2d55b05184db34

commit 62331d00a03f1585645400c08a2d55b05184db34
Author: Mirko Bonadei <mbonadei@chromium.org>
Date: Tue Jul 24 14:49:20 2018

Stop using -isystem and -imsvc because "gn check" ignores them.

Gn check can enforce dependencies only if the header is included with
an absolute path (from the root of the project) or if "include_dirs"
is used. It ignores -isystem and -imsvc since they are part of
cflags (and similar variants).

Since //third_party/abseil-cpp/absl:absl_include_config was using
-isystem and -imsvc only to sidestep compiler warnings in absl code,
it is good to try to switch back to include_dirs instead of adding
-isystem/-imsvc support to "gn check".

Bug: 862521
Change-Id: I9c2d01abad75023918a88f852e3080486dcafead
Reviewed-on: https://chromium-review.googlesource.com/1124478
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577535}
[modify] https://crrev.com/62331d00a03f1585645400c08a2d55b05184db34/third_party/abseil-cpp/BUILD.gn
[modify] https://crrev.com/62331d00a03f1585645400c08a2d55b05184db34/third_party/abseil-cpp/absl/time/BUILD.gn

Owner: mbonadei@chromium.org
Status: Fixed (was: Untriaged)
Cc: mbonadei@chromium.org
Owner: ----
Status: Untriaged (was: Fixed)

Sign in to add a comment