|mach warnings-list| and the underlying implementation to parse and store warnings [1] are one of the very first features of mach and there is definite room for improvement. If the functionality isn't doing what you want, send a patch to change it!
We probably could integrate warning parsing into the compiler wrapper script so that we have the exact command arguments and full program output available. Parsing make output is and will always be haphazard. But it was the easiest to implement at the time. [1] https://dxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/compilation/warnings.py On Mon, Jan 12, 2015 at 2:09 PM, Nicholas Nethercote <[email protected] > wrote: > Hi, > > If you do |mach build| and get compile errors, often those errors > scroll quickly off screen and they are mixed in with other lines of > output and it's hard to find them. > > I deal with this by using a bash alias that calls |mach build| and > pipes the output to file. I can then use Vim's quicklists feature to > jump directly to errors in the file. But sometimes I just want to > eyeball the errors directly in the terminal, so in my alias I also > have a post-build step that greps the output file for the first five > error messages. > > This setup works well for me but it's also kinda gross [1] and this > seems like a problem that everybody else working on C++ code has to > deal with as well. So I'm wondering if there are other, better ways of > doing it, and if so, could they be made automatic? There is |mach > warnings-list| which is sort of like this, but not quite. > > Thanks. > > Nick > > [1] How gross? Here are the two most important lines: > > # Send mach's raw output to stdout and $config/log, and the > # timestamp-stripped output to errors.err. The "$| = 1" disables Perl's > # buffering, so the output is available immediately. > MOZCONFIG=$HOME/moz/config/$config nice mach build $restdir 2>&1 | \ > tee >(perl -p -e '$| = 1; s/^ *\d+:\d\d\.\d\d //' > errors.err) \ > $config/log > > # Show up to five errors, with 10 lines of trailing context each. But > # first, truncate line length to 300 chars (because I sometimes get > # extremely long lines describing the command line used, which are > # annoying). > perl -p -e 's/^(.{300}).*$/\1/' $config/log | \ > grep --max-count=5 --before-context=3 --after-context=10 "\<error:" > _______________________________________________ > dev-platform mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

