New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 684169 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 26 days ago
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

GN args default values should take into account the default_args in the dotfile

Project Member Reported by brettw@chromium.org, Jan 24 2017

Issue description

The .gn file can now declare default_args which override declare_args defaults. This isn't accounted for when giving the default value of an arg in the tool which is confusing.
 

Comment 1 by brettw@chromium.org, Jan 24 2017

Owner: brettw@chromium.org
Status: Started (was: Available)
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9257ae440105ca90bd219517782cf55258fc830c

commit 9257ae440105ca90bd219517782cf55258fc830c
Author: brettw <brettw@chromium.org>
Date: Wed Jan 25 00:49:55 2017

Display override values in GN args help.

Previously "gn args --list" would display the default value only. Now that we
have default_args in the .gn file, there are more places for the values to come
from and this is confusing (because the default value isn't necessarily what
you get).

This change makes --list display both the current value and the default value,
and the locations of the definitions for each. So when default_args apply, you
can see where the value is set. The same applies to args set in the args.gn
file for a build. It looks like this:

  is_debug
      Current value = false
        From //.gn:15
      Overridden from the default = true
        From //build/config/BUILDCONFIG.gn:154

The short mode --list --short has changed to list the current value rather than
the default.

Some obsolete help text was updated and some unused Args functions were removed.

BUG= 684169 , 416139 

Review-Url: https://codereview.chromium.org/2651023004
Cr-Commit-Position: refs/heads/master@{#445883}

[modify] https://crrev.com/9257ae440105ca90bd219517782cf55258fc830c/tools/gn/args.cc
[modify] https://crrev.com/9257ae440105ca90bd219517782cf55258fc830c/tools/gn/args.h
[modify] https://crrev.com/9257ae440105ca90bd219517782cf55258fc830c/tools/gn/command_args.cc

Comment 3 by brettw@chromium.org, Jan 25 2017

Status: Fixed (was: Started)

Sign in to add a comment