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

Issue 605199 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit 26 days ago
Closed: Apr 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unused build flags should be optionally hard errors

Project Member Reported by beng@google.com, Apr 20 2016

Issue description

ChromeOS will be producing a list of gn vars from an external environment. If the upstream variables change, they would like gn to produce a hard error given the vars they're setting don't exist anymore. This should be optional.
 

Comment 1 by beng@google.com, Apr 20 2016

Cc: dpranke@chromium.org
Owner: ben@chromium.org
Status: Assigned (was: Untriaged)
I believe gn already errors out, and it isn't optional. (i.e., try running gn with 'foo="bar"' set in your args.gn file.
Owner: brettw@chromium.org
Oh. Hmm. GN prints "ERROR at build arg", but the command doesn't actually fail and still returns 0.

We should fix that.
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 24 2016

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

commit 12985c01ad47c1366920941f837fc2f323480c0e
Author: brettw <brettw@chromium.org>
Date: Sun Apr 24 19:03:22 2016

GN flag to fail for unused build args.

This flag was requested by ChromeOS so their bot can notice if their build's args gets out of sync with Chrome's build files.

Also removes printing all possible build args on this error because we've gotten so many that's it's several screen-fulls of text and you can't even read the error.

BUG= 605199 

Review URL: https://codereview.chromium.org/1907613002

Cr-Commit-Position: refs/heads/master@{#389407}

[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/args.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/docs/reference.md
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/setup.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/switches.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/switches.h

Comment 5 by brettw@chromium.org, Apr 24 2016

Status: Fixed (was: Assigned)
Fix landed, will take a bit longer for the binary push.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 25 2016

Labels: merge-merged-2716
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/12985c01ad47c1366920941f837fc2f323480c0e

commit 12985c01ad47c1366920941f837fc2f323480c0e
Author: brettw <brettw@chromium.org>
Date: Sun Apr 24 19:03:22 2016

GN flag to fail for unused build args.

This flag was requested by ChromeOS so their bot can notice if their build's args gets out of sync with Chrome's build files.

Also removes printing all possible build args on this error because we've gotten so many that's it's several screen-fulls of text and you can't even read the error.

BUG= 605199 

Review URL: https://codereview.chromium.org/1907613002

Cr-Commit-Position: refs/heads/master@{#389407}

[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/args.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/docs/reference.md
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/setup.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/switches.cc
[modify] https://crrev.com/12985c01ad47c1366920941f837fc2f323480c0e/tools/gn/switches.h

Sign in to add a comment