Closed Bug 1278308 Opened 8 years ago Closed 3 years ago

GeckoCppUnitTests seem to wait for libxul to finishing linking before starting compilation

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1573566

People

(Reporter: jrmuizel, Unassigned)

Details

Attachments

(1 file)

This adds a bunch of latency to a clobber build.
I think this is because they build as CPP_UNIT_TESTS, which build as SIMPLE_PROGRAMS, which get compiled and linked in a single compiler invocation, and also they link to libxul, so they can't be compiled until they have a libxul to link against.
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #1)
> I think this is because they build as CPP_UNIT_TESTS, which build as
> SIMPLE_PROGRAMS, which get compiled and linked in a single compiler
> invocation, and also they link to libxul, so they can't be compiled until
> they have a libxul to link against.

Is there any reason we wouldn't want to split out compilation of these from linking so that compilation can happen earlier?
You'll wind up with two compiler invocations per test instead of one. I don't know what sort of impact that'd have on the build time.

I wonder if we could just convert all of these tests to gtests?
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #3)
> You'll wind up with two compiler invocations per test instead of one. I
> don't know what sort of impact that'd have on the build time.

The linker is still being invoked so it's hard for me to imagine that impact of two compiler invocations being noticeable, and being able to do work during libxul linking would help a lot for highly parallel builds.

> I wonder if we could just convert all of these tests to gtests?

Many of them likely can be.
(In reply to Jeff Muizelaar [:jrmuizel] from comment #2)
> (In reply to Ted Mielczarek [:ted.mielczarek] from comment #1)
> > I think this is because they build as CPP_UNIT_TESTS, which build as
> > SIMPLE_PROGRAMS, which get compiled and linked in a single compiler
> > invocation, and also they link to libxul, so they can't be compiled until
> > they have a libxul to link against.
> 
> Is there any reason we wouldn't want to split out compilation of these from
> linking so that compilation can happen earlier?

It's not worth the effort that would require to do it with the current backend. The compilations for those tests are not taking that long. The only caveat is that they have to wait for libxul, and that's not something that can change.
Attached patch PoCSplinter Review
When I said, yesterday, that it should be possible to split building libraries and objects easily, I actually didn't expect the patch to be this short. One downside is that it might make things slower in some edge cases (I'm thinking Windows, here, mostly), so I'm not putting this up for review with a proper commit message etc. until I have ruled that out, but please test this with your icecc setup and check whether it makes a significant difference.
Attachment #8763157 - Flags: feedback?(jmuizelaar)
Attachment #8763157 - Flags: feedback?(ehsan)
Comment on attachment 8763157 [details] [diff] [review]
PoC

I'm not sure how to test this...
Attachment #8763157 - Flags: feedback?(ehsan)
Product: Core → Firefox Build System
Attachment #8763157 - Flags: feedback?(jmuizelaar)
Priority: -- → P5
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: