New issue
Advanced search Search tips
Starred by 2 users
Status: Fixed
Owner: ----
Closed: Nov 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment
GN unused argument errors should say "WARNING" instead of "ERROR"
Project Member Reported by viettrungluu@chromium.org, Jun 15 2015 Back to list
(In a Chromium checkout, for example. This is at crrev.com/333737.)

$ cat out/Default/args.gn 
# 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,
<snip>
Done. Wrote 2505 targets from 762 files in 1353ms
$ echo $?
0

 
(The "--check" is a red herring.)
Comment 2 by brettw@chromium.org, 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.
Project Member Comment 3 by sheriffbot@chromium.org, Jun 14 2016
Labels: Hotlist-Recharge-Cold
Status: Untriaged
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 https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
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... https://pastebin.com/rdxc8wvd
Status: Available
Components: Build
Project Member Comment 7 by bugdroid1@chromium.org, Nov 14 (4 days ago)
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e953738ca60cdd39b2602ccbddba55b836b8e57e

commit e953738ca60cdd39b2602ccbddba55b836b8e57e
Author: Brett Wilson <brettw@chromium.org>
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
Reviewed-on: https://chromium-review.googlesource.com/762086
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516320}
[modify] https://crrev.com/e953738ca60cdd39b2602ccbddba55b836b8e57e/tools/gn/args.cc
[modify] https://crrev.com/e953738ca60cdd39b2602ccbddba55b836b8e57e/tools/gn/err.cc
[modify] https://crrev.com/e953738ca60cdd39b2602ccbddba55b836b8e57e/tools/gn/err.h
[modify] https://crrev.com/e953738ca60cdd39b2602ccbddba55b836b8e57e/tools/gn/setup.cc

Comment 8 by brettw@chromium.org, Nov 14 (4 days ago)
Status: Fixed
Sign in to add a comment