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

Issue 2265833002: Implement `gn analyze`. (Closed)

Created:
4 years, 4 months ago by Dirk Pranke
Modified:
4 years, 3 months ago
Reviewers:
brettw
CC:
chromium-reviews, Dirk Pranke, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement `gn analyze`. This CL implements `analyze` natively in GN, fixing some long-standing issues that the implementation in MB had due to its not having access to the full build graph. In particular, `analyze` will now work correctly when given "all" as a compile target, and the list of compile targets will now be pruned/filtered correctly. Note that the input to analyze is different from the input that MB expects, in that GN expects lists of GN labels and source-absolute paths to files, rather than lists of ninja targets and relative paths. MB will be responsible for doing the conversion until we have updated the build recipes to pass the format that GN expects. R=brettw@chromium.org BUG=555273 Committed: https://crrev.com/6d8fdaabe1a8faed9a5573047a2cebdd8456a996 Cr-Commit-Position: refs/heads/master@{#415050}

Patch Set 1 #

Total comments: 1

Patch Set 2 : sample tests #

Total comments: 41

Patch Set 3 : update with review feedback, rename graph -> analyzer, add proper unit tests #

Total comments: 24

Patch Set 4 : update w/ 2nd round of review feedback #

Patch Set 5 : add IsPathSourceAbsolute() to filesystem_utils and allow absolute paths in analyze also #

Patch Set 6 : fix win compile err #

Patch Set 7 : do not pretty print the written json; this gets around crlf issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+925 lines, -11 lines) Patch
M tools/gn/BUILD.gn View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
A tools/gn/analyzer.h View 1 2 3 1 chunk +95 lines, -0 lines 0 comments Download
A tools/gn/analyzer.cc View 1 2 3 4 5 6 1 chunk +405 lines, -0 lines 0 comments Download
A tools/gn/analyzer_unittest.cc View 1 2 3 4 5 6 1 chunk +173 lines, -0 lines 0 comments Download
A tools/gn/command_analyze.cc View 1 2 3 4 5 1 chunk +139 lines, -0 lines 0 comments Download
M tools/gn/commands.h View 1 chunk +5 lines, -0 lines 0 comments Download
M tools/gn/commands.cc View 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/docs/reference.md View 1 2 2 chunks +79 lines, -10 lines 0 comments Download
M tools/gn/filesystem_utils.h View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M tools/gn/filesystem_utils.cc View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M tools/gn/gn.gyp View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M tools/gn/label.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 37 (20 generated)
Dirk Pranke
4 years, 4 months ago (2016-08-22 19:22:40 UTC) #1
brettw
Mostly minor comments, this looks good from a high level. https://codereview.chromium.org/2265833002/diff/1/tools/gn/graph.cc File tools/gn/graph.cc (right): https://codereview.chromium.org/2265833002/diff/1/tools/gn/graph.cc#newcode1 ...
4 years, 4 months ago (2016-08-22 21:08:27 UTC) #2
Dirk Pranke
https://codereview.chromium.org/2265833002/diff/20001/tools/gn/graph.cc File tools/gn/graph.cc (right): https://codereview.chromium.org/2265833002/diff/20001/tools/gn/graph.cc#newcode24 tools/gn/graph.cc:24: Graph::Graph(const TargetVector& all_targets, const Label& default_toolchain) On 2016/08/22 21:08:27, ...
4 years, 4 months ago (2016-08-23 19:27:32 UTC) #3
Dirk Pranke
Okay, everything has been updated (and addressed), I think. Please take another look? Also, let ...
4 years, 4 months ago (2016-08-25 02:51:06 UTC) #8
brettw
lgtm https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc File tools/gn/analyzer.cc (right): https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc#newcode1 tools/gn/analyzer.cc:1: // Copyright (c) 2016 The Chromium Authors. All ...
4 years, 3 months ago (2016-08-25 21:22:30 UTC) #11
Dirk Pranke
https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc File tools/gn/analyzer.cc (right): https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc#newcode1 tools/gn/analyzer.cc:1: // Copyright (c) 2016 The Chromium Authors. All rights ...
4 years, 3 months ago (2016-08-26 00:34:14 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2265833002/140001
4 years, 3 months ago (2016-08-26 17:06:32 UTC) #15
brettw
still lgtm https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc File tools/gn/analyzer.cc (right): https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc#newcode119 tools/gn/analyzer.cc:119: bool IsSourceAbsolute(const std::string& path) { Most of ...
4 years, 3 months ago (2016-08-26 17:09:19 UTC) #16
brettw
still lgtm https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc File tools/gn/analyzer.cc (right): https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc#newcode119 tools/gn/analyzer.cc:119: bool IsSourceAbsolute(const std::string& path) { Most of ...
4 years, 3 months ago (2016-08-26 17:09:19 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2265833002/160001
4 years, 3 months ago (2016-08-26 17:59:21 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/76109)
4 years, 3 months ago (2016-08-26 18:37:54 UTC) #23
Dirk Pranke
https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc File tools/gn/analyzer.cc (right): https://codereview.chromium.org/2265833002/diff/120001/tools/gn/analyzer.cc#newcode119 tools/gn/analyzer.cc:119: bool IsSourceAbsolute(const std::string& path) { On 2016/08/26 17:09:19, brettw ...
4 years, 3 months ago (2016-08-26 20:40:05 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2265833002/180001
4 years, 3 months ago (2016-08-26 20:40:43 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/282325)
4 years, 3 months ago (2016-08-26 22:49:06 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2265833002/200001
4 years, 3 months ago (2016-08-29 19:43:15 UTC) #33
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years, 3 months ago (2016-08-30 03:39:36 UTC) #35
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 03:41:39 UTC) #37
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6d8fdaabe1a8faed9a5573047a2cebdd8456a996
Cr-Commit-Position: refs/heads/master@{#415050}

Powered by Google App Engine
This is Rietveld 408576698