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

Issue 584683002: Improve GN header checker, make //ui pass. (Closed)

Created:
6 years, 3 months ago by brettw
Modified:
6 years, 3 months ago
Reviewers:
scottmg
CC:
chromium-reviews, ben+aura_chromium.org, zea+watch_chromium.org, peter+watch_chromium.org, sievers+watch_chromium.org, sadrul, tim+watch_chromium.org, extensions-reviews_chromium.org, jam, jbauman+watch_chromium.org, darin-cc_chromium.org, kalyank, erikwright+watch_chromium.org, tdresser+watch_chromium.org, haitaol+watch_chromium.org, chromium-apps-reviews_chromium.org, piman+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, cc-bugs_chromium.org, jochen+watch_chromium.org, maniscalco+watch_chromium.org, Ian Vollick, tfarina, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Improve GN header checker, make "check" on //ui/* pass. I went through and made "gn check //ui/*" pass, and did a lot of enhancements for the bugs I found. Fixes a big bug in the header checker where it did not consider direct private dependencies to be OK from a header include perspective. However, private deps only change things when there are intermediate targets. This patch marks direct deps OK, and changes the variable names from is_public to is_permitted (since it may not actually be public). Allow includes to be permitted if any target allows the include, rather than all of them. This happens if multiple targets have the same file as sources. Strip the generated file directory from the beginning of sources. Previously, this was only for outputs (since typically they're included assuming the root gen dir is on the path). This comes up when an action generates a file, and then it's put into a source set (which we do a lot). This change allows a public dependency on the source set to count for header include purposes. Track public/private deps in the dependency path finder so the error message can show which deps are private that break the chain. This was really helpful when tracking down errors. Add deps and public deps to the build to make check pass. R=scottmg@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/0380637c0085884d209fbbcaf0f0b0871fac162a

Patch Set 1 #

Patch Set 2 : Fix the adnoid #

Total comments: 4

Patch Set 3 : More tests #

Patch Set 4 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -247 lines) Patch
M base/test/BUILD.gn View 1 chunk +5 lines, -2 lines 0 comments Download
M build/config/BUILDCONFIG.gn View 4 chunks +8 lines, -0 lines 0 comments Download
M cc/BUILD.gn View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/shell/BUILD.gn View 1 2 3 2 chunks +9 lines, -6 lines 0 comments Download
M extensions/generated_extensions_api.gni View 1 chunk +4 lines, -5 lines 0 comments Download
M sync/BUILD.gn View 1 chunk +1 line, -2 lines 0 comments Download
M tools/gn/header_checker.h View 1 2 3 chunks +30 lines, -12 lines 0 comments Download
M tools/gn/header_checker.cc View 12 chunks +125 lines, -71 lines 0 comments Download
M tools/gn/header_checker_unittest.cc View 1 2 4 chunks +84 lines, -39 lines 0 comments Download
M ui/accelerometer/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M ui/accessibility/BUILD.gn View 1 chunk +1 line, -3 lines 0 comments Download
M ui/aura/BUILD.gn View 3 chunks +4 lines, -8 lines 0 comments Download
M ui/base/BUILD.gn View 1 2 3 5 chunks +14 lines, -20 lines 0 comments Download
M ui/compositor/BUILD.gn View 1 chunk +4 lines, -2 lines 0 comments Download
M ui/display/BUILD.gn View 3 chunks +5 lines, -1 line 0 comments Download
M ui/events/BUILD.gn View 7 chunks +17 lines, -14 lines 0 comments Download
M ui/events/platform/x11/BUILD.gn View 2 chunks +6 lines, -16 lines 0 comments Download
M ui/gfx/BUILD.gn View 3 chunks +10 lines, -5 lines 0 comments Download
M ui/gl/BUILD.gn View 1 2 chunks +4 lines, -6 lines 0 comments Download
M ui/keyboard/BUILD.gn View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M ui/message_center/BUILD.gn View 3 chunks +8 lines, -3 lines 0 comments Download
M ui/views/BUILD.gn View 9 chunks +26 lines, -14 lines 0 comments Download
M ui/views/controls/webview/BUILD.gn View 2 chunks +10 lines, -7 lines 0 comments Download
M ui/views/examples/BUILD.gn View 2 chunks +6 lines, -0 lines 0 comments Download
M ui/views_content_client/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M ui/web_dialogs/BUILD.gn View 2 chunks +5 lines, -1 line 0 comments Download
M ui/wm/BUILD.gn View 1 chunk +3 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (6 generated)
brettw
Apparently James is on vacation. Can you look at this Scott?
6 years, 3 months ago (2014-09-18 22:01:09 UTC) #3
scottmg
lgtm with those tests, or without if you don't think they add anything. https://codereview.chromium.org/584683002/diff/20001/tools/gn/header_checker.h File ...
6 years, 3 months ago (2014-09-18 22:33:52 UTC) #4
brettw
I added some more testing. Not quite all of what you were suggesting, but should ...
6 years, 3 months ago (2014-09-19 17:03:42 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/584683002/40001
6 years, 3 months ago (2014-09-19 17:04:30 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/58296)
6 years, 3 months ago (2014-09-19 17:08:10 UTC) #9
scottmg
lgtm
6 years, 3 months ago (2014-09-19 17:10:45 UTC) #10
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/0380637c0085884d209fbbcaf0f0b0871fac162a Cr-Commit-Position: refs/heads/master@{#295783}
6 years, 3 months ago (2014-09-19 21:26:35 UTC) #13
brettw
6 years, 3 months ago (2014-09-19 21:26:36 UTC) #14
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as 0380637.

Powered by Google App Engine
This is Rietveld 408576698