Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Issue 216903004: Add optional public header checking to GN build (Closed)

Created:
6 years, 9 months ago by brettw
Modified:
6 years, 8 months ago
Reviewers:
scottmg
CC:
chromium-reviews
Visibility:
Public.

Description

Add optional public header checking to GN build You can invoke this either using the "--check" argument to the gen command (for use on buildbots) or by running "gn check" (for developer on-demand use). This adds support for "public" headers for a target, and an optional "--check" flag to the gen command that implements checkdeps-like include checking. Basically if you include a file that's declared in the build, it has to be in the public section of one of your dependents (or that dependent doesn't have a public section, which implies everything is public). This roughly maps to Blaze's behavior around the public headers. Moves modp_b64 build file to main tree. Remove modp_b64 hack for older versions of VC missing stdint (this included basictypes which caused a header check failure). I also added some base dependencies and some other minor build changes to solve some other issues identified by the check. The remaining one is that a file in base/metrics depends on ipc (!) BUG= R=scottmg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262216

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : remove check includes #

Patch Set 6 : add command #

Patch Set 7 : #

Total comments: 8

Patch Set 8 : review comments #

Total comments: 1

Patch Set 9 : unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+964 lines, -67 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 5 chunks +4 lines, -4 lines 0 comments Download
M base/test/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M device/usb/BUILD.gn View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
A + third_party/modp_b64/BUILD.gn View 1 2 3 4 5 8 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/modp_b64/README.chromium View 1 2 3 4 5 1 chunk +1 line, -8 lines 0 comments Download
M third_party/modp_b64/modp_b64_data.h View 1 2 3 4 5 1 chunk +0 lines, -9 lines 0 comments Download
M tools/gn/BUILD.gn View 1 2 3 4 5 3 chunks +7 lines, -0 lines 0 comments Download
M tools/gn/binary_target_generator.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
A tools/gn/c_include_iterator.h View 1 2 3 4 5 6 7 8 1 chunk +44 lines, -0 lines 0 comments Download
A tools/gn/c_include_iterator.cc View 1 2 3 4 5 6 7 8 1 chunk +143 lines, -0 lines 0 comments Download
A tools/gn/c_include_iterator_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +92 lines, -0 lines 0 comments Download
A tools/gn/command_check.cc View 1 2 3 4 5 6 1 chunk +40 lines, -0 lines 0 comments Download
M tools/gn/command_gen.cc View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M tools/gn/commands.h View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M tools/gn/commands.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/filesystem_utils.h View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M tools/gn/filesystem_utils.cc View 1 2 3 4 5 2 chunks +9 lines, -25 lines 0 comments Download
M tools/gn/gn.gyp View 1 2 3 4 5 3 chunks +7 lines, -0 lines 0 comments Download
A tools/gn/header_checker.h View 1 2 3 4 5 6 7 1 chunk +116 lines, -0 lines 0 comments Download
A tools/gn/header_checker.cc View 1 2 3 4 5 6 7 1 chunk +242 lines, -0 lines 0 comments Download
A tools/gn/header_checker_unittest.cc View 1 2 3 4 5 1 chunk +102 lines, -0 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 4 5 2 chunks +2 lines, -4 lines 0 comments Download
M tools/gn/secondary/testing/gmock/BUILD.gn View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
D tools/gn/secondary/third_party/modp_b64/BUILD.gn View 1 2 3 4 5 1 chunk +0 lines, -11 lines 0 comments Download
M tools/gn/setup.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M tools/gn/setup.cc View 1 2 3 4 5 6 7 4 chunks +21 lines, -2 lines 0 comments Download
M tools/gn/target.h View 1 2 chunks +12 lines, -0 lines 0 comments Download
M tools/gn/target.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/target_generator.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/target_generator.cc View 1 1 chunk +15 lines, -0 lines 0 comments Download
M tools/gn/trace.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M tools/gn/trace.cc View 1 4 chunks +28 lines, -0 lines 0 comments Download
M tools/gn/variables.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gn/variables.cc View 1 2 3 4 5 2 chunks +40 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
brettw
6 years, 8 months ago (2014-04-04 23:27:33 UTC) #1
scottmg
lgtm https://codereview.chromium.org/216903004/diff/120001/tools/gn/c_include_iterator.cc File tools/gn/c_include_iterator.cc (right): https://codereview.chromium.org/216903004/diff/120001/tools/gn/c_include_iterator.cc#newcode40 tools/gn/c_include_iterator.cc:40: // We on't handle C-style "//" comments since ...
6 years, 8 months ago (2014-04-05 00:40:06 UTC) #2
brettw
https://codereview.chromium.org/216903004/diff/120001/tools/gn/command_check.cc File tools/gn/command_check.cc (right): https://codereview.chromium.org/216903004/diff/120001/tools/gn/command_check.cc#newcode29 tools/gn/command_check.cc:29: if (!setup->DoSetup("//out/Default")) I'm currently using this for all the ...
6 years, 8 months ago (2014-04-07 05:08:19 UTC) #3
sa2213476
On 2014/04/05 00:40:06, scottmg wrote: > lgtm > > https://codereview.chromium.org/216903004/diff/120001/tools/gn/c_include_iterator.cc > File tools/gn/c_include_iterator.cc (right): > ...
6 years, 8 months ago (2014-04-07 05:08:34 UTC) #4
sa2213476
6 years, 8 months ago (2014-04-07 05:10:44 UTC) #5
scottmg
https://codereview.chromium.org/216903004/diff/140001/tools/gn/c_include_iterator.cc File tools/gn/c_include_iterator.cc (right): https://codereview.chromium.org/216903004/diff/140001/tools/gn/c_include_iterator.cc#newcode119 tools/gn/c_include_iterator.cc:119: lines_since_last_include_ = 0; LGTM with test for this.
6 years, 8 months ago (2014-04-07 16:19:50 UTC) #6
brettw
6 years, 8 months ago (2014-04-07 22:17:40 UTC) #7
Message was sent while issue was closed.
Committed patchset #9 manually as r262216.

Powered by Google App Engine
This is Rietveld 408576698