Open Bug 1401255 Opened 7 years ago Updated 2 years ago

Unrecognized flag in mozconfig will trigger backtrace with "raise InvalidOptionError('Unknown option: %s' % without_value)" python backtrace, before the actual useful error message

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox57 wontfix)

Tracking Status
firefox57 --- wontfix

People

(Reporter: dholbert, Unassigned)

References

Details

STR: 1. Put this in your mozconfig (e.g. as the only line): ac_add_options --disable-something 2. ./mach build ACTUAL RESULTS: Seven lines of confusing backtrace, before the one human-readable line of useful error output. Specifically, here's the output I get: === 0:02.78 checking for the target C compiler... /usr/bin/clang 0:02.82 checking whether the target C compiler can be used... yes 0:02.82 Traceback (most recent call last): 0:02.82 File "$SRC/configure.py", line 124, in <module> 0:02.82 sys.exit(main(sys.argv)) 0:02.82 File "$SRC/configure.py", line 29, in main 0:02.82 sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure')) 0:02.82 File "$SRC/python/mozbuild/mozbuild/configure/__init__.py", line 423, in run 0:02.82 raise InvalidOptionError('Unknown option: %s' % without_value) 0:02.82 mozbuild.configure.options.InvalidOptionError: Unknown option: --disable-something 0:02.84 *** Fix above errors and then restart with\ 0:02.84 "/usr/bin/make -f client.mk build" 0:02.84 client.mk:384: recipe for target 'configure' failed 0:02.84 make: *** [configure] Error 1 When I first read this, I misread this line... > raise InvalidOptionError('Unknown option: %s' % without_value) ...as saying "Unknown option %s without value". That made this extra confusing... EXPECTED RESULTS: Could we skip the backtrace here and just print the error itself? That would make this output much easier to interpret at a quick glance, IMO. The backtrace is just noise (particularly given its "%s' % without_value" raw-python).
Summary: Any unrecognized flag in mozconfig will trigger bogus "raise InvalidOptionError('Unknown option: %s' % without_value)" python backtrace, before the useful error message → Any unrecognized flag in mozconfig will trigger backtrace with "raise InvalidOptionError('Unknown option: %s' % without_value)" python backtrace, before the actual useful error message
Note that we actually have 12 lines of error output here, and only 1 of them is actually usefully pointing at the problem. (There are 7 lines of backtrace, then 1 line indicating the problem, then 4 lines of more noise "Fix the above errors, and then run this command that you won't actually really run because nobody builds that way. Failed, Error 1".) My concern here is the low signal-to-noise ratio (and the work involved to figure out which line (if any) is indicative of something that I need to fix vs. whether the build error is due to a bug in the build system / toolchain / whatever). We should surface the error more clearly/concisely here.
See Also: → 1401258
(I filed bug 1401258 on the fact that this error output incorrectly instructs me to use "make", too.)
Summary: Any unrecognized flag in mozconfig will trigger backtrace with "raise InvalidOptionError('Unknown option: %s' % without_value)" python backtrace, before the actual useful error message → Unrecognized flag in mozconfig will trigger backtrace with "raise InvalidOptionError('Unknown option: %s' % without_value)" python backtrace, before the actual useful error message
This feels like a minor regression as part of porting to moz.configure. Updating release tracking flag because it doesn't impact end-users.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.