|mach build| should make error messages easier to spot

NEW
Unassigned

Status

Firefox Build System
General
5 years ago
5 months ago

People

(Reporter: njn, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mach])

(Reporter)

Description

5 years ago
Finding the errors among all the other spew in a browser build can be difficult.  I have a |mach build| wrapper that ends with this code:

    echo
    echo "======================================="
    echo "errors"
    echo "======================================="
    echo
    # 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/' $objdir/log | \
        grep --max-count=5 --before-context=3 --after-context=10 "\<error:"

The idea is that it plucks out the first five compile errors, each with a bit of context.  It would be nice if |mach build| did this for me.
(Reporter)

Updated

5 years ago
Summary: |mach build| should → |mach build| should make error messages easier to spot
(Reporter)

Comment 1

5 years ago
> It would be nice if |mach build| did this for me.

Make that "absolutely delightful", actually.

Updated

5 years ago
Component: mach → Build Config
Whiteboard: [mach]
(Reporter)

Comment 2

5 years ago
Something relevant:  glandium mentioned the mach statusbar today and I had absolutely no idea what he was talking about.  Turns out you don't see it if you redirect mach's output...

Comment 3

5 years ago
(In reply to Nicholas Nethercote [:njn] from comment #2)
> Something relevant:  glandium mentioned the mach statusbar today and I had
> absolutely no idea what he was talking about.  Turns out you don't see it if
> you redirect mach's output...

The status bar is only rendered if isatty(stdout) because it sends terminal escaping sequences that you probably don't want printed to a file/pipe. There is currently no way to override this, although we could probably offer one.
(Reporter)

Comment 4

5 years ago
> The status bar is only rendered if isatty(stdout)

Which is perfectly reasonable.  My point, which I should have made clearer, is that if mach nicely pulled out the error messages, people might not have to redirect its output for their own ad hoc post-processing, and then they would see the status bar :)

(I would still redirect, though, because I need the output in a file to use vim's quickfix mode.  Hmm, if |mach build| could do the redirection itself, I could get the statusbar and the redirection I need...)
Also note this is going to be made increasingly important as we make the build system more parallel. Because it's harder to find error in parallel builds.

Updated

5 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.