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

Issue 212173004: Fix the gn wrapper to be aware of the --root argument. (Closed)

Created:
6 years, 9 months ago by Dirk Pranke
Modified:
6 years, 9 months ago
Reviewers:
brettw
CC:
chromium-reviews, cmp-cc_chromium.org, M-A Ruel, iannucci+depot_tools_chromium.org, ilevy-cc_chromium.org
Visibility:
Public.

Description

Fix the gn wrapper to be aware of the --root argument. The gn binary itself is capable of being run from outside of a checkout as long as you pass the --root flag. However, the gn.py wrapper script needs to *also* know where the the checkout is, in order to figure out how to find the gn binary itself. This patch changes the wrapper to be aware of the --root arg :). R=brettw@chromium.org BUG= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=259998

Patch Set 1 : patch for review #

Total comments: 1

Patch Set 2 : remove TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -1 line) Patch
M gn.py View 1 1 chunk +13 lines, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Dirk Pranke
6 years, 9 months ago (2014-03-27 20:39:29 UTC) #1
brettw
https://codereview.chromium.org/212173004/diff/20001/gn.py File gn.py (right): https://codereview.chromium.org/212173004/diff/20001/gn.py#newcode31 gn.py:31: # TODO(dpranke): It would be nice if '--root foo' ...
6 years, 9 months ago (2014-03-27 21:04:20 UTC) #2
brettw
LGTM otherwise
6 years, 9 months ago (2014-03-27 21:04:29 UTC) #3
Dirk Pranke
On 2014/03/27 21:04:20, brettw wrote: > https://codereview.chromium.org/212173004/diff/20001/gn.py > File gn.py (right): > > https://codereview.chromium.org/212173004/diff/20001/gn.py#newcode31 > ...
6 years, 9 months ago (2014-03-27 21:39:01 UTC) #4
Dirk Pranke
The CQ bit was checked by dpranke@chromium.org
6 years, 9 months ago (2014-03-27 21:40:32 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dpranke@chromium.org/212173004/40001
6 years, 9 months ago (2014-03-27 21:42:26 UTC) #6
commit-bot: I haz the power
Change committed as 259998
6 years, 9 months ago (2014-03-27 21:44:38 UTC) #7
brettw
6 years, 9 months ago (2014-03-27 22:46:27 UTC) #8
Message was sent while issue was closed.
On 2014/03/27 21:39:01, Dirk Pranke wrote:
> On 2014/03/27 21:04:20, brettw wrote:
> > https://codereview.chromium.org/212173004/diff/20001/gn.py
> > File gn.py (right):
> > 
> > https://codereview.chromium.org/212173004/diff/20001/gn.py#newcode31
> > gn.py:31: # TODO(dpranke): It would be nice if '--root foo' worked in
addition
> > I disagree that this should be supported and I'd just remove this todo.
Normal
> > Unix command line parsing is either a single "-" with a single letter option
> and
> > no equal sign (optional space separating them) or a double "--" with an
equal
> > sign. Chrome's command-line parsing follows this, so I don't see why GN
should
> > be any different.
> 
> I'm happy to remove the TODO, but your statement about unix command line
> conventions is partially wrong. long-style ("--") options aren't traditional
> UNIX at all, they're GNU style (of course, this is a pedantic distinction at
> this point).
> 
> More importantly, for GNU-style long options, "--include=foo" and "--include
> foo" are both usually accepted and legal. The GNU coding standards are oddly
> unclear on this, but docs for individual commands (like tar) are quite clear.
I
> believe gflags works this way as well, and certainly Pythonic arg parsing
works
> this way.
> 
> You're probably right that Chromium's arg parsing doesn't.

I looked at a bunch of Linux tools before posting my reply and the man page
listed the = as being required. It looks like the tar man page you specify
randomly specifies one or the other. It looks like they both accept either way
in practice. I still don't think we should change this.

Powered by Google App Engine
This is Rietveld 408576698