On Thu, Nov 14, 2013 at 07:01:03PM -0500, Ehsan Akhgari wrote: > On 2013-11-14 6:29 PM, Chris Peterson wrote: > >On 11/14/13, 2:49 PM, Ehsan Akhgari wrote: > >>The way that unified builds work is > >>by using the UNIFIED_SOURCES instead of the SOURCES variable in moz.build > >>files. With that, the build system creates files such as: > >> > >>// Unified_cpp_path_0.cpp > >>#include "Source1.cpp" > >>#include "Source2.cpp" > >>// ... > > > >Are the UNIFIED_SOURCES from one moz.build file ever unified with > >another moz.build file's UNIFIED_SOURCES? > > I don't think so, which is good. You don't want to do that since > then adding a file in one directory can break the build in another! > > >I see that UNIFIED_SOURCES only supports .c and .cpp (and .cc) sources. > >Is there any reason why .mm files are not also supported? Do > >Objective-C's #imports cause problems? > > Ironically I fixed that before seeing your email! See bug 938844. > > > One piece of interesting data point. I have a whole bunch of > patches locally which makes us build all of layout/ in unified mode. > With those patches applied, and after touching all of the .cpp files > in layout/, I can rebuild that directory in about 4 seconds on my > machine. How long this takes without those patches is left as an > exercise for the readers' imagination. :-)
That sounds incredibly low, which got me curious, so I ran the test, without unified sources, because if I am to believe my attempts last year, layout doesn't build this way without modifications. $ find objdir/layout -name '*.o' -delete $ time make -s -C objdir/layout -j12 compile real 1m36.949s user 11m37.836s sys 0m32.834s With ccache and no cache miss. $ find objdir/layout -name '*.o' -delete $ time make -s -C objdir/layout -j12 compile real 0m1.816s user 0m9.273s sys 0m2.616s There is *no way* 1 minute and a half can get down to 4s. So I'll assume your 4 seconds claim is with ccache with no cache miss. I doubt unified vs. non unified makes much difference there. But really, ccache is not the right metric. What's interesting is the actual compilation time, and I'm sure it goes down. Just not down to 4s. Mike _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform