DescriptionChange GN to disallow reading args defined in the same declare_args() call.
If you have a declare_args() block like:
declare_args() {
use_foo = true
use_bar = use_foo
}
currently this will probably produce behavior different than you might
expect. In the normal case (where you don't use use_foo=false in args.gn),
both use_foo and use_bar will bet set to true, but if you do set
use_foo=false in args.gn, use_foo will be set to false, but use_bar
will still be set to true. This happens because GN evaluates the value
of foo inside the block *before* it looks for arg overrides.
We've decided that this is bad enough to flat-out disallow. Now if you
try to do this GN will just return an error. If you want to have one
declared arg depend on the value of another, you need to put them in
separate declare_arg() calls.
This is changing the behavior of GN in a way that may break existing
builds, but hopefully that will happen only rarely and if it does will
expose the surprises that might otherwise be lurking undetected.
In the Chromium build, it turned out we only did this a few times and
they were all unintentional, so this correctly found bugs.
R=brettw@chromium.org, kjellander@chromium.org
BUG=542846
Committed: https://crrev.com/f6fd4d747c77e1c7968eb5af8b195a94a7ed2fac
Cr-Commit-Position: refs/heads/master@{#433944}
Patch Set 1 : initial patch for review #
Total comments: 6
Patch Set 2 : update w/ review feedback #Patch Set 3 : add tests #
Total comments: 4
Patch Set 4 : update w/ review feedback #Patch Set 5 : update w/ review feedback #
Total comments: 1
Messages
Total messages: 21 (8 generated)
|