New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Nov 2017
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Sign in to add a comment

Issue 500696: GN unused argument errors should say "WARNING" instead of "ERROR"

Reported by, Jun 15 2015 Project Member

Issue description

(In a Chromium checkout, for example. This is at

$ cat out/Default/ 
# Build arguments go here. Examples:
#   is_component_build = true
#   is_debug = false
# See "gn args <out_dir> --list" for available build arguments.
haha_unused = true
$ gn gen --check out/Default
ERROR at build arg file (use "gn args <out_dir>" to edit):5:15: Build argument has no effect.
haha_unused = true
The variable "haha_unused" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

Possible arguments: host_cpu, is_lsan, host_os, is_tsan, is_msan, target_cpu, current_os, is_desktop_linux, current_cpu, is_asan,
Done. Wrote 2505 targets from 762 files in 1353ms
$ echo $?

Comment 1 by, Jun 15 2015

(The "--check" is a red herring.)

Comment 2 by, Jun 15 2015

Labels: -Pri-2 Pri-3
Status: Available
Summary: GN unused argument errors should say "WARNING" instead of "ERROR" (was: "gn gen --check" exits with "success" for certain errors)
This is non-fatal by design. Ideally the messaging would be better and say "WARNING". But this is the only nonfatal warning in the entire program so there isn't code to vary this string.

Low priority, depending on code complexity may not be worth fixing.

Comment 3 by, Jun 14 2016

Project Member
Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been available for more than 365 days, and should be re-evaluated. Hotlist-Recharge-Cold label is added for tracking. Please re-triage this issue.

For more details visit - Your friendly Sheriffbot

Comment 4 by, Nov 3 2017

I'm trying to compile pdfium with "pdf_is_complete_lib = true" as a step towards using pdfium via FFI from Pharo Smalltalk.

But setting that option reported. ..
ERROR at //.gn:9:28: Build argument has no effect.
v8_extra_library_files = []

I'm a complete noob with ninja and gn (days old) and have no context to judge the importance of such a message or how to solve such an **ERROR**.   The only context I have is the consistent convention I've known the last 20 years that "ERROR" means "WON'T BUILD", so I've lost hours over days googling how to solve this apparent show stopper.  So I'd have to vote for correctness over convenience.  There is always a first non-fatal error, before the next one.

Pragmatically, if a WARNING can't be added to the system, perhaps the at least the error message could be...
  "Build argument has no effect. Really this is only a warning, not an error. Please proceed."

P.S. full `gn args` here...

Comment 5 by, Nov 3 2017

Status: Available (was: Untriaged)

Comment 6 by, Nov 10 2017

Components: Build

Comment 7 by, Nov 14 2017

Project Member
The following revision refers to this bug:

commit e953738ca60cdd39b2602ccbddba55b836b8e57e
Author: Brett Wilson <>
Date: Tue Nov 14 16:21:44 2017

Clarify GN nonfatal unused build arg messages.

Changes the messaging for nonfatal "unused build arg" messages to be
"WARNING" instead of "ERROR" when they are nonfatal and clarify that
the build has continued. Previously it would print "ERROR" and
continue anyway which was confusing.

Add an Err object move constructor and de-inline the assignment
operator (previously implicit).

Bug:  500696 
Change-Id: Id6056b7a4d33466485f9e138a890e211f447817f
Commit-Queue: Brett Wilson <>
Reviewed-by: Will Harris <>
Reviewed-by: Dirk Pranke <>
Cr-Commit-Position: refs/heads/master@{#516320}

Comment 8 by, Nov 14 2017

Status: Fixed (was: Available)

Sign in to add a comment