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

Issue 265693003: Redo GN "args" command (Closed)

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

Description

Redo GN "args" command Previously "gn args" printed build arguments. That has now moved to "gn args <outdir> --list" along with a new --short mode that's a bit more convenient for some uses. Now "gn args" runs your editor on the build arguments for the given output directory, and re-generates the build given those arguments. This is an easier way to manage changing build arguments for a build (previously you would have to re-type everything or edit build.ninja manually). "gn gen" now always uses the existing arguments for the given output dir, unless "--args" is manually specified (giving the old behavior of just using those). This also allows a more convenient way for a user to recover from a borked build (sincetimes I ran into a state where something was missing that prevent ninja from even starting enough to rebuild the build). I removed the "show" and "refresh" ninja phony rules since the new commands cover those cases. This patch adds some additional tracing to build startup since I noticed it was missing when trying to figure out why the args command was so slow (I fixed the main reason, it was with new code I added). Added proper escaping for printing string values and unit tests for these. Two minor build file fixes. R=scottmg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=268042

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : windows #

Total comments: 1

Patch Set 5 : create dir #

Total comments: 7

Patch Set 6 : review comments #

Patch Set 7 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+407 lines, -89 lines) Patch
M build/config/clang/BUILD.gn View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/wtl/BUILD.gn View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 1 comment Download
M tools/gn/args.cc View 1 2 3 4 5 1 chunk +21 lines, -8 lines 0 comments Download
M tools/gn/command_args.cc View 1 2 3 4 5 3 chunks +226 lines, -47 lines 1 comment Download
M tools/gn/escape_unittest.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M tools/gn/gn.gyp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 2 chunks +5 lines, -18 lines 0 comments Download
M tools/gn/setup.h View 3 chunks +29 lines, -0 lines 0 comments Download
M tools/gn/setup.cc View 1 2 3 4 5 8 chunks +98 lines, -7 lines 0 comments Download
M tools/gn/trace.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/trace.cc View 1 2 3 3 chunks +6 lines, -2 lines 0 comments Download
M tools/gn/value.h View 1 chunk +2 lines, -1 line 0 comments Download
M tools/gn/value.cc View 1 2 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
brettw
6 years, 7 months ago (2014-05-01 18:00:04 UTC) #1
tfarina
https://codereview.chromium.org/265693003/diff/60001/tools/gn/args.cc File tools/gn/args.cc (right): https://codereview.chromium.org/265693003/diff/60001/tools/gn/args.cc#newcode31 tools/gn/args.cc:31: " directory will be used (this is in the ...
6 years, 7 months ago (2014-05-01 18:06:46 UTC) #2
brettw
On 2014/05/01 18:06:46, tfarina wrote: > https://codereview.chromium.org/265693003/diff/60001/tools/gn/args.cc > File tools/gn/args.cc (right): > > https://codereview.chromium.org/265693003/diff/60001/tools/gn/args.cc#newcode31 > ...
6 years, 7 months ago (2014-05-01 18:19:48 UTC) #3
scottmg
I don't really love it trying to learn how to launch my editor, but I ...
6 years, 7 months ago (2014-05-01 19:25:02 UTC) #4
brettw
Yeah, the editor stuff is kind of annoying but I think the convenience factor with ...
6 years, 7 months ago (2014-05-01 19:46:54 UTC) #5
brettw
Committed patchset #7 manually as r268042 (presubmit successful).
6 years, 7 months ago (2014-05-03 04:32:25 UTC) #6
tfarina
https://codereview.chromium.org/265693003/diff/170001/tools/gn/BUILD.gn File tools/gn/BUILD.gn (right): https://codereview.chromium.org/265693003/diff/170001/tools/gn/BUILD.gn#newcode206 tools/gn/BUILD.gn:206: "value_unittest.cc", miss 'git add tools/gn/value_unittest.cc'? g++: error: ../../tools/gn/value_unittest.cc: No ...
6 years, 7 months ago (2014-05-03 04:38:24 UTC) #7
tfarina
6 years, 7 months ago (2014-05-03 04:56:55 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/265693003/diff/170001/tools/gn/command_args.cc
File tools/gn/command_args.cc (right):

https://codereview.chromium.org/265693003/diff/170001/tools/gn/command_args.c...
tools/gn/command_args.cc:222: return system(cmd.c_str()) == 0;
and the fix for this? the return type is void rather than bool. The bot was
complaining about this too: 

../../tools/gn/command_args.cc:222:33: error: return-statement with a value, in
function returning 'void' [-fpermissive]

Powered by Google App Engine
This is Rietveld 408576698