Closed Bug 1090665 Opened 10 years ago Closed 10 years ago

Filter build log by app

Categories

(Firefox OS Graveyard :: Gaia::Build, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gduan, Assigned: rickychien)

Details

Attachments

(1 file)

Currently, there're too many messages when building gaia, especially for r.js.
We should try to filter it and only let necessary message show.
I think we need this if parallel build is merged or the messages would be messed up. We should try to modify below items, and separate log by level in r.js.

https://github.com/mozilla-b2g/gaia/blob/master/build/r.js#L80
https://github.com/mozilla-b2g/gaia/blob/master/build/r-wrapper.js#L18
If you're using actual subprocesses for the builds, I think the ideal thing is just to redirect stdout/stderr to app-specific log-files.

It looks like that's not the case, however.  But it seems easy to address without modifying r.js.  r-wrapper.js appears to create a new sandbox that gets its own instance of r.js and r.js likes to use the "console" object in its global scope.  So if you just:
- make sure r-wrapper.js is invoked once per app so each app gets their own sandbox
- poke a "console" implementation that buffers its output in memory (or writes to an app-specific file)
- modify global.print to just likewise use your console.log

cc'ing James Burke since he's the r.js upstream and may have better thoughts.  (Like gotchas about the implementation deciding it's in a browser instead of "xpconnect" and related unwanted side-effects.)
For r.js, it uses its own logger and only delegates to the host environment via a 'print' module, and for xpconnect, it just uses the `print` function available in that environment:

https://github.com/jrburke/r.js/blob/master/build/jslib/xpconnect/print.js

So it looks like just re-writing what the global.print does in r-wrapper.js may be enough.
Assignee: nobody → ricky060709
Status: NEW → ASSIGNED
Attached file Gaia PR
Add VERBOSE in BUILD_CONFIG in order to enable more r.js detials. I also tweak rebuild.js for skipping rebuild in specific flags such as REBUILD, P, VERBOSE.
Attachment #8525141 - Flags: review?(gduan)
Feel free to test my patch with |make VERBOSE=1| or |make|, you will see some differences.
Comment on attachment 8525141 [details] [review]
Gaia PR

r=gduan,
After it's merged, there would only message from "throw" unless user put VERBOSE=1 in the make command.

I think it looks good to me.
Attachment #8525141 - Flags: review?(gduan) → review+
Merged.

https://github.com/mozilla-b2g/gaia/commit/f473ee1ed1a705597b31f830bdc5d2f7e74910e3
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: